Skip to Content
0
Feb 17, 2011 at 06:56 AM

FTP_R3_TO_SERVER

230 Views

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