on 2024 Oct 15 2:20 PM
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.
Request clarification before answering.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.