2007 Aug 03 2:09 PM
Hi guys
I have an internal table with field text
whick wil contain values ok and not ok
i want to dispaly output using traffic signal
if it s ok i have to dispaly light as green and for not ok
have to display as red..
can u help me guys?
senthil
2007 Aug 03 2:26 PM
INCLUDE <ICON>.
field-symbols: <I>.
data: result(2).
assign ICON_GREEN_LIGHT to <I>.
if result = 'OK'.
assign ICON_GREEN_LIGHT to <I>.
else.
assign ICON_RED_LIGHT to <I>.
endif.
write: <I> as icon.
Hi guys
I have an internal table with field text
whick wil contain values ok and not ok
i want to dispaly output using traffic signal
if it s ok i have to dispaly light as green and for not ok
have to display as red..
can u help me guys?
senthil
2007 Aug 03 2:18 PM
You have to add a column in your internal table defined for traffic light
This field is of type Char 1, and can contain the following values:
1 Red
2 Yellow
3 Green
<b>OO-ALV</b>
The name of the traffic light field is supplied in the <b>layout-excp_fname</b> used by <b>method set_table_for_first_display.</b>
<b>Reuse ALV</b>
The name of the trafic lights should be filled in field<b> lights_fieldname</b> of <b>is_layou</b>t parameter
Regards
2007 Aug 03 2:26 PM
INCLUDE <ICON>.
field-symbols: <I>.
data: result(2).
assign ICON_GREEN_LIGHT to <I>.
if result = 'OK'.
assign ICON_GREEN_LIGHT to <I>.
else.
assign ICON_RED_LIGHT to <I>.
endif.
write: <I> as icon.
2007 Aug 03 2:28 PM
Hi senthil,
1. Its simple
2. We have to use the layout of alv also.
and one extra field in the internal table.
3. Just copy paste in new program.
REPORT abc.
TYPE-POOLS : slis.
DATA : alvly TYPE slis_layout_alv.
DATA : alvfc TYPE slis_t_fieldcat_alv.
DATA : BEGIN OF itab OCCURS 0,
lt TYPE i,
matnr LIKE mara-matnr,
END OF itab.
END-OF-SELECTION.
itab-lt = 1.
APPEND itab.
itab-lt = 2.
APPEND itab.
itab-lt = 3.
APPEND itab.
itab-lt = 1.
APPEND itab.
itab-lt = 3.
APPEND itab.
itab-lt = 3.
APPEND itab.
itab-lt = 3.
APPEND itab.
*----
alvly-lights_fieldname = 'LT'.
alvly-lights_tabname = 'ITAB'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'ITAB'
i_inclname = sy-repid
CHANGING
ct_fieldcat = alvfc.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = alvfc
is_layout = alvly
i_save = 'A'
TABLES
t_outtab = itab.
regards,
amit m.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |