Hi,
You can do so.
CONSTANTS: c_dest TYPE rfcdes-rfcdest VALUE 'SAPFTP',
c_key TYPE i VALUE 26101957.
l_slen = STRLEN( p_pwd ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = p_pwd
sourcelen = l_slen
key = c_key
IMPORTING
destination = p_pwd.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = p_user
password = p_pwd
host = p_host
rfc_destination = c_dest
IMPORTING
handle = l_hdl
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
DERIVE ALL THE FILES IN '/PUB/INBOX' FOLDER.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = l_hdl
command = l_cmd
TABLES
data = l_result
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
You need to have FTP server user id and password.
thanks
sharmistha
Message was edited by: Sharmistha Parida
Add a comment