How to pause an ABAP program?

ABAPSAP

Either you can use SAP “WAIT UP TO” statement. For e.g. the below statement waits up for 30 seconds

WAIT UP TO 30 SECONDS

But this statement has an implicit database commit. It might sound weird but there are scenarios where this behavior is expected so you should be aware of whether this fits your use case or not. In addition to this, it performs a rollout and releases the worker processes.

But the use cases where you don’t want to have an implicit database commit and worker process are considered important then you can go for an alternative “Enque_Sleep”. For e.g. the below statement will pause for 30 seconds.

CALL FUNCTION 'ENQUE_SLEEP'
   EXPORTING
   SECONDS = 30
raja
Published on 20-Dec-2017 16:37:49
Advertisements