Entering content frame

Process documentationColoring Rows Locate the document in its SAP Library structure

Purpose

You can change the color of rows in the grid control to highlight data in the list.

Note

The column color can be set using field EMPHASIZE of the field catalog (see: Output Options of Columns).

 

Process Flow

  1. Define the layout structure of type LVC_S_LAYO .
  2. Add a four-digit character field to your output table, as shown in the example below:
  3. DATA: BEGIN OF GT_OUTTAB OCCURS 0.
            INCLUDE STRUCTURE <DDIC-Struktur>.

    DATA:   linecolor(4) type c. "Color for corresponding line

    DATA: END OF GT_OUTTAB.

  4. Select your data and copy it into the output table.
  5. Read one row of the output table at a time in a loop. To change the color of a row, assign a four-digit color code to the character field.

Note

For more information on color codes, see field EMPHASIZE of the field catalog (see Output Options of Columns).

  1. Assign the name of the internal table to field INFO_FNAME of the layout structure (in our case 'LINECOLOR' , see step 2).
  2. Pass the layout structure and the output table with method set_table_for_first_display.

Note

If you do not want to color the cells for the first display, postpone step 4 and refresh the output table with method refresh_table_display.

 

 

 

 

 

Leaving content frame