Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Traffic light how to be given in ALV

Former Member
0 Kudos
167

Dear Freinds,

iam able to get the data in the ouput using

REUSE_ALV_GRID_DISPLAY , as per the requiremnt i want to display the first column of the record if success Green color light and failed records display in the first column a Red .

Could any one let me know please how i can give the traffic lights in the ALV .

Thanks & regards

Srinivas.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
124

Hi,

To display icons in ALV is as follow...

Define a field in the internal table LIKE ICON-ID, not char(4). 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'.

There is another way to display icons, but is only for lights...

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'.

regards,

Advait

2 REPLIES 2

Former Member
0 Kudos
124

Hi,

See the Example BCALV_GRID_04

Regards

swamy

Former Member
0 Kudos
125

Hi,

To display icons in ALV is as follow...

Define a field in the internal table LIKE ICON-ID, not char(4). 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'.

There is another way to display icons, but is only for lights...

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'.

regards,

Advait