DATA: o_cnt_bottom TYPE REF TO cl_gui_docking_container.
DATA: o_cnt_right TYPE REF TO cl_gui_docking_container.
DATA: o_alv_bottom TYPE REF TO if_salv_gui_table_ida.
DATA: o_pic TYPE REF TO cl_gui_picture.
DATA: o_collector_bottom TYPE REF TO cl_salv_range_tab_collector.
DATA: lv_mtart TYPE mara-mtart.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE title2.
SELECT-OPTIONS: s_mtart FOR lv_mtart.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN OUTPUT.
* Verhindern, dass der Container mehrfach erzeugt wird, wenn der Focus aus
* best. Oberflächenelementen zurück kommt.
* Container unten erzeugen
IF NOT o_cnt_bottom IS BOUND.
o_cnt_bottom = NEW #( repid = sy-repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_bottom " unterer Bildschirmrand
extension = 300 ). " 300 hoch, damit die Selektionskriterien nicht überdeckt werden
* Container rechts erzeugen
o_cnt_right = NEW #( repid = sy-repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right " rechter Bildschirmrand
extension = 800 ). " 800 breit, damit die Selektionskriterien nicht überdeckt werden
* IDA-Grid unten erzeugen
o_alv_bottom = cl_salv_gui_table_ida=>create( iv_table_name = 'MARA'
io_gui_container = o_cnt_bottom ).
o_alv_bottom->display_options( )->set_title( 'MARA' ).
* Picture rechts erzeugen
o_pic = NEW #( parent = o_cnt_right ).
o_pic->set_display_mode( display_mode = cl_gui_picture=>display_mode_normal_center ).
o_pic->load_picture_from_sap_icons( icon = icon_delete ).
* Suchkriterien unten setzen
o_collector_bottom = NEW #( ).
o_collector_bottom->add_ranges_for_name( iv_name = 'MTART' it_ranges = s_mtart[] ).
o_collector_bottom->get_collected_ranges( IMPORTING et_named_ranges = DATA(it_name_range_pairs_bottom) ).
o_alv_bottom->set_select_options( it_ranges = it_name_range_pairs_bottom ).
ENDIF.