Code: Alles auswählen.
DATA: go_zip TYPE REF TO cl_abap_zip.
OPEN DATASET name IN BINARY MODE FOR INPUT.
READ DATASET name INTO content.
CLOSE DATASET name.
go_zip->load( content ).
Code: Alles auswählen.
LOOP AT go_zip->files INTO ls_file WHERE name EQ 'word/document.xml'.
go_zip->get(
EXPORTING
name = ls_file-name
* index = 0
IMPORTING
content = content
EXCEPTIONS
zip_index_error = 1
zip_decompression_error = 2
).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
go_zip->delete(
EXPORTING
name = ls_file-name
* index = 0
EXCEPTIONS
zip_index_error = 1
).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
g_zip_xstring = go_zip->save( ).
Code: Alles auswählen.
g_zip_xstring = go_zip->save( ).
DELETE DATASET name.
COMMIT WORK.
OPEN DATASET name FOR OUTPUT IN BINARY MODE.
TRANSFER g_zip_xstring TO name.
CLOSE DATASET name.
COMMIT WORK.