2009 Apr 09 11:50 AM
Hi, could anyone please help me resolve the following issue:
When i run the code below, it comes back saying "could not connect to "host". When tried to run in debug or test the FM "ftp_connect" it says "user ..... has no access authorization for computer .....
REPORT ZALB_FTP_TEST.
types: begin of t_ftp_data,
line(132) type c,
end of t_ftp_data.
data: lv_ftp_user(64) value 'branch'. "change this
data: lv_ftp_pwd(64) value 'careful'. "change this
data: lv_ftp_host(50) value '10.50.1.199'. "change this
data: lv_rfc_dest like rscat-rfcdest value 'SAPFTP'.
data: lv_hdl type i.
data: lv_key type i value 26101957.
data: lv_dstlen type i.
data: lt_ftp_data type table of t_ftp_data.
field-symbols: <ls_ftp_data> like line of lt_ftp_data.
*describe field lv_ftp_pwd length lv_dstlen.
lv_dstlen = strlen( lv_ftp_pwd ).
call 'AB_RFC_X_SCRAMBLE_STRING'
id 'SOURCE' field lv_ftp_pwd
id 'KEY' field lv_key
id 'SCR' field 'X'
id 'DESTINATION' field lv_ftp_pwd
id 'DSTLEN' field lv_dstlen.
call function 'FTP_CONNECT'
exporting
user = lv_ftp_user
password = lv_ftp_pwd
host = lv_ftp_host
rfc_destination = lv_rfc_dest
importing
handle = lv_hdl
exceptions
not_connected = 1
others = 2.
if sy-subrc ne 0.
write:/ 'could not connect to', lv_ftp_host.
else.
write:/ 'connected successfully. session handle is', lv_hdl.
call function 'FTP_CONNECT'
exporting
handle = lv_hdl
command = 'dir'
tables
data = lt_ftp_data
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.
if sy-subrc ne 0.
write:/ 'could not execute ftp command'.
else.
loop at lt_ftp_data assigning <ls_ftp_data>.
write: / <ls_ftp_data>.
endloop.
call function 'FTP_DISCONNECT'
exporting
handle = lv_hdl
exceptions
others = 1.
if sy-subrc ne 0.
write:/ 'could not disconnect from ftp server'.
else.
write:/ 'disconnected from ftp server'.
endif.
endif.
endif.
Thanks in advance for the help.
Hi, could anyone please help me resolve the following issue:
When i run the code below, it comes back saying "could not connect to "host". When tried to run in debug or test the FM "ftp_connect" it says "user ..... has no access authorization for computer .....
REPORT ZALB_FTP_TEST.
types: begin of t_ftp_data,
line(132) type c,
end of t_ftp_data.
data: lv_ftp_user(64) value 'branch'. "change this
data: lv_ftp_pwd(64) value 'careful'. "change this
data: lv_ftp_host(50) value '10.50.1.199'. "change this
data: lv_rfc_dest like rscat-rfcdest value 'SAPFTP'.
data: lv_hdl type i.
data: lv_key type i value 26101957.
data: lv_dstlen type i.
data: lt_ftp_data type table of t_ftp_data.
field-symbols: <ls_ftp_data> like line of lt_ftp_data.
*describe field lv_ftp_pwd length lv_dstlen.
lv_dstlen = strlen( lv_ftp_pwd ).
call 'AB_RFC_X_SCRAMBLE_STRING'
id 'SOURCE' field lv_ftp_pwd
id 'KEY' field lv_key
id 'SCR' field 'X'
id 'DESTINATION' field lv_ftp_pwd
id 'DSTLEN' field lv_dstlen.
call function 'FTP_CONNECT'
exporting
user = lv_ftp_user
password = lv_ftp_pwd
host = lv_ftp_host
rfc_destination = lv_rfc_dest
importing
handle = lv_hdl
exceptions
not_connected = 1
others = 2.
if sy-subrc ne 0.
write:/ 'could not connect to', lv_ftp_host.
else.
write:/ 'connected successfully. session handle is', lv_hdl.
call function 'FTP_CONNECT'
exporting
handle = lv_hdl
command = 'dir'
tables
data = lt_ftp_data
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.
if sy-subrc ne 0.
write:/ 'could not execute ftp command'.
else.
loop at lt_ftp_data assigning <ls_ftp_data>.
write: / <ls_ftp_data>.
endloop.
call function 'FTP_DISCONNECT'
exporting
handle = lv_hdl
exceptions
others = 1.
if sy-subrc ne 0.
write:/ 'could not disconnect from ftp server'.
else.
write:/ 'disconnected from ftp server'.
endif.
endif.
endif.
Thanks in advance for the help.
2009 Apr 09 2:17 PM
2009 May 20 8:28 AM
Can you give the solution else your last post has no sence !!
2009 Nov 19 6:29 AM
Please provide how you resolved
or
give me your no. i will call and get the information
Edited by: Balaji Krishnagiri on Nov 19, 2009 7:33 AM
2015 Mar 11 8:18 AM
It doesn't work for me if I just maintain * entry.
But it works after I maintained specific IP address into the table,
ref notes:2072995 - User has no access authorization for computer
Cause
The message comes after the implementation of note '1605054 - Restriction in access to FTP Servers & usage of test reports' or upgrading to a
support package that contains this note. This note was created to prevent malicious users from accessing remote FTP servers.
Resolution
1. Please ensure that all manual steps from note 1605054 are implemented in your system along with the code corrections
2. Then please enter the allowed FTP servers into the table SAPFTP_SERVERS or enter ‘*’ to allow all FTP servers.
2015 Mar 11 9:26 AM
Dear All, I would like to apologise for not following up on this and specially for not sharing the solution on this forum at the time. I had to move away from ABAP development at that time due to personal circumstances and lost the access to the email address registered for this account.
It has been a while but if I stroll down memory lane, the solution to the above issues was more internal than anything in the code. It was the configuration and permissions of RFC Destination "SAPFTP" setup in our landscape. As soon as Basic fixed the issue, the same code was working fine.