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