ALV-Layout
Aus SAP-Wiki
Zur Navigation springenZur Suche springen
Siehe Kategorie: ALV.
Mit dem Layout lassen sich grundlegende Layouteinstellungen vom ALV festlegen, z. B. das die Spaltenbreite optimiert wird oder die Zeilen abwechselnd farblich formatiert sind zur besseren Lesbarkeit.
Coding
*&---------------------------------------------------------------------*
*& Form ALV_FILL_LAYOUT
*&---------------------------------------------------------------------*
* Layout zum ALV füllen
*----------------------------------------------------------------------*
form alv_fill_layout
changing pcs_layout type lvc_s_layo.
pcs_layout-zebra = 'X. "definiert Zebra-Darstellung in Liste
pcs_layout-cwidth_opt = 'A'. "Spaltenbreite wird optimiert ('X' ist nicht (mehr) korrekt)
"pcs_layout-smalltitle = 'X'. "ggf. ein Title des ALV wird klein formatiert
endform. " ALV_FILL_LAYOUT
*&---------------------------------------------------------------------*
*& Form ALV_SET_TABLE_FOR_FIRST
*&---------------------------------------------------------------------*
form alv_set_table_for_first
using pis_layout type lvc_s_layo
changing pct_fieldcatalog type lvc_t_fcat.
* Rufe die ALV-Liste auf
call method go_alv_cont->set_table_for_first_display
exporting
is_layout = pis_layout
changing
it_outtab = pct_texte
it_fieldcatalog = pct_fieldcatalog2.
if sy-subrc = 0.
go_alv_cont->set_gridtitle( i_gridtitle = 'Liste Textbausteine zur Variante'(001) ).
endif.
endform. " ALV_SET_TABLE_FOR_FIRST
