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: 

ICON ON ALV TO READ STATUS AND Put A icoN Color.

Former Member
0 Kudos

Hello Experts,

im having a problem i have a alv created by CALL METHOD cl_salv_table=>factory,

and now i want to join a field with ICON by status.

like this:

‘ ’ – yellow icon_led_yellow

‘E ’ – red icon_led_red

‘S’ – green icon_led_green

‘A’ – inactive - icon_led_inactive

IF the status is E will appear icon green and say process procede. etc...

How can i add this no my alv.

Regards

3 REPLIES 3

pokrakam
Active Contributor

You need to populate a column with the icon IDs, 'ICON_LED_...' etc.

Then set it to display it's contents as icons:

alv->get_columns( )->get_column( 'STATUS_ICON' )->set_icon( abap_true ).

Former Member
0 Kudos

how i do that

pokrakam
Active Contributor
0 Kudos

Your data table needs an additional column before you create the ALV. So if your field is called STATUS, add another column STATUS_ICON (you can call it anything). Then loop through and fill it with the icon names according to the status.

Now create ALV as you have done. Give it a quick test to see your icon column is correctly filled, and then set the icon column to be displayed as icons as I explained above.