Skip to Content

issue with extracting the contents of a ZIP file

Hi All,

I am working on document management system. In our system, we can attach ZIP files to our project. I have the below requirement -

1. Get the ZIP file.

2. Explode/Unzip the ZIP folder.

3 Get all the files in the ZIP folder.

4. Attach all the files in the project.

5. Remove the original ZIP folder.


Basically, I need to replace the ZIP file with its contents. If a ZIP folder has 5 files, then 5 files should be attached to the project, the original ZIP file should be removed. I have used the splice method of the class cl_abap_zip and I have got the below output. I am stuck at this point. I think this output only provides me the name of the files in the ZIP folder. I want to access these files, so I can attach them to the project. Can anyone help me with this ? Screenshot attached

splice-data.png (26.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 05, 2017 at 12:23 PM

    Use now the get method to read each file content.

     CREATE OBJECT lo_zip.
     CALL METHOD lo_zip->load
         zip = ls_zip_content.
     CALL METHOD lo_zip->splice
         zip     = ls_zip_content
         entries = lt_entries.
     LOOP AT lt_entries ASSIGNING <entry>.
       CALL METHOD lo_zip->get
           name    = <entry>-name
           content = ls_file_xstring.


    Add comment
    10|10000 characters needed characters exceeded