Code: Alles auswählen.
FORM pbo.
SET PF-STATUS 'STATUS100'.
SET TITLEBAR 'TITLE100' WITH g_partner.
IF g_custom_container IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING
container_name = g_container.
CREATE OBJECT g_grid
EXPORTING
i_parent = g_custom_container.
gs_layout-zebra = abap_true.
gs_layout-cwidth_opt = abap_true.
CALL METHOD g_grid->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = gt_fieldcat.
CALL FUNCTION 'LVC_VARIANT_SELECT'
EXPORTING
i_dialog = space
i_user_specific = 'X'
it_default_fieldcat = gt_fieldcat
IMPORTING
et_fieldcat = gt_fieldcat
et_sort = gt_sort
et_filter = gt_filter
CHANGING
cs_variant = gs_variant
EXCEPTIONS
OTHERS = 6.
IF sy-subrc = 0.
CALL METHOD g_grid->set_variant( gs_variant ).
CALL METHOD g_grid->set_frontend_fieldcatalog( gt_fieldcat ).
ENDIF.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZDSGVO_STR_OUTPUT'
is_layout = gs_layout
is_variant = gs_variant
i_save = 'U'
i_default = 'X'
CHANGING
it_outtab = gt_output.
CREATE OBJECT gr_event_receiver.
SET HANDLER gr_event_receiver->handle_user_command FOR g_grid.
SET HANDLER gr_event_receiver->handle_toolbar FOR g_grid.
CALL METHOD g_grid->set_toolbar_interactive.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = g_grid.
ENDIF.
ENDFORM. "pbo