‎2006 Aug 04 4:57 AM
Hi all,
What is FTTP_SCRAMBLE.
while i am using fttp_connect and all, somebody says that i need to use FTTP_SCRAMBLE also.
But i don't know what it is and how it works.
Can anyone explain me.
Thanks in advance
Venkat
‎2006 Aug 04 5:05 AM
Hi Venkat,
Before you connect to the FTP Server You need to scramble the password using the function module
HTTP_SCRAMBLE by passing the password,password length and the key it can be any numeric value.
Use the destination password returned from this function module to call the FTP_CONNECT Function module.
Here is the below code Snippet, Hope it helps you!
data: it_result TYPE STANDARD TABLE OF char120,
it_paths TYPE STANDARD TABLE OF char20,
l_paths TYPE char20,
l_hdl TYPE i,
l_pwd(30) TYPE c,
l_slen TYPE i,
l_key TYPE i VALUE 26101957,
l_cmd(120) TYPE c.
l_pwd = p_pwd.
l_slen = strlen( l_pwd ) .
*Scrample the password
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = l_pwd
sourcelen = l_slen
key = l_key
IMPORTING
destination = l_pwd.
*Connect to FTP server
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = p_user
password = l_pwd
host = p_host
rfc_destination = p_dest
IMPORTING
handle = l_hdl
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc <> 0.
clear l_hdl.
message i261(zz) with
'FTP Connect error. Download failed.'(008).
exit.
endif.
Rajeev
‎2006 Aug 04 5:05 AM
Hi Venkat,
Before you connect to the FTP Server You need to scramble the password using the function module
HTTP_SCRAMBLE by passing the password,password length and the key it can be any numeric value.
Use the destination password returned from this function module to call the FTP_CONNECT Function module.
Here is the below code Snippet, Hope it helps you!
data: it_result TYPE STANDARD TABLE OF char120,
it_paths TYPE STANDARD TABLE OF char20,
l_paths TYPE char20,
l_hdl TYPE i,
l_pwd(30) TYPE c,
l_slen TYPE i,
l_key TYPE i VALUE 26101957,
l_cmd(120) TYPE c.
l_pwd = p_pwd.
l_slen = strlen( l_pwd ) .
*Scrample the password
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = l_pwd
sourcelen = l_slen
key = l_key
IMPORTING
destination = l_pwd.
*Connect to FTP server
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = p_user
password = l_pwd
host = p_host
rfc_destination = p_dest
IMPORTING
handle = l_hdl
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc <> 0.
clear l_hdl.
message i261(zz) with
'FTP Connect error. Download failed.'(008).
exit.
endif.
Rajeev