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: 

Fetch file from FTP using FTP_SERVER_TO_R3

Former Member
0 Kudos

Hi experts,

I am having requirements of fetching pdf or jpeg file from FTP server. for that, I am using FTP_CONNECT, FTP_COMMAND, and FTP_SERVER_TO_R3.

I have also gone through discussion threads but I didn't find any help on this.

I successfully reached till FTP_SERVER_TO_R3. here I am getting data in table BLOB

but after this, I got stuck. I am not passing BLOB_LENGTH, I don't know that will make any difference or not.

I want to convert this data from BLOB table to RAWSTRING format.

So please guide me on this issue.

Thanks in advance for help.

Regards,

ABAPER

5 REPLIES 5

UweFetzer_se38
Active Contributor
0 Kudos

Does it have to be an ftp connection? Isn't it be possible to fetch the file via http/https?

Former Member
0 Kudos

Thanks for reply....

yes it must be FTP.

UweFetzer_se38
Active Contributor

Maybe this works (not tested):

    CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
      EXPORTING
        input_length = blob_length
      IMPORTING
        buffer       = content_pdf_x       "type xstring
      TABLES
        binary_tab   = blob
      EXCEPTIONS
        failed       = 1
        OTHERS       = 2.

Sandra_Rossi
Active Contributor
0 Kudos

Of course you need BLOB_LENGTH, how would you know the exact number of bytes passed in the table-type parameter BLOB otherwise?

Former Member
0 Kudos

Thanks Sandra for reply,

What will be the value of BLOB_LENGTH then in this case, or how to calculate it?

Thanks