0 votes
in SAP ABAP by (100 points)
hi friends, i need compress a Csv file to GZIP. this file will be treated by another non-sap system. I have used the GZIP class but the result is not a real GZIP.

1 Answer

0 votes
by

Hello,

also just came around this:

The problem is, that gzip_out only contains the gzipped data, not the header information.

-->http://www.onicos.com/staff/iz/formats/gzip.html

So when adding the needed information, it works:

DATA:
lv_text TYPE string,
lv_gzip TYPE xstring.

cl_abap_gzip=>compress_text( EXPORTING text_in = lv_text
IMPORTING gzip_out = lv_gzip ).

lv_gzip = '1F8B0800000000000003' && lv_gzip.

1F8B --> GZIP Magic number

08 --> compression method "deflate"

00 --> file probably ascii text

00000000 --> initial timestamp

00 --> no extra flags

03 --> os type unix (my SAP system is running on linux)

Then it is possible to gunzip it on linux/unix level.

42 questions

54 answers

5 comments

255 users

SAPGURU is a community of sap experts willing to share their knowledge across a wide range of topics and areas. Are you one of them? Want to know more? Just register or subscribe on our telegram bot https://t.me/sap_bazar_bot

Categories

...