โ2015 Apr 16 3:47 PM
Hi all,
i would like to read a PDF file on application server and put binary data into a xstring variable.
Ok to read the file with OPEN DATASET instruction, but after how can i concatenate the data into the xstring variable ?
ยจ
The goal of the following code is to fill the variable lv_xstring with binary data of the PDF file :
DATA: lw_fname TYPE string VALUE '\\MANSFGRA02\IN\972835_5.PDF',
lv_length TYPE i VALUE 100,
wa_bin TYPE solix,
lv_xstring TYPE xstring.
FIELD-SYMBOLS <hex_container> TYPE x.
OPEN DATASET lw_fname FOR INPUT IN BINARY MODE.
DO.
ASSIGN wa_bin TO <hex_container> CASTING.
READ DATASET lw_fname INTO <hex_container> LENGTH lv_length.
IF sy-subrc EQ 0.
* TO DO - PLEASE HELP
ELSE.
EXIT.
ENDIF.
ENDDO.
Thanks for your help.
โ2015 Apr 16 4:31 PM
Hi,
Some code:
PARAMETERS: p_file_s TYPE localfile .
DATA: big_string TYPE xstring .
DATA: mess TYPE string .
OPEN DATASET p_file_s FOR INPUT IN BINARY MODE MESSAGE mess .
READ DATASET p_file_s INTO big_string .
CLOSE DATASET p_file_s .
big_string can be very big.....
Regards .
โ2015 Apr 16 4:31 PM
Hi,
Some code:
PARAMETERS: p_file_s TYPE localfile .
DATA: big_string TYPE xstring .
DATA: mess TYPE string .
OPEN DATASET p_file_s FOR INPUT IN BINARY MODE MESSAGE mess .
READ DATASET p_file_s INTO big_string .
CLOSE DATASET p_file_s .
big_string can be very big.....
Regards .
โ2015 Apr 16 4:43 PM
โ2015 Apr 16 4:57 PM