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: 

dropdown list with icons

Former Member
0 Kudos

Hello, I have a dropdown list with text but I would like to change it with icons. The problem is that I use ALV_GRID . I do it with the example BCALV_EDIT_06.

Have anybody an idea, please?

Thanks a lot

4 REPLIES 4

Former Member
0 Kudos

Hi,

The table fields you are displaying as a dropdown list, please make sure it should be of character of lenght 6.

for e.g

check_result(6) TYPE c ,

add this to your declaration:

TYPE-POOLS: icon ,

and pass the icon name to the required fields.

MOVE: icon_red_light TO wa_final-check_result .

Note: you can get this values from type-pool: ICON.

Rohit

0 Kudos

Hi I tried your advice and it doesn't work because the programm give the ASCII caracters of the icon.

For example : when the icon is ICON_WS_START_WHSE_PROC_BACKGR in my screen go out '@02@' and I can't see the picture.

Thanks anyway.

Ana

0 Kudos

Hi Ana,

You can use this sample.

REPORT ALV_LIGHTS.

TYPES: BEGIN OF ty_alv,

lights(1) TYPE c, "Exception, Holding the value of the lights

text(20) TYPE c, "some text

END OF ty_alv.

DATA: gs_alv TYPE ty_alv,

gt_alv TYPE TABLE OF ty_alv,

gr_alv TYPE REF TO cl_salv_table,

gr_columns TYPE REF TO cl_salv_columns_table.

START-OF-SELECTION.

gs_alv-lights = '1'. "Color red

gs_alv-text = 'RED SIGNAL'.

APPEND gs_alv TO gt_alv.

gs_alv-lights = '2'. "Color yellow

gs_alv-text = 'YELLOW SIGNAL'.

APPEND gs_alv TO gt_alv.

gs_alv-lights = '3'. "Color green

gs_alv-text = 'GREEN SIGNAL'.

APPEND gs_alv TO gt_alv.

CALL METHOD cl_salv_table=>factory

IMPORTING

r_salv_table = gr_alv

CHANGING

t_table = gt_alv.

gr_columns = gr_alv->get_columns( ).

gr_columns->set_exception_column( value = 'LIGHTS' ).

CALL METHOD gr_alv->display.

Reward if Useful.

Regards,

Chitra

0 Kudos

Ana,

I guess you are getting '@02@' value in a list.

Then you just have to set the ICON property true of that fields to "Output as icon".

Do like this.:

in the loop of field catelog table

if ls_fcat-fieldname eq "whatever the name of field"

ls_fcat-icon = 'X'.

modify pt_fieldcat from ls_fcat.

endif.

Thanks,

Rohit