11-20-2007 10:20 PM
Hi,
I have used CL_ABAP_GZIP to compress a file and I get the xstring as output and its length.
TRY.
CALL METHOD cl_abap_gzip=>compress_binary
EXPORTING
raw_in = raw_in
raw_in_len = raw_in_len
compress_level = 6
IMPORTING
gzip_out = gzip_out
gzip_out_len = gzip_out_len.
CATCH cx_parameter_invalid_range .
CATCH cx_sy_buffer_overflow .
ENDTRY.
Now, I would like to download it, and I use gui_download. But gui_download accepts parameters in table:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = gzip_out_len
filename = lv_filename
filetype = 'BIN'
CHANGING
data_tab = data_tab.
Do you know how can I get my compressed xstring data (gzip_out) and load into table form (data_tab)? And which file extension should my lv_filename be? (ex: compressed.gzip)??
kindly advise.
thanks & regards,
ginnie
11-21-2007 5:32 PM
11-21-2007 4:35 PM
Have to tried to use the gzip_out table in GUI_DOWNLOAD?
Please try like this:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = gzip_out_len
filename = lv_filename " << "C:tempcomp.zip"
filetype = 'BIN'
CHANGING
data_tab = gzip_out.
Regards,
Naimesh Patel
11-21-2007 4:50 PM
Hi Naimesh,
gzip_out from cl_abap_gzip is type xstring. It is not compatible with the type of data_tab. How can i convert this xstring to the data_tab? Is there any FM to convert it?
Kindly advice.
regards,
ginnie
11-21-2007 5:00 PM
Try with this FM : SCP_TRANSLATE_CHARS.
Pass INBUFF as your xstring data, recieve in OUTBUFF data.
Regards,
Naimesh Patel
11-21-2007 4:43 PM
Hi,
Better to use that SXPG...etc commands to compress the files rather then using CL_ABAP_GZIP. This class does nto wirk properly.
11-21-2007 5:32 PM