Variante 1 (nur wenn in eigenem Dynpro + Container)
SELECT * FROM sflights INTO TABLE @DATA(it_data).
DATA: o_salv TYPE REF TO cl_salv_table.
cl_salv_table=>factory( EXPORTING
r_container = cl_gui_container=>default_screen " Standard-Container der Listausgabe nutzen
IMPORTING
r_salv_table = o_salv
CHANGING
t_table = it_data ).
o_salv->get_functions( )->set_all( ).
* Für diesen Button muss zus. noch ein Event-Handler ausgeprägt werden
o_salv->get_functions( )->add_function( name = 'MYFUNC'
icon = |{ icon_complete }|
text = 'Funktionstext'
tooltip = 'ToolTipText'
position = if_salv_c_function_position=>right_of_salv_functions ).
o_salv->display( ).
* Erzwingen von cl_gui_container=>default_screen (Listausgabe)
WRITE space.
Variante 2 (PF_STATUS)
* ohne Angabe eines Containers in der factory-Methode:
SELECT * FROM sflights INTO TABLE @DATA(it_data).
DATA: o_salv TYPE REF TO cl_salv_table.
cl_salv_table=>factory( IMPORTING
r_salv_table = o_salv
CHANGING
t_table = it_data ).
* PF-Status aus Programm SAPLSLVC_FULLSCREEN benutzen
o_salv->set_screen_status( pfstatus = 'STANDARD_FULLSCREEN'
report = 'SAPLSLVC_FULLSCREEN'
set_functions = cl_salv_model_base=>c_functions_all ).
o_salv->display( ).
oder
SELECT * FROM sflights INTO TABLE @DATA(it_data).
DATA: o_salv TYPE REF TO cl_salv_table.
cl_salv_table=>factory( IMPORTING
r_salv_table = o_salv
CHANGING
t_table = it_data ).
* PF-Status manuelle aus Funktionsgruppe SALV_METADATA_STATUS kopieren
* im lokalen Programm (sy-repid) aufrufen
o_salv->set_screen_status( pfstatus = 'SALV_TABLE_STANDARD'
report = sy-repid
set_functions = cl_salv_model_base=>c_functions_all ).
o_salv->display( ).