Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get data from FTP Server

Former Member
0 Likes
731

Hi all,

I should access an external server(FTP) and get data which is in the form of flat file.

The Flat files are in a server. Eg:- ftp://b2b.xyz.com

Can anyone let me how I can do this in an SAP Program.

Thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
580

User Trasaction CG3Y/CG3Z

Message was edited by:

Prashant Patil

Read only

Former Member
0 Likes
580

Hi!

First you have to run ftp, as an external program. Make a configuration file and put it into the same dir, in your ftp exists, and make the ftp to use the config file.

Try using SXPG_COMMAND_EXECUTE fm to this.

Then you can query the content of a directory with EPS_GET_DIRECTORY_LISTING

fm.

Then use OPEN DATASET - CLOSE DATASET to manipulate the files within the directory.

Regards

Tamá

Read only

varma_narayana
Active Contributor
0 Likes
580

Hi

You can use the FMs for FTP communication.

FTP_CONNECT

FTP_COMMAND

Check the other FMs in SE37 using FTP_* SEARCH...

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
580

Go to command promp(or DOS prompt).

Change directory to place where you want to store file (which you get from 3rd party machine).

Type command " FTP ipaddress"

it prompts for UserId and followed by password to login to remote machine.

Enter ftp command "get filename" to get file to your machine.

Enter command" Bye" to exit from FTP.

Let me know if you need any more details.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo