10-01-2009 10:53 AM
Hi Gurus,
We are trying to read a file from a server (e.g) XYZ.123.com and other details which are provided to us are user name (e.g): Abc123 and Directory (e.g): /123/123/123/123l.
My question is: Do we need a RFC connection to the server if yes then what type of RFC connection? If RFC connection is not required then what we have to do to establish the connection.
Thanks,
Abhishek.
10-01-2009 11:12 AM
Hi Abhshk Bhatta,
Please have a look on below url...
http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPsolutiontoimplementFTP+transactions
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya
10-01-2009 11:12 AM
Hi Abhshk Bhatta,
Please have a look on below url...
http://wiki.sdn.sap.com/wiki/display/Snippets/ABAPsolutiontoimplementFTP+transactions
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya
10-01-2009 3:28 PM
Hi Abhshk, there may be a more modern way but something like this has worked in the past
*-- FTP_CONNECT requires an encrypted password to work
call 'AB_RFC_X_SCRAMBLE_STRING'
id 'SOURCE' field mc_password
id 'KEY' field mi_key
id 'SCR' field 'X' id 'DESTINATION' field mc_password
id 'DSTLEN' field mi_pwd_len.
call function 'FTP_CONNECT'
exporting
*-- Your SAP-UNIX FTP user name (case sensitive)
user = 'unixuser'
password = 'unixpassword'
*-- Your SAP-UNIX server host name (case sensitive)
host = 'saphost'
rfc_destination = 'sapsystemrfc'
importing
handle = mi_handle
exceptions
not_connected = 1
others = 2.
check sy-subrc = 0.
call function 'FTP_COMMAND'
exporting
handle = mi_handle
command = 'dir'
tables
data = mtab_data
exceptions
tcpip_error = 1
command_error = 2
data_error = 3
others = 4.
Kevin
10-01-2009 3:35 PM
Please search the forum, there have been several posts for this before.