Skip to Content

The Blog explains How to color a cell Conditionally in an ALV Grid control report.

This Blog explains how to apply color conditionally to a cell in an ALV Report using CL_GUI_ALV_GRID class. I developed a small report

Here is the Simple Report with the Steps.

1.Data Declarations part.In Data declaration part include the extra field of type lvc_t_scol which is a deep structure. It is used to assign the colors dynamically.

2.Populate the Internal table and modify the color field conditionally, In this example i am checking the condition seats occupied < 0 then assigin the Red color to the cell

3.Create the Screen 100, and place the Custom Control in the Screen and Name it as FLIGHT.

4.Using the PBO Module set the PF-status and Title Bar. Initialize the Grid , Assign the color field declared in step#1 to ctab_fname of layout before calling the set_table_for_first_display.

5. Call the screen in END-OF-SELECTION to Display the data

6.Check the sample output of the Report.

7.The complete coding

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Former Member
    Hope the program BCALV_GRID_VERIFY(Run the program with “Cell coloring example”) and plenty of snippets in the SDN ABAP forums demonstrates the same feature.



Leave a Reply