Q

How can I bring a text file from a different server into my APAB or SAP server?

Hello, Matthew. Can you explain how to bring a text file from a different server into my ABAP or SAP server. The servers (SAP and other) are mapped to each other (although they are in different domains and have no trust between them), and I need to FTP the file so that I can process the data with the ABAP. The Windows FTP function is giving me problems, and I would like to FTP directly from my ABAP. I've had a look at the standard program...

RSEPSFTP, but this does not allow for the creation of variants, which I need, to run the program at 1:00 a.m. Thank you for any advice/explanation. You need to set up a command in SM69 with additional parameters. For Unix, the command is "sh", which runs a shell script.

Create the needed FTP commands as an FTP script in ABAP in an internal table. Transfer the FTP script as a file to your server using:

      open dataset script_file 
        for output 
        in text mode. 
      loop at script. 
        transfer script to script_file. 
      endloop.
Where script_file is the output file name. Then you create the Unix shell script, which calls the FTP script, and transfer that to your server.

Call function module SXPG_CALL_SYSTEM to launch your shell script (using the command you set up earlier), which will then call the FTP script, and your FTP is performed.

You can do the same with other OSes with different commands, but the principle is the same. You could set up the FTP as a command directly, but doing the two-step approach allows more flexibility (e.g., moving the source file to another directory after the FTP).

This was first published in September 2004

Dig deeper on SAP ABAP

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

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

Your password has been sent to:

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close