Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 16, 2017 at 04:17 PM

    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 ).
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 16, 2017 at 04:27 PM

    how i do that

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 16, 2017 at 09:54 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded