12-23-2008 10:59 AM
Hi All,
I am trying to change the locked OT record by using the FM HR_INFOTYPE_OPERATION.
Its is working fine for unlocked records But not working for locked records.
Is it possible to change the locked records by using this HR_INFOTYPE_OPERATION function module.
Rgds,
Mahesh.
12-23-2008 11:16 AM
It should not be possible.
I too would be cross checking it but basic idea says it should not be possible to change any record locked by other person or process.
12-23-2008 11:33 AM
You can use FM 'BAPI_EMPLOYEE_ENQUEUE' to see whether the employee is locked, if it is then HR_INFOTYPE_OPERATION will return locked record error and do nothing. The lock will happen if someone is updating the employee (PA30 for example), so it's suposed to do exactly that, prevent others from updating. If you still want to do it, you can try to dequeue the employee, but i'm not sure what will be the consequence (if that is even possible).
12-23-2008 12:10 PM
The function module BAPI_EMPLOYEE_ENQUEUE locks the tables while the function module BAPI_EMPLOYEE_DEQUEUE unlocks the tables.
So, you can try to check and unlock using function module BAPI_EMPLOYEE_DEQUEUE befor passing the data to function module HR_INFOTYPE_OPERATION.
The lock-unlock mechanism helps in maintaining data consistency such that at a time only one person can access and change the data.
12-26-2008 11:58 AM
Hi Mahesh,
YES, It is possible to change the locked record.
Make sure that you should pass LOCKINDICATOR = 'X' and also check that NOCOMMIT is initial.
Also make sure that the other key fields you are passing is correct.