Skip to Content
avatar image
Former Member

Dump or time out when using CL_SALV_BS_TT_UTIL=>IF_SALV_BS_TT_UTIL~TRANSFORM

Hello Abapers,

I am getting a dump and sometime a time out when trying to create an excel using XML method. The problem arises when the internal table has millions of lines.

Do you have any idea how to solve this problem?

Below is the code.

Thanks in advance,

Avishek

FORM f_create_xls_from_itab CHANGING pt_data     TYPE ANY TABLE

                                     pt_fieldcat TYPE lvc_t_fcat

                                     pv_xstring  TYPE xstring.

*This is the code from http://abapblog.com.

  DATA:

    lo_data        TYPE REF TO data,

    lo_result_data TYPE REF TO cl_salv_ex_result_data_table,

    lo_salv_table  TYPE REF TO cl_salv_table.



  DATA:

    lt_sort      TYPE lvc_t_sort,

    lt_filt      TYPE lvc_t_filt,

    ls_layout    TYPE lvc_s_layo,

    lv_xlsx      TYPE flag,

    lv_file_type TYPE salv_bs_constant,

    lv_flavour   TYPE string,

    lv_version   TYPE string.



  FIELD-SYMBOLS:

    <fs_tab> TYPE ANY TABLE.



  GET REFERENCE OF pt_data INTO lo_data.



  ASSIGN lo_data->* TO <fs_tab>.

  TRY.

      cl_salv_table=>factory(

      EXPORTING

        list_display = abap_false

      IMPORTING

        r_salv_table = lo_salv_table

      CHANGING

        t_table      = <fs_tab> ).

    CATCH cx_salv_msg.



  ENDTRY.



  IF cl_salv_bs_a_xml_base=>get_version( ) EQ if_salv_bs_xml=>version_25 OR

     cl_salv_bs_a_xml_base=>get_version( ) EQ if_salv_bs_xml=>version_26.



    lo_result_data = cl_salv_ex_util=>factory_result_data_table(

        r_data                      = lo_data

        s_layout                    = ls_layout

        t_fieldcatalog              = pt_fieldcat

        t_sort                      = lt_sort

        t_filter                    = lt_filt

    ).



    CASE cl_salv_bs_a_xml_base=>get_version( ).

      WHEN if_salv_bs_xml=>version_25.

        lv_version = if_salv_bs_xml=>version_25.

      WHEN if_salv_bs_xml=>version_26.

        lv_version = if_salv_bs_xml=>version_26.

    ENDCASE.



*   File type XLSX

    lv_file_type = if_salv_bs_xml=>c_type_xlsx.

    lv_flavour = if_salv_bs_c_tt=>c_tt_xml_flavour_export.



    "transformation of data to excel

    CALL METHOD cl_salv_bs_tt_util=>if_salv_bs_tt_util~transform

      EXPORTING

        xml_type      = lv_file_type

        xml_version   = lv_version

        r_result_data = lo_result_data

        xml_flavour   = lv_flavour

        gui_type      = if_salv_bs_xml=>c_gui_type_gui

      IMPORTING

        xml           = pv_xstring.

  ENDIF.



ENDFORM.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers