2007 Sep 18 8:08 AM
I want to have a screen that displays different status icons after every 10 seconds. I have the code for changing the icons but i donot know how to create a delay before the icons change.
Can anyone help??
2007 Sep 19 8:15 AM
Hi Prakash
For time delay use WAIT statement
e.g. wait n seconds.
n : no of seconds you want to be delayed
2007 Sep 18 8:13 AM
2007 Sep 18 11:12 AM
&----
*& Report ZBC400_13_STATUS
*&
&----
*&
*&
&----
REPORT ZBC400_13_STATUS.
icon_name holds the name of the icon from the icon table
icon_text holds the text message recieved from the icon table
status_icon is the icon in the screen
DATA: status_icon TYPE icons-text,
icon_name(20) TYPE c,
icon_text(10) TYPE c.
Workarea type icon
DATA: WA_ICON TYPE ICON.
Screen 9000 has just the status_icon
CALL SCREEN 9000.
PBO
MODULE set_icon OUTPUT.
One icon is taken from the database everytime and put on the status
icon for 20 rows in icon table
SELECT NAME MESSAGE FROM ICON INTO CORRESPONDING FIELDS OF WA_ICON.
IF SY-DBCNT > 20.
EXIT.
ENDIF.
Assigning retrieved value from table to local variable
icon_name = WA_ICON-NAME.
icon_text = WA_ICON-MESSAGE.
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.
*Time delay.
DO 1000 TIMES.
DO 1000 TIMES.
DO 10 TIMES.
ENDDO.
ENDDO.
ENDDO.
*THe change is made to reflect on the screen
MODIFY SCREEN.
ENDSELECT.
ENDMODULE.
This program has a problem.
THe delay is set in the PBO so all processing ends before screen is displayed.
Any solution?
2007 Sep 19 1:37 AM
There's a few ways of implementing "timers" - the newer ones are cl_gui_timer or the ABAP "wait", but earlier code often used calls to functions RZL_SLEEP or ENQUE_SLEEP.
But if you take a look at the sample code I posted in:
there's an example there of having an autorefreshed list that might help you along your way... the trick being to do an RFC call in a new task and perform the auto-refresh when the results come back.
Jonathan
2007 Sep 18 9:12 AM
yah...if this is u r requirement, then inorder to give a time delay , just run any dummy code like counting upto 100000 times...etc etc into u r code
2007 Sep 18 11:33 AM
hi prakash,
for using timers use this Fm
CALL FUNCTION 'SWE_CD_TST_DELAY'
EXPORTING
DELAY = '10'.
OR you can go for CL_GUI_TIMER
thanks
jaideep
*reward points for evry useful answers
2007 Sep 19 6:59 AM
hi ,
Try using SAPGUI_PROGRESS_INDICATOR in your code for giving some time delays and the user is able to see the program progressin the mean time .
Regards,
Ranjita
2007 Sep 19 8:15 AM
Hi Prakash
For time delay use WAIT statement
e.g. wait n seconds.
n : no of seconds you want to be delayed