‎2006 Aug 31 6:26 AM
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.
‎2006 Aug 31 7:21 AM
‎2006 Aug 31 7:00 AM
hi dilip
please check from your basis person wheather you are authorised or not to do so..
then try it again.
‎2006 Aug 31 7:21 AM
‎2006 Aug 31 9:41 AM
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
‎2006 Aug 31 11:57 AM
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
..
...
..