Skip to Content
author's profile photo Former Member
Former Member

Unzip File and Read Contents

Hi,

I want to unzip a file(called outer.zip) present on the Presentation server and read inner.zip file which lies within the outer.zip.

i wrote the following program, but i am getting an error in the last step .Can some one tell me themistake i am committing here:

TYPES : BEGIN OF sda_content,

lv_buf(65535) type x,

END OF sda_content .

DATA : ls_sda_content type sda_content ,

lt_sda_content type table OF sda_content .

DATA : lv_file_length type int4 .

DATA : x_buf TYPE xstring .

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'C:\outer.zip'

FILETYPE = 'BIN'

IMPORTING

FILELENGTH = lv_file_length

tables

data_tab = lt_sda_content

.

CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'

EXPORTING

input_length = lv_file_length

IMPORTING

BUFFER = x_buf

tables

binary_tab = lt_sda_content

.

clear : lt_sda_content ,lv_file_length,x_buf .

data : cl_inst type ref to cl_abap_zip .

CREATE OBJECT cl_inst.

CALL METHOD cl_inst->load

EXPORTING

zip = x_buf.

CALL METHOD cl_inst->get

EXPORTING

NAME = 'inner.zip'

IMPORTING

CONTENT = x_buf.

Thanks and Regards,

Gaurav

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 01, 2006 at 10:44 AM

    Hi All,

    I found the mistake i was committing..

    Sorry..

    Regards,

    Gaurav

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 02, 2007 at 11:36 PM

    Hi Gaurav Rathi ,

    Even am facing some problem .I cannot open the ZIP file? Can you please tell me where exactly you have corrected your mistake?

    Thanks

    Dan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.