‎2006 Aug 24 2:48 PM
Hi All,
I have following requirement regarding FTP.
My program will run in background & search file(s) in FTP folder which is on FTP server. I have check SAP forum & web blogs but not getting how to achieve this.
Kindly suggest if any solution on this.
Regards,
Dilip
‎2006 Aug 24 2:57 PM
1. Create a UNIX script that executes an FTP to the remote server and performs a directory listing.
2. Create external command using SM69
3. Call external command in program via function SXPG_COMMAND_EXECUTE
This will return your program with a list of files on the remote system. Use similar technique to retrieve specific files as needed.
‎2006 Aug 24 3:06 PM
Hi Michel,
Thanks for your quick reply. Is there any function module to reach the FTP folder on FTP server?
I don't under your 1st point, can you please explain in brief.
<b>1. Create a UNIX script that executes an FTP to the remote server and performs a directory listing.</b>
Regards,
Dilip
Message was edited by: Diliip Gupchup
‎2006 Aug 24 3:12 PM
If you want a function module look at functions that begin with 'FTP'. There are functions for connect, disconnect, command, etc. I've always written scripts for this purpose, but the functions seem to be pretty self-explanatory.
If you would like more info on scripting, let me know. Are you running on UNIX?
When you initially connect using FTP_CONNECT you will receive a HANDLE. Use this HANDLE when calling follow-on functions like FTP_COMMAND.
‎2006 Aug 24 3:42 PM
Hi Michel,
For FTP_CONNECT ZI have to pass Uname, PWD,
Host & RFC destination. I want to know what is meant by Host and how to create RFC destination for FTP folder?
Yes definately I want to knmow more on scripting as I am going to use FTP_CONNECT, FTP_COMMAND & FTP_DISCONNECT.
Regards,
Dilip
‎2006 Aug 24 4:02 PM
In my case, scripting is an alternative to the SAP functions. There is a really good weblog on these functions at:
/people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap
It refers to a sample SAP program called RSFTP002 that will provide the necessary code for using the functions. It also refers to program RSFTP005 to generate the RFC destination.
I'll try to find a sample UNIX FTP script so you have an alternative.