‎2010 Jan 12 9:03 AM
HI All,
In my tabel control status field i need to display RED or GREEN icon based on the input..
i've got the value in internal, but in screen ICON is not coming.. it is showing as
"@0A\QRed light; stop; erro" please help me how to display the icon..
is there any setting as to be done in screen painter...
ICON should come in table control.....
Thanks and Regards
Suprith
‎2010 Jan 12 9:24 AM
‎2010 Jan 12 9:12 AM
Please mark the column in table control as outputfield, the icon gets displayed only if its marked as output field.
‎2010 Jan 12 9:20 AM
‎2010 Jan 12 9:24 AM
‎2010 Jan 12 9:28 AM
data : status type icons-text,
data : status_icon TYPE icons-text,
icon_name(20) TYPE c.
READ TABLE it_check with key mblnr = it_mseg-mblnr.
if sy-subrc = 0.
icon_name = 'ICON_RED_LIGHT'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_name
text = icon_text
info = 'Status'
add_stdinf = 'X'
IMPORTING
result = status_icon
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
it_mseg-status = status_icon.
else.
icon_name = 'ICON_GREEN_LIGHT'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = icon_name
text = icon_text
info = 'Status'
add_stdinf = 'X'
IMPORTING
result = status_icon
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
it_mseg-status = status_icon.
endif.
‎2010 Jan 12 9:32 AM
Just passing 'ICON_RED_LIGHT' or the other to it_mseg-status will do.
Why do you use ICON_CREATE .. i dont have any ideas reg this fm.
The problem might be somewhere in the usage of fm
Please read link:[Status Icons|http://help.sap.com/saphelp_46c/helpdata/en/59/348efa61c611d295750000e8353423/content.htm]
Edited by: Keshav.T on Jan 12, 2010 3:03 PM
‎2010 Jan 12 9:35 AM
Hi Suprith,
<<Sorry please ignore>>
Nag
Edited by: Naga Mohan Kummara on Jan 12, 2010 10:36 AM
‎2010 Jan 12 9:35 AM
Hi keshav...
you tell me any alternative way to create ICON...
i'm using table control... last field is the icon field... based on condition either it will be RED or GREEN
‎2010 Jan 12 9:40 AM
Just moving the value 'ICON_RED_LIGHT' to the internal table row would do.
In you program can you check passing 'ICON_RED_LIGHT' directly to the fm.
‎2010 Jan 12 9:43 AM
In Screen painter i've made default lenght as 32... its working properly
Thanks NAG and Keshav