Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using color variables in WRITE statement

Tags:

list

colors

abap

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?

like image 606
tomas.teicher Avatar asked Apr 22 '13 12:04

tomas.teicher


People also ask

What is a color variable?

A color variable is a visual variable that defines the color of a symbol based on a numeric data value returned from a field or expression. If an expression is used, the color can be defined from a color ramp with a set of pre-defined color ranges.

What is the use of write statement in SAP ABAP?

WRITE - ABAP Keyword Documentation. [QUICKINFO info]. This statement formats the content of the data object dobj and writes it to the current page of the current list in the list buffer. This is either a screen list in the list buffer or a spool list.


1 Answers

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

like image 81
vlad-ardelean Avatar answered Sep 19 '22 18:09

vlad-ardelean