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_R3_TO_SERVER

ajoy_chakraborty
Participant
0 Kudos

Hi All,

I am using the following code:


       DESCRIBE TABLE it_rec LINES x.

        blob_length = x * 126.

        CALL FUNCTION 'FTP_R3_TO_SERVER'
          EXPORTING
            handle                = dhdl
            fname                 = dfile
            blob_length         = blob_length
            character_mode = ' '
          TABLES
            blob                     = it_rec
          EXCEPTIONS
            tcpip_error          = 1
            command_error  = 2
            data_error          = 3
            OTHERS             = 4.

In this, 126 = sum of field lengths of internal table.

PROBLEM: When I checked in FTP...contents are getting truncated.

Then I used the floowing code: (with out BLOB)


       DESCRIBE TABLE it_rec LINES x.

        CALL FUNCTION 'FTP_R3_TO_SERVER'
          EXPORTING
            handle                = dhdl
            fname                 = dfile
            character_mode = 'X '
          TABLES
            text                     = it_rec
          EXCEPTIONS
            tcpip_error          = 1
            command_error  = 2
            data_error          = 3
            OTHERS             = 4.

PROBLEM: Redundant lines are coming. (Suppose there are 2 line items in IT_REC. In FTP, I am getting a blank line between 1st line item and 2nd line item).

My Doubt:

1) How to calculate blob length? (if I enter large vaues, it is giving "Command Error")

2) If i want to use the 2nd option (without BLOB), how to get rid of blank/ redundant lines

Please help.

Thanks in advance.

Regards,

Ajoy

1 ACCEPTED SOLUTION

Abhijit74
Active Contributor
0 Kudos

Hi,

Could you please check this [BLOG.|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/994] [original link is broken] [original link is broken] [original link is broken];.

Thanks,

Abhijit

1 REPLY 1

Abhijit74
Active Contributor
0 Kudos

Hi,

Could you please check this [BLOG.|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/994] [original link is broken] [original link is broken] [original link is broken];.

Thanks,

Abhijit