DATA: l_xml TYPE string.
DATA: l_gzip TYPE xstring.
DATA: l_ungzip TYPE string.
DATA: ti_t100 TYPE STANDARD TABLE OF t100.
* Daten abfragen
SELECT * FROM t100 INTO TABLE ti_t100 UP TO 1000 ROWS.
* interne Tabelle in XML-String wandeln
CALL TRANSFORMATION id SOURCE data_node = ti_t100 RESULT XML l_xml.
WRITE: / |string unkomprimiert: { l_xml }|.
* String mit GZIP komprimieren
cl_abap_gzip=>compress_text( EXPORTING
text_in = l_xml
compress_level = 9 " 0...9
IMPORTING
gzip_out = l_gzip ).
WRITE: / |xstring GZIP komprimiert: { l_gzip }|.
* komprimierten String mit GZIP dekomprimieren
cl_abap_gzip=>decompress_text( EXPORTING
gzip_in = l_gzip
IMPORTING
text_out = l_ungzip ).
WRITE: / |string dekomprimiert: { l_ungzip }|.