Sunday, April 24, 2011

Use of Colors in List using ABAP Program


The options COLOR, INTENSIFIED, and INVERSE of the FORMAT statement influence the colors of the output list.
To set colors in the program, use:
Syntax
FORMAT COLOR <n> [ON] INTENSIFIED [ON|OFF] INVERSE [ON|OFF].
To set colors at runtime, use:
Syntax
FORMAT COLOR = <c> INTENSIFIED = <int> INVERSE = <inv>.
These formatting options do not apply to horizontal lines created by ULINE. They have the following functions:
  • COLOR sets the color of the line background. If, in addition, INVERSE ON is set, the system changes the foreground color instead of the background color.
For <n> you can set either a color number or a color specification. Instead of color number 0, however, you must use OFF. If you set the color numbers at runtime, all values of <c> that are less than zero or greater than seven, lead to undefined results. The following table summarizes the different possibilities:

<n>
<C>
color
Intended for
OFF
or  COL_BACKGROUND
0
depends on GUI
Background
1
or COL_HEADING
1
gray-blue
Header
2
or COL_NORMAL
2
light gray
List bodies
3
or COL_TOTAL
3
yellow
Totals
4
or COL_KEY
4
blue-green
Key column
5
or COL_POSITIVE
5
green
Positive threshold
6
or COL_NEGATIVE
6
red
Negative threshold
7
or COL_GROUP
7
violet
Control levels







The default setting is COLOR OFF.
  • INTENSIFIED determines the color palette for the line background.
With one exception (COLOR OFF), the color palette for the line background specified above can be intensified or normal. The default setting is INTENSIFIED ON. For COLOR OFF, the system changes the foreground color instead of the background color. If, in addition, INVERSE ON is set, then INTENSIFIED OFF has no effect (again with the exception of COLOR OFF).
  • INVERSE affects the foreground color.
With one exception (COLOF OFF), the system takes the COLOR specified from an inverse color palette and uses it as foreground color. The background color remains unchanged. For COLOR OFF, INVERSE has no effect, since this would set the foreground and the background to the same color.

No comments:

Post a Comment