Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CL_ABAP_GZIP - Compression Level

SebastianK
Explorer
0 Likes
2,542

Hi Experts,

does anyone of you has experience with the optional compression level parameter?  I have compressed several xstrings with different length but all compression levels from 1-9 result in the same file size for each xstring. It is like the parameter is not used by the routine. Maybe there are changes in newer Netweaver releases but as I can tell from NW 6.20 (4.7) and 7.00 this parameter does not change the compression level resp. the file size.

Regards Sebastian

Hi Experts,

does anyone of you has experience with the optional compression level parameter?  I have compressed several xstrings with different length but all compression levels from 1-9 result in the same file size for each xstring. It is like the parameter is not used by the routine. Maybe there are changes in newer Netweaver releases but as I can tell from NW 6.20 (4.7) and 7.00 this parameter does not change the compression level resp. the file size.

Regards Sebastian

6 REPLIES 6
Read only

arindam_m
Active Contributor
0 Likes
1,918

Hi,

I think the compression levels wont matter much if then data is small and also if data cannot be compressed any further.

Cheers,

Arindam

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,918

Hello Sebastian,

It is like the parameter is not used by the routine

This method uses the Kernel magic wand (read: method) ab_compressBinary. So there is no way us ABAPers can influence it in any way rather than thinking & speculating

BR,

Suhas

Read only

custodio_deoliveira
Active Contributor
0 Likes
1,918

Hi Sebastian,

According to method documentation (believe or not, Suhas, there's documentation!!!), compression level has more to do with speed than size:

  • COMPRESS_LEVEL
  • Optional specification of the compression level. This must be between 0 and 9, where 1 is the fastest and 9 the highest compression. 0 means that no compression takes place. The deafult value is 6.

To read full method doco, place cursor in a method and click on documentation icon:

Regards,

Custodio

@zcust01

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,918

According to method documentation (believe or not, Suhas, there's documentation!!!), compression level has more to do with speed than size:

Hey Custodio,

SAP documentation is the first thing i check before using any method/function May be in this case we interpreted the documentation in different ways -

This must be between 0 and 9, where 1 is the fastest and 9 the highest compression.

I think that 1 is the fastest (& the lowest) compression with 9 being the highest compression (& the slowest) . Try to add a file to any ZIP archive (using WinZip, WinRAR et al.) you'll see the compression level from the Fastest ---> Highest.

Happy to hear your comments.

BR,

Suhas

Read only

0 Likes
1,918

Hi Suhas,

Not saying you don't check it, just sometimes we (at least I) forget to check individual methods doco and read only the class doco.

Anyway, I think you are right, I probably misinterpreted the doco.

Cheers,

Custodio

Read only

0 Likes
1,918

That was exactly my expectation when I was reading the documentation in the first place. In fact the documentation tells something about speed and compression BUT if I create a simple report and run this method with all numbers from 0 to 9 (even 0 compresses!) then the runtime and compression rate is the same for all 10 variations. Even if I vary the xstring input between large and mid size binarys there is no difference. I think that compression level is just a placeholder and SAP did not implement this feature in its kernel yet 😕