Using color variables in WRITE statement

abap, colors, list

Solution

DATA colour TYPE i VALUE 2.

WRITE:/10  'test' COLOR = colour .

You MUST use an equal sign, and that's all there is to it... ABAP and it's funny statements :P

Problem

How can I use color value variable? For example, this works for me: ``` write:/10 'test' COLOR COL_HEADING. ``` I thoght that colours are integers so I tried: ``` data: gv_mycolor type I. gv_mycolor = 5. write:/10 'test' COLOR gv_mycolor. ``` the second code gives me an error: "Color gv_mycolor is not expected; only 1 to 7 or the relevant color IDs are allowed. Statement ``` FORMAT COLOR = gv_mycolor. ``` works for me, I have problem just with write statement. Can anybody help?

Original source

Related problems