Skip to Content


Hi people!

I'm doing an ALV OO (with CL_GUI_ALV_GRID) and I need to color only determinated fields in grid! I know how to set color of a row and of a column too.... but I don't know what I need!

Can Anyone help me???????

Tks in advance!


Edited by: Gabriel Petrini on Jan 30, 2008 11:33 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 30, 2008 at 02:04 PM

    Extract from [ALV Gird Control (BC-SRV-ALE)|]

    Coloring Cells
    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 [Page 31].
    The D&D Behavior for Special Rows/Cells [Page 27] process is the analogous
    method to the method for selecting cells.
    Process Flow
    1. Define the layout structure [Page 157] 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:
    DATA: CT TYPE LVC_T_SCOL. "Table for colors
    3. Select your data and copy it into the output table.
    4. 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:
    __ If you want to color the entire row, assign the corresponding values to the fields of structure COLOR. Field fname does not receive a value in this case.
    __ If you want to color specific columns of the row only, you must append one row for each column to the color table. Assign the name of the desired column to field fname, and the corresponding values to the fields of structure COLOR.
    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.
    5. Assign the name of the internal table to field CTAB_FNAME of the layout structure (in our case'CT', see step 2).
    6. Pass the layout structure and the output table with method  set_table_for_first_display [Page 100].
    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 [Page 85].


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 02:03 PM


    PLease refer to the standard program



    Please refer to the link below it may be helpful.


    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.