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_CONNECT to Windows based server

Former Member
0 Likes
796

Hi Experts,

I am using FM <b>'FTP_CONNECT'</b> to send a file from local pc to <b>Windows based server</b>.

I am using the parameters: username, pwd, hostname, rfc destination (when I test the RFC destination SAPFTP in SM59, it connects OK)

I connected to the HOSTNAME from <b>command prompt</b> and it connects OK with same parameters.

But when we try to connect with FM <b>'FTP_CONNECT'</b>, it gives error:

'User has no access authorization for computer HOSTNAME'.

Please advise,

Regards,

FS

The issue was related to user getting locked. Thanks for your assistance.

5 REPLIES 5
Read only

hymavathi_oruganti
Active Contributor
0 Likes
749

r u giving user, pwd correctly?

try giving the ipaddress instead of name to the HOST.

Read only

Former Member
0 Likes
749

Yes, the username, pwd are correctly given and I also tried to give IP instead of HOST Name but still in error of authorization.

Read only

Former Member
0 Likes
749

hi guys,

can you guys send some sample code for FM 'FTP_CONNECT'. Thanks.

regards,

FS

Read only

Former Member
0 Likes
749

Following is the code we have used and it is working without any problems..

Password encryption

data : v_password(20),

v_key type i value 26101957,

v_slen type i.

  • --- ENCRYPT PASSWORD

The password is entered by the user on the selection screen in the parameter p_pswd.

clear v_password.

set extended check off.

v_password = p_pswd.

translate v_password to lower case.

v_slen = strlen( v_password ).

call 'AB_RFC_X_SCRAMBLE_STRING'

id 'SOURCE' field v_password

id 'KEY' field v_key

id 'SCR' field 'X'

id 'DESTINATION' field v_password

id 'DSTLEN' field v_slen.

FTP Connect

data v_hdl type i.

call function 'FTP_CONNECT'

exporting

user = p_usrid (User id used to connect)

password = v_password

host = p_ip_add (IP of the server to be connected)

rfc_destination = p_sapftp (value is normally SAPFTP or SAPFTPA)

importing

handle = v_hdl

exceptions

not_connected = 1

others = 2.

From your msg it looks that the FTP connection is not the problem.. The problem is with the permissions for the user, with which you are doing the ftp, has..

This user does not have write permissions in the directory in which it is trying to write the file..

Try doing the FTP manually.. If this works then the FTP Command u r using after the FTP Connect should also work..

Read only

Former Member
0 Likes
749

The issue was related to user getting locked. Thanks for your assistance.