09-19-2017 12:32 PM
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
09-19-2017 2:58 PM
Does it have to be an ftp connection? Isn't it be possible to fetch the file via http/https?
09-19-2017 6:40 PM
09-20-2017 3:54 PM
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.
09-20-2017 5:56 PM
Of course you need BLOB_LENGTH, how would you know the exact number of bytes passed in the table-type parameter BLOB otherwise?
09-21-2017 12:50 PM
Thanks Sandra for reply,
What will be the value of BLOB_LENGTH then in this case, or how to calculate it?
Thanks