Pass the fieldcatalog, table and layout into the function “REUSE_ALV_GRID_DISPLAY”.
Retrieve Data from Database Tables and maintain value for traffic light icon according to required condition.
Add Column in the structure Which holds the traffic light value.
Create Field catalog for ALV Grid report display.
Pass the fieldcatalog, table and layout into the function "REUSE_ALV_GRID_DISPLAY”.
1. (‘@0A@’ for Red Light Color). 2. (‘@09@’ for Yellow Light Color). 3. (‘@08@’ for Green Light Color).
IF YOU USE ABOVE CODE FOR TRAFFIC LIGHT ICON THEN NO NEED TO MAINTAIN LAYOUT FIELD WITH LIGHTS_FIELDNAME
(1 for Red Light Color) (2 for Yellow Light Color) (3 for Green Light Color)
IF YOU USE ABOVE CODE FOR TRAFFIC LIGHT ICON THEN YOU HAVE TO MAINTAIN THE FIELD "TRAFFIC" WHICH YOU USE FOR TRAFFIC LIGHT ICON.