Code: Alles auswählen.
* Falls der Datensatz neu / bzw. ungleich dem Vorgänger ist
ELSE.
* wird erst die Summenspalte ausgegeben.
wa_daten2-vvnat = lv_summevvnat.
wa_daten2-vvvkf = lv_summevvvkf.
wa_daten2-zsgtxt = 'Summe'.
APPEND wa_daten2 TO gt_daten_ausg.
CLEAR: lv_summevvnat,
lv_summevvvkf.
Code: Alles auswählen.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = it_fieldcat[]
i_callback_user_command = 'DOPPEL'
i_save = g_save
is_variant = gs_variant
it_events = rt_events[]
it_sort = it_sorttab
* i_grid_title = 'Kunden'
TABLES
t_outtab = gt_daten_ausg "
EXCEPTIONS
program_error = 1
OTHERS = 2.
Code: Alles auswählen.
l_tabname = 'GTY_DATEN'. "Muss GROSS geschrieben werden
ls_data-dummy = sy-repid. "damit der Datentyp stimmt
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = ls_data-dummy "Programmname
i_internal_tabname = l_tabname "Interne Tabelle
* i_inclname = g_repid
i_bypassing_buffer = ''
i_buffer_active = ''
CHANGING
ct_fieldcat = it_fieldcat[] "Feldkatalogstabelle
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
Code: Alles auswählen.
BEGIN OF t_tab,
.
.
rowcolor(4) type c,
END OF t_tab.
Code: Alles auswählen.
*Deklarationen für ALV Grid
DATA:
.
gd_layout type slis_layout_alv. "ALV-Layout
Code: Alles auswählen.
...
*wenn Drucker deaktiviert -> diese Zeile rot hervorheben
if itab-padisabled = 'X'.
itab-rowcolor = 'C600'.
else.
itab-rowcolor = ''.
endif.
APPEND itab.
Code: Alles auswählen.
*&---------------------------------------------------------------------*
*& Form BUILD_LAYOUT
*&---------------------------------------------------------------------*
* Build layout for ALV grid report
*----------------------------------------------------------------------*
form build_layout.
...
* Set layout field for row attributes(i.e. color)
gd_layout-info_fieldname = 'ROWCOLOR'.
endform. " BUILD_LAYOUT