‎2007 Sep 05 12:20 PM
hi experts
i have itab having a field status and its data ( 'open' , 'complete')
pls explain the needed steps to be followed for setting the traffic light.
open --red light
complete -- green light.
explain me clearly, sorry for the convinience.
thanks in advance.
Regards
Rajaram
‎2007 Sep 05 12:34 PM
Hello,
Please refer the standard code "<b>DEMO_DYNPRO_STATUS_ICONS</b>" in se38
on click of a button it is changing the status
<b>Simple steps</b>
***********************
First create a status icon Box on the screen required(go to screen painter..left side...last icon at the bottom with a 'Tick and Cross' Mark.
so in PBO
case itab-status. "checkin status if itab-status
"if we are using table control drag and drop the icon box into the column so that we can loop at the table control and change status icons for each line
When 'OPEN'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_GREEN_LIGHT' "name of icon u want
text = 'open' "text of the icon
info = 'Status' "tool -tip text
add_stdinf = 'X'
IMPORTING
result = status_icon
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
endcase.
Similarly for other 'Complete' also follow similar steps
sy-subrc = 0.
"success
sy-subrc = 1.
Icon does not exist
sy-subrc = 2.
Icon and text do not fit on screen
sy-subrc = 3.
Error displaying status icon
Pls Reward if helpful
Regards
Byju
‎2007 Sep 05 12:23 PM
Hi,
Refer to the following program:
<b>BCALV_GRID_04</b> Illustrates the use of exceptions (lights or leds). According to the values of SFLIGHT-SEATSOCC, the lights are set to 1 (red), 2 (yellow) or 3 (green).
Hope this helps.
reward if helpful.
Regards,
Sipra
‎2007 Sep 05 12:23 PM
INCLUDE <list>.
IF ITAB-STATUS EQ 'OPEN'.
WRITE icon_red_light AS ICON.
ELSEIF ITAB-STATUS EQ 'COMPLETE'
WRITE icon_green_light AS ICON.
ENDIF.
Regards,
Pavan
‎2007 Sep 05 12:34 PM
Hello,
Please refer the standard code "<b>DEMO_DYNPRO_STATUS_ICONS</b>" in se38
on click of a button it is changing the status
<b>Simple steps</b>
***********************
First create a status icon Box on the screen required(go to screen painter..left side...last icon at the bottom with a 'Tick and Cross' Mark.
so in PBO
case itab-status. "checkin status if itab-status
"if we are using table control drag and drop the icon box into the column so that we can loop at the table control and change status icons for each line
When 'OPEN'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = 'ICON_GREEN_LIGHT' "name of icon u want
text = 'open' "text of the icon
info = 'Status' "tool -tip text
add_stdinf = 'X'
IMPORTING
result = status_icon
EXCEPTIONS
icon_not_found = 1
outputfield_too_short = 2
OTHERS = 3.
endcase.
Similarly for other 'Complete' also follow similar steps
sy-subrc = 0.
"success
sy-subrc = 1.
Icon does not exist
sy-subrc = 2.
Icon and text do not fit on screen
sy-subrc = 3.
Error displaying status icon
Pls Reward if helpful
Regards
Byju