How to pause the ABAP program execution for given number of seconds

If you're looking for a way to pause the ABAP program, try this method.

Study the following self-explanatory code to pause the ABAP program execution for a given number of seconds:
 

REPORT ZABAP_PAUSE

PARAMETERS: P_TIME TYPE I.

WRITE: / 'DELAY IN SECONDS:', P_TIME.

* Get the Run time.
GET TIME.

WRITE: / 'START TIME:', SY-UZEIT.

* Pause execution for P_TIME seconds.

CALL FUNCTION 'RZL_SLEEP'
 EXPORTING
    SECONDS        = P_TIME
  EXCEPTIONS
    ARGUMENT_ERROR = 1
    OTHERS         = 2.

IF SY-SUBRC <> 0.
 WRITE:/ 'ERROR WITH SLEEP 
          FUNCTION'.
ENDIF.
GET TIME.

WRITE: / 'END TIME:', SY-UZEIT.
This was last published in April 2005

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close