cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MS Excel Export from SALV

karst3n
Explorer
0 Kudos
435

When I use the standard function in SALV (CL_SALV_TABLE) for MS Excel export, an Excel file with multiple worksheets is opened. The worksheets “Format”, “Header”, and “RawData” are each filled with the same data. What do I need to do to have only one worksheet? Here is the code:

 

 

  METHOD salv.

    CONSTANTS: lc_land_it TYPE land1 VALUE 'IT'.

    " Data selection.
    SELECT spras, land1, landx
      FROM t005t
        WHERE land1 = @LC_land_it
      INTO TABLE @DATA(lt_data).

    " Genrate SALV object.
    cl_salv_table=>factory(
      IMPORTING r_salv_table = DATA(lr_salv)
      CHANGING  t_table      = lt_data ).

    " Basic settings
    lr_salv->get_functions( )->set_all( abap_true ).
    lr_salv->get_columns( )->set_optimize( abap_true ).
    lr_salv->get_display_settings( )->set_list_header( 'Überschrift'(001) ).
    lr_salv->get_display_settings( )->set_striped_pattern( abap_true ).
    lr_salv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).

    " Display SALV.
    lr_salv->display( ).

  ENDMETHOD.

 

 

KarstenBBD_0-1728998040530.png

 

Accepted Solutions (0)

Answers (0)