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

ABAP Compression Support

Former Member
0 Likes
2,484

Hi

We are having an ABAP module and C/C++ application (which uses Netweaver RFC SDK) which exchanges data among them.

We are looking for the compression support for performance improvement.

Here are the steps we are aiming;

(1) ABAP compresses data using  ZLIB compression (or any other standard compression techniques)

(2) Compressed data is passed back to C/C++ application.

(3) C/C++ application reading the original data after applying ZLIB (or any other standard compression techniques) decompression.

We are aware that RFC layer can introduce compression in Network transfer, but we are more aiming to apply the compression technique in our own application.

Do ABAP support this scenario of compressing the data using standard compression techniques?

Any help on this is highly appreciated.

Thanks in advance.

Ashi

5 REPLIES 5
Read only

former_member209818
Active Contributor
0 Likes
1,551

Hi Ashi,

About the Data compression, I could find very less material in the system. I found two FMs, one to compress & another to decompress. But while using those I got an warning saying FMs are obsolete. But still if you use, it gives you a comressed results.

I wrote a small program to first compress and then again Decompress the same data. Below is the code.

I hope this helps you.. But issue is, these FMs are not RFCs so not sure if same compression technik can be used in your target system or not.

REPORT ZHTESTCOMPRESS.

  data : begin of t_in occurs 0,
          line type char50,
         end of t_in.
data : t_out like t_in occurs 10 with header line.

t_in-line = 'First Line'.
append t_in.

t_in-line = 'Second Line'.
append t_in.

CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
*   COMPRESSED_SIZE       =
   TABLES
     in                    = t_in
     out                   = t_out
  EXCEPTIONS
    COMPRESS_ERROR        = 1
    OTHERS                = 2
           .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
clear t_in.
refresh t_in.

CALL FUNCTION 'TABLE_DECOMPRESS'
   TABLES
     in                         = t_out
     out                        = t_in
* EXCEPTIONS
*   COMPRESS_ERROR             = 1
*   TABLE_NOT_COMPRESSED       = 2
*   OTHERS                     = 3
           .
IF sy-subrc <> 0.
* Implement suitable error handling here
else.
   LOOP AT t_in.
     write / t_in-line.
   ENDLOOP.
ENDIF.

Read only

0 Likes
1,551

Hi Harshad,

Thanks for the reply. What i wanted was that, i will write the data to file using some ABAP class(for ex. CL_ABAP_GZIP ) and then i want to read this compressed file in C/C++ application. The application should be able to decompress the data in file.

Any help on this is highly appreciated.

Thanks

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
1,551

There is class to ZIP compresion (I am using it and its working): CL_ABAP_ZIP

Or GNU ZIP classes (havent tested, but from documetation it looks like usable/working):

CL_ABAP_GZIP                   Class for (De)Compression (GZIP)

CL_ABAP_GZIP_BINARY_STREAM     Class for Data Compression (GZIP, Streaming)

CL_ABAP_GZIP_TEXT_STREAM       Class for Text Compression (GZIP, Streaming)

CL_ABAP_UNGZIP_BINARY_STREAM   Class for Data Decompression (UnGzip, Streaming)

CL_ABAP_UNGZIP_TEXT_STREAM     Class for Text Decompression (UnGzip Text Streaming)

-- Tomas --
Read only

0 Likes
1,551

Hi Tomas,

Thanks for the reply.

What i need is that, i am writing the data to file using CL_ABAP_GZIP class in ABAP. Now i have to export this (zipped) file to C\C++ application for consuming. The C\C++ application should be able to decompress the data .


Any help on this is highly appreciated.

Thanks

Read only

0 Likes
1,551

Hello Ashi,

sorry I am not into C/C++ programming. But little googling confirmed my thought, that there must be some libraries or so, with GZIP or ZIP support.

And about data transfer - that depends on transport layer, design, needs... but I hanve not much experience in this "SAP <> another app comunication" kind of things. Only SYBASE, RFC functions, IDOCs... but these doesn't look good for what you need.

-- Tomas --