tags:

views:

1827

answers:

3

For testing purposes I need my abap program to wait for few seconds. How can this be done?

Thanks.

+2  A: 
wait up to 42 seconds.
  • Does a roll-out and releases the work process to the listener
  • Does an implicit Database commit

Use when CPU processes are at a premium and when the implicit commit will not corrupt your data or cause a short dump because of an open database cursor.

    CALL FUNCTION 'ENQUE_SLEEP'
      EXPORTING
        seconds              = 42.
  • Does not release the work process
  • Does not cause an implicit Database commit

Use when you cannot afford an implicit commit, and the system can handle the work process(es) being tied up for the duration of the SLEEP command.

Esti
So simple. And I couldn't find it on this thing called internet. Thanks!
Igal Serban
A: 

Could someone down mod the first answer ?

http://help.sap.com/abapdocu/en/ABAPWAIT_UP_TO.htm

WAIT statement has an implicit COMMIT which is something that should be avoided.

T.

tomdemuyt
I don't think that it should be down voted. There are cases were it is the desired effect. And many that it does not matter ( which is my case). Thanks for the addition.
Igal Serban
+1  A: 

Do you really need it to pause? You could trace through it by entering /h into the transaction field before you execute the program or by setting a breakpoint in the code.

Techboy
Frankly, I don't remember why I needed the pause.
Igal Serban