on 05-22-2012 8:52 AM
Hi, I have a question regarding icons in a table ui element.
I would like to show the user different icons depending some conditions and it's almost working.
I have added a status field binded to a field of lengh char255 of type image in the table to display the icon.
For the context node I am using a supply function to fill the table. In order to get the correct values for the entries I am using the function ICON_CREATE depending the conditons for each row in the table. In debugging mode I can see the correct icons are set in the status field.
But when rendering the table, the status field is not filled with an icon, but with an empty icon field, a red cross. Anyone that understands how to correct the problem?
Thank you and regards Lena
Hi Ricardo, It did not help to change the attribute to ICON_D or STRING, I just tried.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Thanks a lot for your replies.
I still have the problem though.
I use a supply function where I fill the table with values.
The code looks like below.
A function is called to the get the values for lt_table. ANd then:
lv_green_icon = 'ICON_GREEN_LIGHT'.
lv_red_icon = 'ICON_RED_LIGHT'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = lv_green_icon
IMPORTING
RESULT = lv_green.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = lv_red_icon
IMPORTING
RESULT = lv_red.
** e.g. call a model function
LOOP AT lt_table INTO ls_table.
CASE ls_table-status.
WHEN 'APPROVED'.
ls_status-ikon = lv_green. "'@08@'.
WHEN OTHERS.
ls_status-ikon = lv_red.
ENDCASE.
APPEND ls_statusTO lt_status
ENDLOOP.
lo_nd_table->bind_table( new_items = lt_status set_initial_elements = abap_true ).
The table ui element column for status of type IMAGE is bound to a context node table with a attribute of type scstring.
I debugging mode I can see that correct values are filled in table lt_table. But at screen I get an empty status field showing an image with a white square with a red cross inside.
Anyone having an idea?
thank you and regards Lena
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi.
If you are using a structure to assign to the node types, the component type of that for the icon should be of scstring.
later you can directly assing the icon name to that node attribure which will display the icon.
Ex code:
ls_display-status = 'ICON_YELLOW_LIGHT'.
append ls_display to lt_display.
This lt_display should bi bound to the node.
Regards,
Karthik .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lena,
Include the following sentence at the beginning of your method:
TYPE-POOLS: icon.
And then pass the name of the icon to your field. You can see the icons names through transaction ICON.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.