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: 

problem with function FTP_R3_TO_SERVER

Former Member
0 Kudos
673

Hi,

I have a problem with the function FTP_R3_TO_SERVER. When I downliad my internal table to the ftp server, the data file has a size of 0. There is no data in my data file.

Here my coding:

xml_string = here is my xml file which I move to l_t_bindata.



  DATA:
        l_f_handle  TYPE i,
        l_f_fname   TYPE c LENGTH 50,
        l_r_bindata TYPE xstring,
        l_t_bindata LIKE STANDARD TABLE OF l_r_bindata.

  CALL FUNCTION 'FTP_CONNECT'
    EXPORTING
      user            = ' '
      password        = ' '
      host            = '172.172.0.54'
      rfc_destination = 'SAPFTP'
    IMPORTING
      handle          = l_f_handle
    EXCEPTIONS
      not_connected   = 1
      OTHERS          = 2.

  CHECK sy-subrc = 0.

  l_f_fname = 'DATA.xml'.

  l_r_bindata = xml_string.
  APPEND l_r_bindata TO l_t_bindata.

  CALL FUNCTION 'FTP_R3_TO_SERVER'
    EXPORTING
      handle         = l_f_handle
      fname          = l_f_fname
      character_mode = 'X'
    TABLES
      text           = l_t_bindata
    EXCEPTIONS
      tcpip_error    = 1
      command_error  = 2
      data_error     = 3
      OTHERS         = 4.

  IF sy-subrc = 0.

    CALL FUNCTION 'FTP_DISCONNECT'
      EXPORTING
        handle = l_f_handle.

  ENDIF.

Did someone know where the problem is that I get an empty data file ?

7 REPLIES 7

Former Member
0 Kudos
125

this might help -

0 Kudos
125

Hello,

thank you for your answer, I have already checked all RSFTP00... reports, furthermore I have searched in the forum for the problem, but when I look to other threads they use the same functions as I do, but why is my data file empty, I have one line in l_t_bindata, but when I transfer it to the ftp the data file is empty.

venkat_o
Active Contributor
0 Kudos
125

Hi, Check the below blog <li><b><u>[Transferring Data from SAP to Other Systems|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417600)ID1426779150DB00445078734203682954End?blog=/pub/wlg/5564]</u></b> Thanks Venkat.O

Former Member
0 Kudos
125

Hi,

I have compare the coding of the mentioned blog and my coding and both are same. the problem is not in transfering data from sap to ftp, the problem which I have is that the transfered data file is empty although I have one line in my internal table.

Former Member
0 Kudos
125

no ideas guys?

Former Member
0 Kudos
125

did anybody worked with the mentioned fm?

Former Member
0 Kudos
125

Hi,

the download works now, but the problem is now that I have no xml. I get a hex data file:


TYPES: BEGIN OF t_file,
text(65535) TYPE c,
END OF t_file.

data:
        l_r_bindata   type t_file,
        l_t_bindata   LIKE STANDARD TABLE OF l_r_bindata,
       xml_string    TYPE xstring.

  l_r_bindata-text = xml_string.
  APPEND l_r_bindata TO l_t_bindata.

  CALL FUNCTION 'FTP_R3_TO_SERVER'
    EXPORTING
      handle         = l_f_handle
      fname          = l_f_fname
      character_mode = 'X'
    TABLES
      text           = l_t_bindata
    EXCEPTIONS
      tcpip_error    = 1
      command_error  = 2
      data_error     = 3
      OTHERS         = 4.

when I look to the data file on my ftp server there is no xml data, what I see is a hex data. How can I get the same xml which I move to l_r_bindata-text.