* Eventhandlerklasse
CLASS cl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS on_close FOR EVENT close OF cl_gui_dialogbox_container
IMPORTING sender.
ENDCLASS.
CLASS cl_handle_events IMPLEMENTATION.
METHOD on_close.
IF sender IS NOT INITIAL.
sender->free( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
DATA: it_sflight TYPE STANDARD TABLE OF sflight.
START-OF-SELECTION.
" Daten holen
SELECT * INTO TABLE it_sflight FROM sflight WHERE carrid = 'LH'.
" Container für Popup erzeugen
DATA(o_gui_cnt) = NEW cl_gui_dialogbox_container( no_autodef_progid_dynnr = abap_true
caption = 'Ausgabe Testdaten für Lufthansa'
top = 20
left = 20
width = 1280
height = 400 ).
DATA: o_salv TYPE REF TO cl_salv_table.
" SALV-Table erzeugen
cl_salv_table=>factory( EXPORTING
r_container = o_gui_cnt
IMPORTING
r_salv_table = o_salv
CHANGING
t_table = it_sflight ).
" Events registrieren
DATA(o_events) = NEW cl_handle_events( ).
SET HANDLER o_events->on_close FOR o_gui_cnt.
" SALV-Table anzeigen
o_salv->display( ).
" Anzeige des Popup erzwingen
WRITE: / space.