‎2011 Jan 05 2:53 AM
I have a RAWSTRING xxx (get from DB) and want download it using GUI_DOWNLOAD.
According to some posts, I call 'SCMS_XSTRING_TO_BINARY'
data: data_tab type table of x255.
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = xxx
tables
binary_tab = data_tab.
But I find that 'SCMS_XSTRING_TO_BINARY' add many '0000000000' after xxx, for example:
xxx:..............2FF84D8592BDC35AEA507762
data_tab: .....2FF84D8592BDC35AEA5077620000000000000000
I don't want the '0000000000' , How can I do?
Thanks!
‎2011 Jan 05 4:43 AM
Hi,
In addition to the 'binary_tab' the FM returns the string length 'output_length' . Use this length in reading the 'data_tab'
and restrict the Zero's.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = xxx
IMPORTING
output_length = lv_strlen
TABLES
binary_tab = data_tab.
Regards,
Srini.
‎2011 Jan 05 5:25 AM
Thanks. The code :
data: xxx type xstring.
data: data_tab type table of x255.
data: len type i.
call function 'SCMS_XSTRING_TO_BINARY'
exporting
buffer = xxx
IMPORTING
OUTPUT_LENGTH = len
tables
binary_tab = data_tab.
cl_gui_frontend_services=>gui_download(
exporting
BIN_FILESIZE = len
filename = FILENAME
filetype = 'BIN'
changing
data_tab = data_tab ).