How to read a .ZIP file available in the SAP application server
I went through some of the threads related to reading .zip files at the application server and tried doing the same through ABAP code but it was futile.
I can see the .zip file at the said path in the application server.This .zip file is suppose to contain .txt format files.
Following is my piece of code :
DATA file_name TYPE string.
DATA zipped_data TYPE xstring.
DATA unzipped_data TYPE xstring.
DATA text_data TYPE string.
DATA zip TYPE REF TO cl_abap_zip.
OPEN DATASET file_name FOR INPUT IN BINARY MODE FILTER 'uncompress'.
READ DATASET file_name INTO zipped_data.
CREATE OBJECT zip.
zip->load( zipped_data ).
CALL METHOD zip->GET
* NAME = zipped_data
INDEX = lv_index
CONTENT = unzipped_data
ZIP_INDEX_ERROR = 1
ZIP_DECOMPRESSION_ERROR = 2
others = 3.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
While I try to read the file into zipped_data i fetch nothing.
Please throw some light into this .
Quick help will be rewarded.