Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Color-related keywords for WRITE and FORMAT statements:

[COLOR       {{{color [ON]}|OFF}|{= numericvariable}}]
[INTENSIFIED [{ON|OFF}|{= flag}]]
[INVERSE     [{ON|OFF}|{= flag}]]

where color may be either a constant (COL_BACKGROUND, COL_HEADING, COL_NORMAL, COL_TOTAL, COL_KEY, COL_POSITIVE, COL_NEGATIVE, COL_GROUP) or a numeric value (respectively 0 to 7).

The following colors are the approximate HTML rendering of an ABAP list when the SAPGUI theme uses this background color:

color number

with INTENSIFIED ON

with INTENSIFIED OFF

with INVERSE ON

color according to SAP documentation (real color as seen)

0

COL_BACKGROUND

COL_BACKGROUND

COL_BACKGROUND

GUI-specific

1

COL_HEADING

COL_HEADING

COL_HEADING

Gray-blue (blue sky)

2

COL_NORMAL

COL_NORMAL

COL_NORMAL

Light gray (light cyan)

3

COL_TOTAL

COL_TOTAL

COL_TOTAL

Yellow

4

COL_KEY

COL_KEY

COL_KEY

Blue-green (between light cyan and blue sky)

5

COL_POSITIVE

COL_POSITIVE

COL_POSITIVE

Green

6

COL_NEGATIVE

COL_NEGATIVE

COL_NEGATIVE

Red

7

COL_GROUP

COL_GROUP

COL_GROUP

Violet (orange)

The following list is obtained by using the program below:

Error rendering macro 'code': Invalid value specified for parameter 'lang'
REPORT zcolor.
DATA: BEGIN OF tp OCCURS 10,
id TYPE char1,
nr TYPE char8,
text TYPE char255,
END OF tp.
DATA: length TYPE i VALUE 8, " Length of list
teststring(15) TYPE c VALUE '012345678901234',
width TYPE i. " Width of list

START-OF-SELECTION.
  PERFORM heading.
  PERFORM output_body.
*&---------------------------------------------------------------------*
*& Form HEADING
*----------------------------------------------------------------------*
FORM heading.
  FORMAT INTENSIFIED OFF. " Remove any INTENSIFIED
  ULINE AT (width). " Upper frame border
  FORMAT COLOR COL_HEADING INTENSIFIED." Title color
  WRITE: / sy-vline. " Left border
  WRITE: 'No |Colour        |intensified    |intensified off|',
  'inverse       ' NO-GAP.
  WRITE: AT width sy-vline. " Right border
  ULINE AT (width). " Line below titles
  FORMAT COLOR OFF.
ENDFORM. "HEADING
*&---------------------------------------------------------------------*
*& Form OUTPUT_BODY
*----------------------------------------------------------------------*
FORM output_body.
  DO length TIMES.
    PERFORM write_line USING sy-index.
  ENDDO.
ENDFORM. "OUTPUT_BODY
*&---------------------------------------------------------------------*
*& Form WRITE_LINE
*----------------------------------------------------------------------*
FORM write_line USING count TYPE i.
  DATA: help(14) TYPE c,
  count1 TYPE i.
  count1 = sy-index - 1.
  WRITE: / sy-vline NO-GAP.
  WRITE: (4) count1 COLOR COL_KEY INTENSIFIED NO-GAP.
  WRITE: sy-vline NO-GAP.
  CASE count1.
    WHEN '0'.
      help = 'COL_BACKGROUND'.
    WHEN '1'.
      help = 'COL_HEADING'.
    WHEN '2'.
      help = 'COL_NORMAL'.
    WHEN '3'.
      help = 'COL_TOTAL'.
    WHEN '4'.
      help = 'COL_KEY'.
    WHEN '5'.
      help = 'COL_POSITIVE'.
    WHEN '6'.
      help = 'COL_NEGATIVE'.
    WHEN '7'.
      help = 'COL_GROUP'.
  ENDCASE.
  WRITE: help COLOR COL_KEY INTENSIFIED NO-GAP.
  WRITE: sy-vline NO-GAP.
  WRITE: teststring COLOR = count1 INTENSIFIED NO-GAP.
  WRITE: sy-vline NO-GAP.
  WRITE: teststring COLOR = count1 INTENSIFIED OFF NO-GAP.
  WRITE: sy-vline NO-GAP.
  WRITE: teststring COLOR = count1 INVERSE NO-GAP.
  WRITE AT width sy-vline NO-GAP.
ENDFORM. "WRITE_LINE
*-- End of Program