Entering content frameProcess documentationColoring Cells Locate the document in its SAP Library structure

Purpose

You can change the color of cells in the grid control to highlight data in the list. Although you can also use this process to color entire rows, this is much more time-consuming than the procedure described in Coloring Rows.

Note

The D&D Behavior for Special Rows/Cells process is the analogous method to the method for selecting cells.

 

Process Flow

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

    DATA:   CT TYPE LVC_T_SCOL. "Table for colors

    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 the loop. One row of the color table has three fields. If field NOKEYCOL is set, you can change the color of key fields. Assign values to the remaining fields as follows:

Note

For information on the meaning of the color settings, see F1 help on the format command. Class CL_GUI_RESOURCES contains constant attributes for fields INT and INV of structure COLOR .

  1. Assign the name of the internal table to field CTAB_FNAME of the layout structure (in our case 'CT', 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 your output table with method refresh_table_display.

 

 

 

 

 

Leaving content frame