Ansicht
Dokumentation

HR_ENQUEUE_OBJECT - Lock HR Objects

HR_ENQUEUE_OBJECT - Lock HR Objects

BAL_S_LOG - Application Log: Log header data   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This module represents lock management in HR. You can use it to lock complete objects.

Objects, which do not belong directly to Personnel Planning, can only be locked using this module if they have an eight digit key. If this prerequisite is not fulfilled, exception ILLEGAL_OTYPE is created.

This type of object will then be locked, first in Personnel Planninf and then in the application which it belongs to.

Using the parameter ENQUEUE_ONCE, you can control whether an object is locked accumulatively or, despite multiple lock requests, is locked and unlocked only once.

ENQ_* parameters are forwarded to lock management directly. They should not be set. This is to enable the standard value to be adopted.

Example

Locking an obkect in Personnel Planning:

call function 'HR_ENQUEUE_OBJECT'

EXPORTING

plvar = object-plvar otype = object-otype objid = object-objid ENQUEUE_ONCE = ' '

IMPORTING

LOCK_USER = user_owning_the_object

EXCEPTIONS

ENQUEUE_FAILED = 1 OBJID_IS_INITIAL = 2 ILLEGAL_OTYPE = 3 INTERNAL_ERROR = 4 OTHERS = 5.

Locking a person:

call function 'HR_ENQUEUE_OBJECT'

EXPORTING

plvar = ' ' otype = 'P ' objid = act_pernr ENQUEUE_ONCE = ' '

IMPORTING

LOCK_USER = user_owning_the_object

EXCEPTIONS

ENQUEUE_FAILED = 1 OBJID_IS_INITIAL = 2 ILLEGAL_OTYPE = 3 INTERNAL_ERROR = 4 OTHERS = 5.

Notes

If the object is already locked, exception ENQUEUE_FAILED is created and the name of the locked user is displayed in the LOCK_USER parameter.

Further information

The module carries out checks as follows:

  1. If ENQUEUE_ONCE = 'X', it checks whether the object is already locked. If so, the module is left.
  2. Validity check for OBJID
  3. Checks the external object type in the NUMC8 key, to see whether the relationship is reversible.
  4. Personnel Planning object locked.
  5. If necessary, the object is locked in the external application. If this is not possible, the object in Personnel Planning is unlocked and an exception is created.




Parameters

ENQUEUE_ONCE
ENQ_COLLECT
ENQ_SCOPE
ENQ_WAIT
LOCK_USER
OBJID
OTYPE
PLVAR

Exceptions

ENQUEUE_FAILED
ILLEGAL_OTYPE
INTERNAL_ERROR
OBJID_IS_INITIAL

Function Group

HRBAS00ENQDEQ

ABAP Short Reference   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 2983 Date: 20240523 Time: 103604     sap01-206 ( 52 ms )