Skip to Content
avatar image
Former Member

cl_abap_gzip

Hi,

I have used CL_ABAP_GZIP to compress a file and I get the xstring as output and its length.

  TRY.
      CALL METHOD cl_abap_gzip=>compress_binary
        EXPORTING
          raw_in         = raw_in
          raw_in_len     = raw_in_len
          compress_level = 6
        IMPORTING
          gzip_out       = gzip_out
          gzip_out_len   = gzip_out_len.
    CATCH cx_parameter_invalid_range .
    CATCH cx_sy_buffer_overflow .
  ENDTRY.

Now, I would like to download it, and I use gui_download. But gui_download accepts parameters in table:

    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize            = gzip_out_len
        filename                = lv_filename
        filetype                = 'BIN'
      CHANGING
        data_tab                = data_tab.

Do you know how can I get my compressed xstring data (gzip_out) and load into table form (data_tab)? And which file extension should my lv_filename be? (ex: compressed.gzip)??

kindly advise.

thanks & regards,

ginnie

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 21, 2007 at 05:32 PM

    Please have a look at function module SCMS_XSTRING_TO_BINARY

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 21, 2007 at 04:35 PM

    Have to tried to use the gzip_out table in GUI_DOWNLOAD?

    Please try like this:

       CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            bin_filesize            = gzip_out_len
            filename                = lv_filename   " << "C:tempcomp.zip"
            filetype                = 'BIN'
          CHANGING
            data_tab                = gzip_out.

    Regards,

    Naimesh Patel

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 21, 2007 at 04:43 PM

    Hi,

    Better to use that SXPG...etc commands to compress the files rather then using CL_ABAP_GZIP. This class does nto wirk properly.

    Add comment
    10|10000 characters needed characters exceeded