2009 Mar 18 8:39 AM
Hi Experts,
I have this requirement.
i chkd SDN but didnt find any resolution properly.
I have Tab Delimted data in Single Internal table.
Those Internal Table details, i need to ZIP and then save in Application Server.
I found answers for reading file from AS, then zipping and then writing on it again.
Can anyone help me with this ?
Hi Experts,
I have this requirement.
i chkd SDN but didnt find any resolution properly.
I have Tab Delimted data in Single Internal table.
Those Internal Table details, i need to ZIP and then save in Application Server.
I found answers for reading file from AS, then zipping and then writing on it again.
Can anyone help me with this ?
2009 Mar 18 8:57 AM
Hi,
Check which zip functionality exist in your system and use it to zip them.
1. You can create unzip file using OPEN DATASET command
2. You can FM SXPG_COMMAND_EXECUTE to call OS command to zip the file
Follow this example on how to use OS zip command [http://lowfatlinux.com/linux-zip-manual.html]
Regards,
Lim...
2009 Mar 18 8:58 AM
Use this Class - CL_ABAP_GZIP
Search forum for details on this one.
2009 Mar 18 10:26 AM
I did
I am writing file to AS using FM C13Z_TEXT_WRITE.
giving Dump.
2009 Mar 18 11:11 AM
2009 Mar 18 11:13 AM
DATA:
t_spfli TYPE TABLE OF spfli,
t_out like table of t_spfli,
lw_xml_in TYPE string,
lw_xml_out TYPE xstring,
SELECT carrid
connid
UP TO 2 ROWS
FROM spfli INTO TABLE t_spfli.
CALL TRANSFORMATION id
SOURCE output = t_spfli
RESULT XML lw_xml_in. " XML Format
IF sy-subrc NE 0.
RAISE compress_error.
ENDIF. " IF SY-SUBRC NE 0
CALL METHOD cl_abap_gzip=>compress_text
EXPORTING
text_in = lw_xml_in
* text_in_len = -1
* compress_level = 6
* conversion = 'DEFAULT'
IMPORTING
gzip_out = lw_xml_out " Compressed Output
* gzip_out_len =
.
IF sy-subrc NE 0.
RAISE compress_error.
ENDIF. " IF SY-SUBRC NE 0
use open dataset to store the file on app server.
Read dataset to read from the app server.
******************
*& Decompressing*********
CALL METHOD cl_abap_gzip=>decompress_text
EXPORTING
gzip_in = lw_xml_out
* gzip_in_len = -1
* conversion = 'DEFAULT'
IMPORTING
text_out = lw_xml_in
* text_out_len =
CALL TRANSFORMATION id
SOURCE XML lw_xml_in
RESULT output = t_out.
IF sy-subrc NE 0.
RAISE compress_error.
ENDIF.Thanks
Sharath