Пример:
REPORT ZTEST_ALV_COLORS.
TYPES: BEGIN OF my_itab_wa,
COLOR(4) TYPE C, " Поле для указания цвета строки
TEXT(255) TYPE C, " Просто текст
END OF my_itab_wa,
my_itab_t TYPE TABLE OF my_itab_wa.
DATA: my_itab TYPE my_itab_t.
DATA: my_grid type ref to CL_GUI_ALV_GRID, " грид
my_g_cont type ref to CL_GUI_DOCKING_CONTAINER, " контейнер
my_g_fcat type LVC_T_FCAT,
my_g_layo type LVC_S_LAYO,
my_g_vari type DISVARIANT.
CALL SCREEN '0100'.
* Заполняем внутреннюю таблицу для ALV
FORM UPDATE_ITAB.
DATA: lv_c1 TYPE C.
DATA: ls_itab TYPE my_itab_wa.
lv_c1 = '0'.
DO 7 TIMES.
lv_c1 = lv_c1 + 1.
CONCATENATE 'C' lv_c1 '00' INTO ls_itab-COLOR.
CONCATENATE 'This is' ls_itab-COLOR INTO ls_itab-TEXT SEPARATED BY SPACE.
APPEND ls_itab TO my_itab.
CONCATENATE 'C' lv_c1 '10' INTO ls_itab-COLOR.
CONCATENATE 'This is' ls_itab-COLOR INTO ls_itab-TEXT SEPARATED BY SPACE.
APPEND ls_itab TO my_itab.
CONCATENATE 'C' lv_c1 '01' INTO ls_itab-COLOR.
CONCATENATE 'This is' ls_itab-COLOR INTO ls_itab-TEXT SEPARATED BY SPACE.
APPEND ls_itab TO my_itab.
ENDDO.
ENDFORM.
* Создаем грид
FORM CREATE_ALV_GRID.
DATA: ls_fcat TYPE LVC_S_FCAT.
IF my_g_cont IS INITIAL.
CREATE OBJECT my_g_cont
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
extension = 3000
side = cl_gui_docking_container=>dock_at_top.
CREATE OBJECT my_grid
EXPORTING
I_SHELLSTYLE = 4
I_PARENT = my_g_cont
I_APPL_EVENTS = 'X'.
my_g_vari-REPORT = sy-repid.
my_g_vari-username = sy-uname.
my_g_vari-handle = 'MYGR'.
my_g_layo-cwidth_opt = ''.
my_g_layo-sel_mode = 'A'.
* В лэйауте указываем имя поля в котором
* будем хранить цвет строки
my_g_layo-info_fname = 'COLOR'.
ls_fcat-fieldname = 'TEXT'.
ls_fcat-coltext = 'Текст'.
ls_fcat-reptext = 'Текст'.
ls_fcat-scrtext_l = 'Текст'.
ls_fcat-scrtext_m = 'Текст'.
ls_fcat-scrtext_s = 'Текст'.
APPEND ls_fcat TO my_g_fcat.
CALL METHOD my_grid->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = my_g_layo
IS_VARIANT = my_g_vari
I_SAVE = 'A'
CHANGING
IT_OUTTAB = my_itab
IT_FIELDCATALOG = my_g_fcat.
ENDIF.
ENDFORM.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI_0100'.
PERFORM UPDATE_ITAB.
PERFORM CREATE_ALV_GRID.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE EXIT_COMMAND_0100 INPUT.
LEAVE TO SCREEN 0.
ENDMODULE. " EXIT_COMMAND_0100 INPUT
Статья на аналогичную тему на английском: Report and ALV Colors
Подробнее...