Application Development 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: 

Can i give time delays

Former Member
0 Kudos
228

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??

1 ACCEPTED SOLUTION

Former Member
0 Kudos
132

Hi Prakash

For time delay use WAIT statement

e.g. wait n seconds.

n : no of seconds you want to be delayed

7 REPLIES 7

Former Member
0 Kudos
132

can u copy your code on forum.

Thanks

0 Kudos
132

&----


*& 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?

0 Kudos
132

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

Former Member
0 Kudos
132

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

jaideeps
Product and Topic Expert
Product and Topic Expert
0 Kudos
132

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

former_member196299
Active Contributor
0 Kudos
132

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

Former Member
0 Kudos
133

Hi Prakash

For time delay use WAIT statement

e.g. wait n seconds.

n : no of seconds you want to be delayed