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: 

Compression of String in S/4HANA

Pai_N
Explorer
0 Kudos
1,839

Hello Gurus, 

   I want to Compress the string value  before storing in DB table to save disk space. Currently I am using cl_abap_gzip=compress_text  & cl_abap_gzip=compress_binary to compress string, but I don't see great results . Could any one please suggest , is there any other Compression mechanism available in S/4HANA ? Thanks.  

9 REPLIES 9

matt
Active Contributor
1,798

I use EXPORT ... TO DATA BUFFER ... COMPRESSION ON

 

0 Kudos
1,742

Thank you Matt. Will try this one. 

matt
Active Contributor
1,534

IMPORT ... FROM DATA BUFFER...

Just read the documentation!

0 Kudos
1,687

Hi  @matt  How to decompress  back to string . Can you please suggest. 

Thanks,

 

RaymondGiuseppi
Active Contributor
0 Kudos
1,792

In which kind of table (cluster/indx, transparent) and field (lchr, string, rawsting) do you save the data?

0 Kudos
1,755

HI @RaymondGiuseppi . Its Transparent Table  and Field type string. 

1,675

You should not be allowed to compress a string field, look for some binary type such as RAWSTRING, but handle the compress/uncompress at every read/write statement.

Using an export/import you can use the COMPRESS option, and uncompress will be automatic.

0 Kudos
1,657

@RaymondGiuseppi  Currently I am using rawstring to store compressed format. I have doubt on uncompress. How to uncompress back to string.  

0 Kudos
1,613

If you used method COMPRESS_TEXT before write, then use DECOMPRESS_TEXT aftrer read (CSEQUENCE can be C or STRING, XSEQUENCE can be X or XSTRING. DDIC RAWSTRING is XSTRING)