11-22-2007 8:41 AM
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
11-23-2007 11:02 AM
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
11-26-2007 8:38 AM
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
11-26-2007 9:26 AM
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
11-26-2007 1:41 PM
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