Skip to Content
0
Former Member
Sep 01, 2006 at 10:44 AM

How to use FTP_COMMAND to put a file in the target system

2067 Views

Hi All,

I have the requirement to put an excel file from apllication server to another remote system for this i am using the function modules

1) FTP_CONNECT to connect to the sourece as well as the destination systems --- Here i am able to hit the both systems.

2) for sending the data to the target system i am using FTP_COMMAND by passing the 'put' statement along with the soruce and destinations for the command parameter.

See the bellow code

CONCATENATE 'put' v_fname '
' 'wbrs1\' folder

into cmd separated by space.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

HANDLE = dhdl

command = cmd

COMPRESS = 'N'

  • VERIFY =

  • RFC_DESTINATION =

  • IMPORTING

  • FILESIZE =

  • FILEDATE =

  • FILETIME =

tables

data = result

EXCEPTIONS

TCPIP_ERROR = 1

COMMAND_ERROR = 2

DATA_ERROR = 3

OTHERS = 4

.

Here v_name is the file path and name in the application server suppose say :

/usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS

and wbrs1 is the target system and 'Waynesboro DFS' is the folder name i ma passing to the command .

Also I tried with the following statement

CONCATENATE 'put' v_fname '
' dhost folder

into cmd separated by space.

Here v_name is the file path and name in the application server suppose say :

/usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS,

Dhost is wbrs1.wb.na.webdti.com

And Waynesboro DFS is the folder .

Here i am getting the error as invalid argument.

See the bellow messages from result internal table.

put /usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS
wbrs1\ Waynesboro DFS

open /usr/sap/TD2/DVEBMGS01/work/TD2_20060901_1008_WAY-LY.XLS errno 22: Invalid argument

Please let me know how i can resolve this problem and how can I put this file in the destination system.

Thanks in advance.

Regards,

Venkat