How to pause an ABAP program?


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

Sai Subramanyam
Sai Subramanyam

Passionate, Curious and Enthusiastic.

Updated on: 30-Jul-2019

348 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements