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

FTP server connection?

Former Member
0 Likes
708

I am using ftp_connect to connect to a FTP server but getting error, what is the thing I am mising in that?

This code I got from SDN discussion. The function

HTTP_SCRAMBLE gives me the encrypted password but I want to know what is this key parameter?

If I enter 'ftp:
192.168.16.21\scan' it gices me error saying connection failed.

And if i enter only '192.168.16.21' it shows error that you are not authorised to access this. Where as If I try to put this 'ftp:
192.168.16.21\scan' in address bar it opens the location.

data l_passwd(30) TYPE c.

CALL FUNCTION 'HTTP_SCRAMBLE'

EXPORTING

SOURCE = 'x1y2z3'

SOURCELEN = 6

KEY = 26101957

IMPORTING

DESTINATION = l_passwd

.

DATA W_HANDLE TYPE I.

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

USER = 'x1y2z3'

PASSWORD = l_passwd

  • ACCOUNT =

HOST = '192.168.16.21'

RFC_DESTINATION = 'SAPFTP'

  • GATEWAY_USER =

  • GATEWAY_PASSWORD =

  • GATEWAY_HOST =

IMPORTING

HANDLE = W_HANDLE

EXCEPTIONS

NOT_CONNECTED = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
650

hi,

why don't you use report <b>rsftp004</b> as sample ?

A.

4 REPLIES 4
Read only

Former Member
0 Likes
650

hi dilip

please check from your basis person wheather you are authorised or not to do so..

then try it again.

Read only

andreas_mann3
Active Contributor
0 Likes
651

hi,

why don't you use report <b>rsftp004</b> as sample ?

A.

Read only

0 Likes
650

Hi Andreas,

Can u focus more on the parameters because I have tried all the possible that I could.

Regards,

Dilip

Message was edited by: Diliip Gupchup

Read only

Former Member
0 Likes
650

Dilip,

As I understand, you have to pass the password as plane character datatype to FTP_CONNECT. What I mean is that it cannot be an encrypted password. I will suggest following code:

data:l_passwd(10) value 'YouRpAswd'. "Case sensitive

CALL FUNCTION 'FTP_CONNECT'

EXPORTING

USER = 'x1y2z3'

PASSWORD = l_passwd

..

...

..