06-24-2008 1:57 PM
hi
I am creating an ALV report using factory method.
my report is based on itab which contain 3 coulms, 1 column is ERROR_TYPE . how can i color all the rows which contain E in error_type ???
thanks
Ami
06-24-2008 2:01 PM
In ALV Object Moldel using CL_SALV_COLUMNS_TABLE you cannot color a row.
a®
06-24-2008 2:05 PM
color constants
TYPE-POOLS: col.
Type for row of internal table
TYPES: BEGIN OF tt_book.
INCLUDE STRUCTURE sbook.
color information
TYPES: it_colors TYPE lvc_t_scol,
END OF tt_book.
internal table
DATA: it_book TYPE TABLE OF tt_book,
work area for internal table
wa_book LIKE LINE OF it_book,
work area for internal table for colors
wa_colors LIKE LINE OF wa_book-it_colors.
LOOP AT it_book INTO wa_book.
field SMOKER shall be COL_GROUP if checked
IF wa_book-smoker = u2019Xu2019.
CLEAR wa_colors.
wa_colors-fname = u2019SMOKERu2019.
wa_colors-color-col = col_group.
wa_colors-color-int = 1.
APPEND wa_colors TO wa_book-it_colors.
ENDIF.
MODIFY it_book
FROM wa_book TRANSPORTING it_colors.
ENDLOOP.
...
set color column
preconditions:
1. lr_columns is TYPE REF TO cl_salv_columns_table
2. COLUMNS object has been retrieved
DATA: lr_columns TYPE REF TO cl_salv_columns_table.
lr_columns->set_color_column( value = u2019IT_COLORSu2019 ).
The procedure for changing the color of a whole row is, in principle, the same as for
changing the color of a cell. The color information is passed to the internal data table
using the additional table for the row. The only difference: no value is specified for
the field fname, meaning that the setting applies for the whole row. Regardless of this,
however, you can still assign different color values to individual cells in this row.
06-24-2008 2:44 PM