Application Development and Automation 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: 
Read only

FTTP_Scramble

Former Member
0 Likes
403

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
363

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

1 REPLY 1
Read only

Former Member
0 Likes
364

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