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 Lights in ALVgrid

Former Member
0 Kudos

Hi,

I am using 'CL_GUI_ALV_GRID' method to display data via ALV. I have a requirement of displaying the succesful records with green light and unsuccessful ones with red lights.

Can somebody tell me which field to use in field catalog for that icon or is there any other method. I am open to any other suggesstions also.

Thanks.

Shiv

1 ACCEPTED SOLUTION

Former Member
0 Kudos

also you can follow as below while filling your internal table.

Define a flag(4) type C in your internal table.

LOOP AT IT_MARA.

IF IT_MARA-vpsta = 'KELVZX'.

IT_MARA-FLAG = '@08@'.

ELSEIF IT_MARA-vpsta = 'KEBVGX'.

IT_MARA-FLAG = '@09@'.

ELSE.

IT_MARA-FLAG = '@0A@'.

ENDIF.

MODIFY IT_MARA INDEX SY-TABIX.

ENDLOOP.

4 REPLIES 4

Former Member
0 Kudos

see below example

BCALV_GRID_04 it uses cl_gui_alv_grid and displays trafic lights.

Former Member
0 Kudos

also you can follow as below while filling your internal table.

Define a flag(4) type C in your internal table.

LOOP AT IT_MARA.

IF IT_MARA-vpsta = 'KELVZX'.

IT_MARA-FLAG = '@08@'.

ELSEIF IT_MARA-vpsta = 'KEBVGX'.

IT_MARA-FLAG = '@09@'.

ELSE.

IT_MARA-FLAG = '@0A@'.

ENDIF.

MODIFY IT_MARA INDEX SY-TABIX.

ENDLOOP.

Former Member
0 Kudos

Ok, i got it. Ineed to include icons and use the traffic signal available there in a field of my ionternal table which I am displaying (type : char (4)).

It works.

Thanks to myself & also other who read this and were preparing to answer!!

0 Kudos

Pl. mark the thread as 'problem solved'.