Klasse CL GUI ALV GRID, Methode SET FRONTEND CATALOG

Aus SAP-Wiki
Wechseln zu: Navigation, Suche

Mit der Methode SET_FRONTEND_CATALOG der Klasse CL_GUI_ALV_GRID kann man den Refresh eines ALV-Grids auch mit einem veränderten Fieldcatalog durchführen.

Es muss nur der neue Fieldcatalog der Methode übergeben werden.

Coding

data: go_cont     type ref to cl_gui_custom_container, "Definition Container-Referenzobjekt für Control
      go_alv_cont type ref to cl_gui_alv_grid.         "Definition ALV-Referenzobjekt
... "Erstmaliger Aufruf der ALV-Liste
Data: lt_fieldcatalog type lvc_t_fcat.

"Füllen Fieldcatalog LT_FIELDCATALOG

go_alv_cont->set_frontend_fieldcatalog( it_fieldcatalog = lt_fieldcatalog ).

perform alv_refresh_table_display.
*&---------------------------------------------------------------------*
*&      Form  ALV_REFRESH_TABLE_DISPLAY1
*&---------------------------------------------------------------------*
*       Refresh ALV Tabelle
*----------------------------------------------------------------------*
form alv_refresh_table_display. 

  data: ls_stable type lvc_s_stbl.

  ls_stable-row = true.
  ls_stable-col = true.

  call method go_alv_cont->refresh_table_display
    exporting
      is_stable      = ls_stable
      i_soft_refresh = true.

endform.                    " ALV_REFRESH_TABLE_DISPLAY1