Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

traffic

Former Member
0 Likes
547

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
512

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

3 REPLIES 3
Read only

Former Member
0 Likes
512

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

Read only

Former Member
0 Likes
512

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

Read only

Former Member
0 Likes
513

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