Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dynamically format colors in lists

I would like to dynamically set a color for a single in a list.

Ie rather than code:

If var = 'x'. write l_field color col_negative.

elseif var = 'y' write l_field color col_total.

elseif var = 'z' write l_field color col_group.

endif.

I would like to code it as follows:

data: l_color(10) type c.

if l_var = 'x'.

move 'col_negative' to l_color.

elseif l_var = 'y' move 'col_total to l_color.

elseif l_var = 'z' move 'col_group' to l_color.

endif.

write: l_field color l_color.

The color command does not seem to like being passed a variable, rather it has to be told explicitly what the color should be set at.

Is there a way around this?

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question