Traffic Lights in ALV

There are two ways to implement traffic lights (lamp icon) in your ALV Grid:

1.For any icon (including traffic lights)
Define a field in the internal table LIKE ICON-ID
For example...
DATA: BEGIN OF ITAB...
icon_field LIKE ICON-ID,
... END OF ITAB.
Then fill the field icon, for example...
itab-icon_field = @0A@ "Red light
Preparing the fieldcatalog...
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-fieldname = 'ICON_FIELD'.
wa_fieldcat-icon = 'X'.

2.For traffic lights only
icon_field(1) TYPE C.
itab-icon_field = '1'. "Red
itab-icon_field = '2'. "Yellow
itab-icon_field = '3'. "Green
wa_layout-lights_tabname = 'ITAB'.
wa_layout-lights_fieldname = 'ICON_FIELD'.

3 Comments:

  1. Anonymous said...
    Dear limbrada,

    It was very helpful for me, thank you............
    Anonymous said...
    Thank you. It really helped me. :)
    Selcuk said...
    thank you, it helps me too

Post a Comment