Locking a program so it can only ne executed once at a time

Set the lock:

  CALL FUNCTION 'ENQUEUE_EZHR_INTER_IO'
       EXPORTING
            prgname        = sy-cprog
            bukrs          = ''
            affiliate      = ''
       EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.

* Terminated program execution
  IF sy-subrc EQ 1.
    MESSAGE e004 WITH sy-cprog.
  ENDIF.



Free lock:

CALL FUNCTION 'DEQUEUE_EZHR_INTER_IO'
       EXPORTING
            prgname   = sy-cprog
            bukrs     = ''
            affiliate = ''.
Converted from CHM to HTML with chm2web Standard 2.7 (unicode)