Klasse CL GUI ALV GRID, Methode SET FRONTEND CATALOG

Aus SAP-Wiki
Zur Navigation springenZur Suche springen

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
   using io_ref_alv type REF TO cl_gui_alv_grid 

 Data(ls_stable) = value lvc_s_stbl( row = abap_true
                                     col = abap_true ).

  call method io_ref_alv->refresh_table_display
    exporting
      is_stable      = ls_stable
      i_soft_refresh = abap_true.

endform.                    " ALV_REFRESH_TABLE_DISPLAY1