How can i run the shell script from ABAP programming language


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can i run the shell script from ABAP programming language
# 15  
Old 06-20-2011
I am sorry if i frustrate you at the repeated questions.

Then don't use one. I was just trying to be complete.
I am reallly not sure. because we are very new to this FTP server. They just provided me a GUI tool (FTP server's flat files stores in the main folder under main object) to login to it with the User ID and PW and then i can see it. I wants now to ask you that plz suggest me that how i can find the remote path to put in SSH code?

Do you actually need a remote path? Can you just sftp into username@server then MGET *.xls? Have you actually tried? Try just typing it into a terminal and see what happens.

I tried it long time ago, it was saying that EXPECT is not installed in your system. also, as you said "no expect madness required", that is the reason i wants to switch it to "SSH"
So, i wants to check with you finally the below code is a complete code that you are suggesting me to compile and execute? or does it need any changes if i did wrong specifics?. I am only looking for the code at the moment that can push the file from FTP server (Windows OS) to Application server (Linux OS - /usr/sap/NXA/COMM/interface/FICO/)
_____________________________________________________________
sftp FICO@share.dteenergy.com <<EOF
cd /usr/sap/NXA/COMM/interface/FICO/
lcd /usr/sap/NXA/COMM/interface/FICO/ (local path)
mget GET_FILE*
EOF
_____________________________________________________________

Last edited by Venkat1818; 06-20-2011 at 03:29 PM..
# 16  
Old 06-20-2011
Quote:
Originally Posted by Venkat1818
I tried it long time ago, it was saying that EXPECT is not installed in your system.
I have absolutely no idea what you tried, but whatever it is, it's not what I suggested.

Code:
sftp username@host <<EOF
mget GET_FILE*
EOF

Type it into your shell.

Does it work or not?

Quote:
also, as you said "no expect madness required", that is the reason i wants to switch it to "SSH"
you can stop putting expect junk back into it, then Smilie
Quote:
So, i wants to check with you finally the below code is a complete code that you are suggesting me to compile and execute?
It's a shell script. There's no compile, just execute.
Quote:
or does it need any changes if i did wrong specifics?
I have no idea if it needs changes. That depends on what files are where and where you are when you login and where you want to store the files. There's no way for me to do everything for you. You're going to have to start trying things, and start reading instead of copypasting. It'll help to do things in parts, instead of trying everything at once. Get your sftp working first, if that doesn't go then the rest is pointless.

Your sftp server being Windows could make it tougher to use keys though. Depending on what it is, it might still be possible, but copying the keys might not work the same way. try ssh-copy-id first though and if it works, it works.

Last edited by Corona688; 06-20-2011 at 03:32 PM..
# 17  
Old 06-20-2011
As i mentioned, i am very new to this subject. if possible, please provide me the code otherwise, let us pass it to the other users if somebody wants to help me.
I am a SAP guy. not a Linux. I am trying to move the flat file from FTP server (It is on Windows O.S) to Application server (Linux O.S - This i know the path to where it should get). Infact, i dont have a access to execute a single commands or entire script at linux level. for that i again have to write a ABAP program to execute that script. So plz help if you can. Thank you so much.
# 18  
Old 06-20-2011
It'd be nice to have known that you don't have shell access days ago...

I'm not stopping other users from contributing. I presume they're not because they lack the same information I and perhaps you do.

I can't give you a canned script for all the reasons I mentioned before. These reasons apply to other folks as well I think, they're not psychic either.

I have no idea how they expect you to write a UNIX script without shell access. It's going to be a monumental task to troubleshoot it and/or install the xls converter without it.

Are you sure you don't have access? You think you'd need shell access to run shell scripts. Try logging in with putty, same username/password as your windows ABAP thing is using to connect to the linux server.

Last edited by Corona688; 06-20-2011 at 04:07 PM..
# 19  
Old 06-20-2011
It'd be nice to have known that you don't have shell access days ago...
Yes you will get to know in going forward that once you get a chance to work on three tier architecture.

I'm not stopping other users from contributing. I presume they're not because they lack the same information I and perhaps you do.
Thanks for not going to stop other users from contributing. I don think so. I hope everybody is not here for needing the information. sometimes others may come up with the updated information as they might have already faced the same kind of problems and solved it by theirselves and the same can be passed to us.

I can't give you a canned script for all the reasons I mentioned before. These reasons apply to other folks as well I think, they're not psychic either.
No problem. I can understand the reason why you cannot give and what kind of psychic you are.. I dont think that other folks as well, may be let us wait and watch the game. in worst cases, if that doesnt happen then i will recommend my PM to call a shell script developer who has worked in multiple environments.

I still beleive this forum that we have very good experts like DgPicket and etc. Hope this will get resolved.


I have no idea how they expect you to write a UNIX script without shell access. It's going to be a monumental task to troubleshoot it and/or install the xls converter without it.
As far as i presume that you have a good experience in your subject but that wont be enough to contribute in forums atleast before commenting against others questions. let us wait and watch the game if somebody come up with the solution or i may post the answer too after a while.

Are you sure you don't have access? Try logging in with putty, same username/password as your windows ABAP thing is using to connect to the linux server.
Yes i am sure that we dont have a access to execute the commnd wise/scriptwise at unix level. i have a option in SAP that i can develop a own command like telnet (ExSmilie to test the single commands and need to write a ABAP program to execute the entire script.
# 20  
Old 06-22-2011
The reason there is an sftp command is to support old FTP scripts (and those so old they cannot learn a new command?). For new work, scp seems much simpler and more powerful.

If you use relative paths in sftp, you can use the same relative paths in scp.
# 21  
Old 06-22-2011
Thank you DGPicket for the reply. I should not ask you the same question again and again but should be becuase since i am a fresher with this shell script, and not aware of much, is it possible for you to send me the SCP code(practical code)? it would be highly appreciated.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

3. Programming

How is a new Web Development language written ?

I'm wondering how programmers develop new Web Development languages because I want to learn how everything begins from the start. Let's say I'm planning to write a new language for the Web. How do I do this? Is there anyone who knows about the way Web Development languages first appear ? I'm... (3 Replies)
Discussion started by: Anna Hussie
3 Replies

4. UNIX for Dummies Questions & Answers

Is PERL a programming language?

I need a small and simple clarification... Can someone tell me whether PERL is a programming language or not. Also, can shell scripts also considered as programming language or not. Also, please tell me the exact difference between programming language and scripting. Please help.... (3 Replies)
Discussion started by: Anjan1
3 Replies

5. UNIX for Dummies Questions & Answers

Carreer:Networking Programming in Unix (C programming Language)

Hello, I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies

6. Programming

c programming language

Can someone enligten me on what below program does? I understand getchar and putchar.. but what is this program suppose to do? I try to put printf on it, but it shows nothing.. can someone explain to me what this program is suppose to do? It is reading something and assigning to c? so, if... (8 Replies)
Discussion started by: convenientstore
8 Replies

7. UNIX for Dummies Questions & Answers

Does the programming language matters?

I see you guys encouraged people studied and used C while they were working on UNIX. Does C++ or JAVA matter? And in the past threads, Neo, PxT, and other members recommanded lots good books. I think those people who asked for the references, such as Dominic, had experiences on sys admin or... (8 Replies)
Discussion started by: HOUSCOUS
8 Replies
Login or Register to Ask a Question