Code: Alles auswählen.
DATA: l_off TYPE i.
* Handelt es sich um eine Hintergrundverarbeitung?
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = l_off
.
IF l_off IS INITIAL.
* --> Keine Hintergrundverarbeitung
* Objekt Custom_Container (Control auf dem Dynpro) "erwecken"
CREATE OBJECT re_custom_container
EXPORTING container_name = 'CTRL_ALV'. "g_container.
ENDIF.
* Objekt ALV auf dem Control "erwecken"
CREATE OBJECT re_alv
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
i_parent = re_custom_container
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_USE_VARIANT_CLASS = SPACE
* I_NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
...
* Aufruf der Methode für ALV-OO-Ausgabe
CALL METHOD re_alv->set_table_for_first_display
EXPORTING
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
* I_CONSISTENCY_CHECK =
* i_structure_name =
is_variant = gs_variant
i_save = 'A'
* I_DEFAULT = 'X'
is_layout = gs_layout
* is_print =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
CHANGING
it_outtab = itab
it_fieldcatalog = gt_fieldcat
* it_sort =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.