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: 

0byte file getting created while passing data using FM FTP_R3_TO_SERVER to ftp server

Former Member
0 Kudos

Dear all,

here i am passing an issue wile passing the data from the sap system to the Ftp server. as in the below code when i user the data(2550) the file is getting copied correctly but if i use the data x string type i am facing the issue.

TYPES: BEGIN OF ty_xml_line,


           data(2550) TYPE x,   or data type xstring


         END OF ty_xml_line.

   DATA: gt_xml_table TYPE  TABLE OF ty_xml_line,

         gs_xml_table LIKE LINE OF gt_xml_table.

   gs_xml_table-data = request_data. " request_data is coming as a Xstring input from other file.

   APPEND gs_xml_table TO gt_xml_table.

CALL FUNCTION 'HTTP_SCRAMBLE'

CALL FUNCTION FTP_CONNECT

CALL FUNCTION FTP_COMMAND

CALL FUNCTION 'FTP_R3_TO_SERVER'

       EXPORTING

         handle         = w_hdl

         fname          = wrk_file          "file path of destination system

         character_mode = 'X'

       TABLES

         text           = gt_xml_table[]

Thanks & Regards

Suresh babu


1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I suppose the data of your XML is not text but hexa.

Please refer program RSFTP007 ... Run it and check if the file is created if yes.. then there is a problem in the way you are passing the data.

Regards

5 REPLIES 5

Former Member
0 Kudos

Hi,

I suppose the data of your XML is not text but hexa.

Please refer program RSFTP007 ... Run it and check if the file is created if yes.. then there is a problem in the way you are passing the data.

Regards

0 Kudos

Dear mohammed ,

like u said i have debugged RSFTP007 and found the it through a dump saying that "Exception condition "TCPIP_ERROR" raised."  due to in the  FM FTP_R3_TO_SERVER it raising the '-1' error.

Can u please tell me what might be the issue here?

Thanks in advance

0 Kudos

Hi,

For using FTP in SAP you have to set up an RFC destination have you done that...

If not execute RSFTP005, to generate the destination.

Then Run it.

Regards

0 Kudos

ya mohammed , that is working fine ...

0 Kudos

In that case can you mark the question answer correct or assumed answered to the question whatever appropriate to close the thread...

Thanks