03-01-2006 6:50 PM
I want to unzip a file from one folder and save the unzipped files into another folder using the methods of the class CL_ABAP_ZIP. I searhed the SDN for definite steps to use the methods of this class but could not find any info.
Has someone used this class and can post the code on the SDN (step by step).
It will be a great help.
Thanks
Amit.
03-01-2006 11:06 PM
I tried to do some examples...but i couldn't make it work...no errors....and no output -:(
Any help would be appreciated.
Greetings,
Blag.
03-10-2006 7:54 PM
03-10-2006 7:58 PM
04-14-2006 9:37 AM
Hi Amit
Have you got the solution to Unzip the file using CL_ABAP_ZIP.
Could you plese share it with SDN.
That will be the great help.
Thanks in Advance
Amit
09-16-2010 7:22 PM
Here's a program to decompress a zip file, i have one to compress too.
REPORT YFPZ0008.
TYPES:
t_xline(2048) TYPE x, "BINARY FILES
BEGIN OF t_line,
line(1024) TYPE c,
END OF t_line. "CONTENT
DATA:
size type i.
DATA:
data_tab TYPE STANDARD TABLE OF t_xline,
text_tab TYPE STANDARD TABLE OF t_line.
DATA:
input_x type xstring, "BINARY CONTENT INPUT
output_x type xstring. "BINARY OUTPUT OUTPUT
data : CL_ZIP type ref to CL_ABAP_ZIP .
DATA files LIKE LINE OF cl_abap_zip=>files.
DATA:
name type string.
PARAMETER:
p_file TYPE string.
PARAMETER:
p_output TYPE string.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = p_file
FILETYPE = 'BIN'
IMPORTING
FILELENGTH = size
CHANGING
DATA_TAB = data_tab.
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
INPUT_LENGTH = size
IMPORTING
BUFFER = input_x
TABLES
BINARY_TAB = data_tab.
CREATE OBJECT cl_zip.
CALL METHOD cl_zip->load(
EXPORTING
zip = input_x
).
LOOP AT cl_zip->files INTO files.
CLEAR output_x.
MOVE files-name TO name.
cl_zip->GET(
EXPORTING
NAME = name " Example.txt (file in the zip file)
IMPORTING
CONTENT = output_x
)
.
REFRESH data_tab.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
BUFFER = output_x
IMPORTING
OUTPUT_LENGTH = size
TABLES
BINARY_TAB = data_tab
.
CALL FUNCTION 'SCMS_BINARY_TO_TEXT'
EXPORTING
INPUT_LENGTH = size
TABLES
BINARY_TAB = data_tab
TEXT_TAB = text_tab
.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
EXPORTING
BIN_FILESIZE = size
FILENAME = p_output
FILETYPE = 'BIN'
CHANGING
DATA_TAB = data_tab.
06-28-2013 8:43 AM
I think Amit Gupta should close this thread, because Felipe your example works. I'd tried it out in my system. It works.
05-06-2020 5:12 PM
Hi ,
Can we upload .rar files from URL and upload the content into Application Server?
Kindly suggest me to solve my issue.
Regards,
Ramana.