02-26-2010 3:07 PM
Hi,
I have the follow situation:
concatenate 'cd' '/interfaz/DM/data_in/comm' into w_cmd separated by ' '.
call function 'FTP_COMMAND'
EXPORTING
handle = L_HANDLE
command = w_cmd
TABLES
data = result.
w_cmd = 'nlist'.
call function 'FTP_COMMAND'
EXPORTING
handle = L_HANDLE
command = w_cmd
TABLES
data = result.
**.. Create ftp-command
CONCATENATE 'get' '"SM201002230002.txt"'
INTO w_cmd SEPARATED BY ' '.
call function 'FTP_COMMAND'
EXPORTING
handle = L_HANDLE
command = w_cmd
TABLES
data = result.
call function 'FTP_DISCONNECT'
EXPORTING
handle = L_HANDLE.
But I don´t have to take the file.
The result that i have in internal table result is:
nlist
200 PORT command successful.
150 Opening data connection for ..
.sh_history
SM201002230002.txt
SM201002230001.txt
226 Transfer complete.
get "SM201002230002.txt"
200 PORT command successful.
150 Opening data connection for SM201002230002.txt (152 bytes).
226 Transfer complete.
152 bytes received in 0.00 seconds (0.15 Kbytes/s)
Why i Can´t take the File?
02-26-2010 6:23 PM
Send the solution.
CONCATENATE 'cd' '/interfaz/DM/data_in/comm' into w_cmd separated by ' '.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = L_HANDLE
command = w_cmd
TABLES
data = result.
w_cmd = 'ls'.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = L_HANDLE
command = w_cmd
TABLES
data = result.
TYPES: BEGIN OF ty_files,
file TYPE char200,
END OF ty_files.
DATA: it_files TYPE STANDARD TABLE OF ty_files,
wa_files TYPE ty_files.
LOOP AT result.
check result-line+72(4) = '.txt'.
IF sy-subrc = 0.
W_CMD = result-LINE+58(18).
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
HANDLE = L_HANDLE
FNAME = W_CMD " SM201002230001.txt
CHARACTER_MODE = 'X'
IMPORTING
BLOB_LENGTH =
TABLES
BLOB =
TEXT = I_FTP
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
ENDIF.
ENDLOOP.
05-28-2015 5:11 AM