Application Development 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: 

FTP using ABAP

0 Kudos

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.

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

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

3 REPLIES 3

former_member387317
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Please search the forum, there have been several posts for this before.