DATA: g_color_green TYPE slis_t_specialcol_alv.
- create a table of fieldnames to be coloured intensified green -
PERFORM colour_cells TABLES g_color_green
USING 21 31 5.
- set cells of this line to intensified green
out-color] = g_color_green[.
ENDIF.
---------------------------------------------------------------------
- FORM E05_LAYOUT_BUILD *
- ALV Layout options *
- <-> E05_LS_LAYOUT *
FORM e05_layout_build USING e05_ls_layout TYPE slis_layout_alv.
- Setting this flag avoids having to define field sizes.
- FIELD COLOR contains table of FIELDNAME and COLOURS.
ENDFORM.
&---------------------------------------------------------------------
*& Form colour_cells
&---------------------------------------------------------------------
- Set up table to color field groups different from default colour
- <--> t_color table of fields and colours
- <-- p_index_from - first field of catalogue to be coloured
- <-- p_index_to - last field of catalogue to be coloured
- <-- p_color - color number
FORM colour_cells TABLES t_color
USING p_index_from TYPE sy-index
p_index_to TYPE sy-index
p_color TYPE i.
DATA: ls_fieldcat TYPE slis_fieldcat_alv,
w_tab TYPE slis_specialcol_alv.
- use field catalogue to build new table for consecutive fields
w_tab-fieldname = ls_fieldcat-fieldname.
w_tab-color-col = p_color.
IF p_color = 5. "green
w_tab-color-int = 1. "intensified on
ELSE.
w_tab-color-int = 0. "intensified off
ENDIF.
APPEND w_tab TO t_color.
ENDLOOP.
ENDFORM. " colour_cells
The previous post deals with finding user exits for a given sap transaction code.
No comments:
Post a Comment