Skip to Content
0
Aug 02, 2023 at 08:18 AM

Change ALV Grid line color at change

145 Views

Hi Guys,

I'm facing the problem how to change the ALV Grid line color if something has changed in Grid. I show you my problem.

I use field to display my color:

 line_color TYPE c LENGTH 4,

If condition is active i set the color

      MOVE 'C700'                   TO gs_data-line_color.

So far so good, color is displayed. But if I now switch the condition that set the color in ALV grid, I want to remove the color after user changed the condition value for it. Therefor I use data_changed event.

      CALL METHOD er_data_changed->modify_cell
EXPORTING
i_row_id = ls_good-row_id
i_fieldname = 'LINE_COLOR'
i_value = ''.

I thought just putting an empty value then to line_color would help and it looks like that value is really cleared, but nothing changed on ALV grid. There is also modify_style method but it looks like that it is only for cell color and not for line color. So how to change the line_color?

Regards
Michael