Ask the Expert

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.

    Requires Free Membership to View

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

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
Sort by: OldestNewest

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: