on 04-15-2018 12:37 PM
I am getting invoice attachments to this fm. attachments looks something like this
1 84824849839849498984934903849348938493480348................
2 99848482848904850948509485094859048509458409580945809458...
3 38493984038904850948509485094580458094580948094
how to upload this to application server
here is my code:
loop idocdata to lw_idocdata.
IF lw_idocdata-segnam EQ '/ARBA/ATTACH_CONTENT'.
lv_lchar = lw_idocdata-sdata.
SHIFT lv_lchar BY 1 PLACES.
CONDENSE lv_lchar.
lv_xstring = lv_lchar.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_xstring
append_to_table = abap_true
IMPORTING
output_length = lv_len
TABLES
binary_tab = lt_blob.
ENDIF.
endloop
OPEN DATASET lv_file FOR OUTPUT in BINARY MODE.
IF sy-subrc EQ 0.
LOOP AT lt_blob INTO ls_blob.
TRANSFER ls_blob TO lv_file.
ENDLOOP.
endif.
CLOSE DATASET lv_file.
I can see the file in al11(non readable form). when i download it through cg3y to my pc, i am not able see the pdf content. says couldn't open the pdf.
I have a doubt that incorrectly i am passing data to all through above code
Please help me with the issue. please check whether piece of code is right?
Hi, did you solve this topic? How did you solve it? Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.