Code: Alles auswählen.
"Einfach beenden, wenn das Programm schon bzw. noch in einem anderen Job läuft.
CALL FUNCTION 'ENQUEUE_E_TLOCK'
EXPORTING
MODE_RSE_TLOCK = 'E'
PGMID = 'LIMU'
OBJECT = 'REPS'
OBJ_NAME = sy-cprog
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 1.
WRITE: 'Same job is already running - this instance is stopped.'.
LEAVE PROGRAM.
WHEN 2 OR 3.
WRITE: 'Error in enqueue - this instance is stopped.'.
LEAVE PROGRAM.
ENDCASE.
Code: Alles auswählen.
"Einfach beenden, wenn das Programm schon bzw. noch in einem anderen Job läuft.
CALL FUNCTION 'ENQUEUE_E_TLOCK'
EXPORTING
MODE_RSE_TLOCK = 'E'
PGMID = 'LIMU'
OBJECT = 'REPS'
OBJ_NAME = sy-cprog
EXCEPTIONS
FOREIGN_LOCK = 1
SYSTEM_FAILURE = 2
OTHERS = 3.
CASE sy-subrc.
WHEN 1.
WRITE: 'Same job is already running - this instance is stopped.'.
LEAVE PROGRAM.
WHEN 2 OR 3.
WRITE: 'Error in enqueue - this instance is stopped.'.
LEAVE PROGRAM.
ENDCASE.
* Wait Enqueu is active
Do 10000 TIMES.
Call Function ENQUE_REPORT
:
:
if not number is initial.
exit.
endif.
ENDDO.