How to call a shell script from ABAP program?

Tags:
Flat files
FTP Server
Linux
SAP ABAP
Shell scripts
This question is to SANDEEP KULKARNI. If he is still with this website then please respond to this question, if not, requesting other users to provide real time solution. Also, requesting this forum owner to pass the SANDEEP KULKARNI's email ID/contact number.

Question is:

I have a shell script written for moving the flat file from FTP server(Windows Operating System) to SAP Application server (Linux Operating System). I donot have a access to execute that script at linux level but i can write a ABAP program to execute the same so that the script will move the flat file from remote server(FTP) to local server (App server). I requesting, could you plz provide me the ABAP code to call the script? Also i have a no.of questions to ask. i will come one by one.

Why only asking sandeep means. He posted a newsletter that how to move a file from one folder to another folder. i am expecting the similar answers. also, i beleive somebody also could do. hope its not hurting anybody. sorry. 



Software/Hardware used:
Linux, ABAP

Answer Wiki

Thanks. We'll let you know when a new response is added.

<b>OPEN DATASET
l_oldfile
FOR INPUT
IN TEXT MODE
ENCODING DEFAULT.

IF sy-subrc EQ .

OPEN DATASET
l_newfile
FOR OUTPUT
IN TEXT MODE
ENCODING DEFAULT.

IF sy-subrc EQ 0.

DO.

READ DATASET
l_oldfile
INTO
l_newline. “Variable l_newline is for holding the read line from l_oldfile

IF sy-subrc EQ 0.

TRANSFER l_newline
TO l_newfile.

ELSE.

EXIT.

ENDIF.

ENDDO.

WRITE ‘Data transferred successfully’.

ELSE.

WRITE ‘Failure in transferring data’.

ENDIF.

CLOSE DATASET
l_oldfile.

CLOSE DATASET
l_newfile.

DELETE DATASET
l_oldfile.</b>

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Chippy088
    I think you have to realise that if you do not have personal contact information, then we can not, and should not pass it on without permission. Your question will be answered by anyone willing to respond.
    4,625 pointsBadges:
    report
  • CallingscriptfromABAP
    provided a personal information. Thanks
    15 pointsBadges:
    report
  • EmNichs
    For privacy purposes, we do not give out user email/contact information to other users. If you wish to ask a specific member a question, you can email me at enichols [at] techtarget [dot] com and I will be happy to pass the question along to the member (please provide the member username). Thanks, Em
    3,250 pointsBadges:
    report
  • edv4you
    se38 rsbdcos0 2>1 <ENTER> Path/program/script
    155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following