‎2014 Jun 05 7:13 PM
Experts,
I am aware that we can do row level locking by creating a separate lock object for the table. I am calling enqueue_**** FM to call lock object created for my custom table. I am passing lock parameters & see that when a record does not exist in my custom table still SUBRC returned is 0 by lock FM.
As per my understanding, SUBRC should not be 0 as the record does not exist in table to be locked.
Please share your valuable inputs.
BR
Aspire
‎2014 Jun 05 7:16 PM
Note that i have created lock parameters same as key fields for my custom table ideally to lock a particular row by passing the key fields. I am also passing MANDT during my ENQUEUE_**** FM call.
Is it Standard functionality that only if record exists, then it will be checked for locking. If record does not exist, then SAP does not set SUBRC other than 0?
In my case one of the key fields for my custom table is contract account. I am passing junk data as 999999***... for Cont Account in lock parameter along with other fields & still see that SUBRC after FM call is set as 0.
BR,
Aspire
‎2014 Jun 05 7:16 PM
Note that i have created lock parameters same as key fields for my custom table ideally to lock a particular row by passing the key fields. I am also passing MANDT during my ENQUEUE_**** FM call.
Is it Standard functionality that only if record exists, then it will be checked for locking. If record does not exist, then SAP does not set SUBRC other than 0?
In my case one of the key fields for my custom table is contract account. I am passing junk data as 999999***... for Cont Account in lock parameter along with other fields & still see that SUBRC after FM call is set as 0.
BR,
Aspire
‎2014 Jun 05 8:13 PM
I read many threads where i can see that they are discussing about feasibility to do row level locking in abap. I am getting this logic & interested to only know,
why SUBRC comes as '0' even if the key parameters of the database record don't exist?
‎2014 Jun 05 9:00 PM
Hello Aspire,
The most important thing to know is SAP Locking mechanism doesn't physically lock the record, but does it logically.
It does not matter what values you pass to the ENQUEUE module params, the lock mechanism uses them to build a logical key and stores it in the lock table. Further lock requests are checked against this key.
I am passing junk data as 999999***... for Cont Account in lock parameter along with other fields & still see that SUBRC after FM call is set as 0.
Try doing this -
The answer to the "why" is the logical lock mechanism used by SAP
BR,
Suhas
‎2014 Jun 06 9:42 AM