Skip to Content
0

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

Jun 16, 2017 at 02:58 PM

85

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Mike Pokraka Jun 16, 2017 at 04:17 PM
2

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 ).
Share
10 |10000 characters needed characters left characters exceeded
diego Morgado Jun 16, 2017 at 04:27 PM
0

how i do that

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Jun 16, 2017 at 09:54 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded