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

FTP command

former_member190312
Active Participant
0 Likes
897

Hi folks,

i have one file in directory1 . i want to move that file from directory1 to directory2 using FTP command.

what r the FTP commands i need to use to achieve this in SAP ?

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
592

Hi,

For single files you can use EPS_FTP_PUT or EPS_FTP_GET (depending on whether you push or pull your files).

For multiple files

EPS_FTP_MPUT and EPS_FTP_MGET.

CALL FUNCTION 'EPS_FTP_PUT'

Import parameters Value

RFC_DESTINATION = NONE

LOCAL_FILE = filename

LOCAL_DIRECTORY = /dir1/dir2

REMOTE_FILE = filename

REMOTE_DIRECTORY = /dir1

OVERWRITE_MODE = F " force -> overwrite existing file

TEXT_MODE = B " binary

TRANSMISSION_MONITOR X " display transmission monitor

*RECORDS_PER_TRANSFER 10

*REQUESTED_FILE_SIZE 0

*MONITOR_TITLE

*MONITOR_TEXT1

*MONITOR_TEXT2

*PROGRESS_TEXT

*OBJECT_NAME [/code]

2 REPLIES 2
Read only

Former Member
0 Likes
592

Have a look at the functions in group SFTP, e.g. FTP_COMMAND, and some of the sample code for these e.g.


RSFTP002                               Execute FTP Command                               
RSFTP003                               FTP put / get Test                                
RSFTP004                               FTP Copy                                          
RSFTP007                               Test FB:FTP_SERVER_TO_R3 / FTP_R3_TO_SERVER       
RSFTP008                               Test FB:FTP_CLIENT_TO_R3 / FTP_R3_TO_CLIENT       
RSFTP009                               Test FTP put with Verify                          
RSFTP011                               FTP Copy  

Jonathan

Read only

Former Member
0 Likes
593

Hi,

For single files you can use EPS_FTP_PUT or EPS_FTP_GET (depending on whether you push or pull your files).

For multiple files

EPS_FTP_MPUT and EPS_FTP_MGET.

CALL FUNCTION 'EPS_FTP_PUT'

Import parameters Value

RFC_DESTINATION = NONE

LOCAL_FILE = filename

LOCAL_DIRECTORY = /dir1/dir2

REMOTE_FILE = filename

REMOTE_DIRECTORY = /dir1

OVERWRITE_MODE = F " force -> overwrite existing file

TEXT_MODE = B " binary

TRANSMISSION_MONITOR X " display transmission monitor

*RECORDS_PER_TRANSFER 10

*REQUESTED_FILE_SIZE 0

*MONITOR_TITLE

*MONITOR_TEXT1

*MONITOR_TEXT2

*PROGRESS_TEXT

*OBJECT_NAME [/code]