on ‎2008 Jul 08 8:01 AM
Is creating Lock objects,admin job or ABAPer job?
What is the ABAPer work regarding Lock objects?
Can ABAPer use the ENQUEUE and DEQUEUE function modules for locking and unlocking?
Request clarification before answering.
Hi Lalitha.
Answer 1: Locking can be done by an ABAP consultant.
Answer 2: An ABAP programmer has to follows important strategies:
1. Setting of Lock mode:
Status that determines whether a user has exclusive access to an object, or whether access is shared with other users.
The lock mode (either "Shared" or "Exclusive") is assigned to the tables of a lock object on definition.
2. Activation of lock object (Calling Function Modules):
Use of various function modules (ENQUEUE and DEQUEUE) to facilitate the locking and unlocking mechanisms.
I would like to show you some code where you can understand some basic locking and releasing mechanism for HR Infotype modifications :
tables:
pa0001.
data:
t_pa0001 like table of pa0001.
data:
fs_pa0001 like p0001.
parameters:
p_pernr like pa0001-pernr.
select single *
from pa0001
into corresponding fields of fs_pa0001
where pernr = p_pernr.
fs_pa0001-gsber = '1000'.
fs_pa0001-infty = '0001'.
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = p_pernr.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0001'
number = p_pernr
* SUBTYPE =
* OBJECTID =
* LOCKINDICATOR =
validityend = '99991231'
validitybegin = '20080628'
* RECORDNUMBER =
record = fs_pa0001
operation = 'MOD'
* TCLAS = 'A'
* DIALOG_MODE = '0'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
* IMPORTING
* return = return
* KEY =
.
call function 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = p_pernr.Reward Points if you find this information usefull.
Regards
Harsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 17 | |
| 9 | |
| 9 | |
| 8 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.