Application Development 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: 

FTP_COMMAND error

vallamuthu_madheswaran2
Active Contributor
0 Kudos
202

Hi all,

I am usinf FM "FTP_COMMAND"

i am getting the following error

put hb_file.txt

open hb_file.txt errno 22: Invalid argument

Thanks & Regards,

vallamuthu.M

4 REPLIES 4

Former Member
0 Kudos
83

Hi,

Try passing the entire file path.

regards,

Advait.

Former Member
0 Kudos
83

Hi ,

Please go through the following code.

DATA: W_USER(12) TYPE C ,

W_PWD(20) TYPE C ,

W_HOST(64) TYPE C.

DATA: HDL TYPE I,

KEY TYPE I VALUE 26101957,

DSTLEN TYPE I.

DATA: BEGIN OF RESULT OCCURS 0,

LINE(100) TYPE C,

END OF RESULT.

DESCRIBE FIELD PWD LENGTH DSTLEN.

CALL 'AB_RFC_X_SCRAMBLE_STRING'

ID 'SOURCE' FIELD PWD ID 'KEY' FIELD KEY

ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD PWD

ID 'DSTLEN' FIELD DSTLEN.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

USER = USER

PASSWORD = PWD

HOST = HOST

RFC_DESTINATION = 'SAPFTP'

IMPORTING

HANDLE = HDL.

LOOP AT COMMANDS.

IF COMMANDS NE ' '.

CALL FUNCTION 'FTP_COMMAND'

EXPORTING

HANDLE = HDL

COMMAND = COMMANDS

TABLES

DATA = RESULT

EXCEPTIONS

COMMAND_ERROR = 1

TCPIP_ERROR = 2.

LOOP AT RESULT.

WRITE AT / RESULT-LINE.

IF RESULT CS 'error'.

RAISE NO_SUCH_FILE.

ENDIF.

ENDLOOP.

REFRESH RESULT.

ENDIF.

ENDLOOP.

CALL FUNCTION 'FTP_DISCONNECT'

EXPORTING

HANDLE = HDL.

Reward points if helpful.

Thanks and regards.

vallamuthu_madheswaran2
Active Contributor
0 Kudos
83

Solved own. Destination problem

0 Kudos
83

that means?