Skip to Content
-1

Fetch file from FTP using FTP_SERVER_TO_R3

Sep 19, 2017 at 11:32 AM

99

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded

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

0
Former Member

Thanks for reply....

yes it must be FTP.

0

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

0
Former Member

Thanks Sandra for reply,

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

Thanks

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Uwe Fetzer Sep 20, 2017 at 02:54 PM
1

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.
Share
10 |10000 characters needed characters left characters exceeded