Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Ask about locking

Former Member
0 Kudos

Dear Experts,

I have some problem about SAP Locking mechanism..

the case is :

a. i have some dummy transparent table called ZBCT_PLANT based on this table we create some locking object.

b. this locking object is to make sure that my enchancement program processing only one combination data of plant, vendor, storage loc. and material number

c. this locking object starting at first the transaction called and after posting (using recording from VL31N) the lock is released..

now, the fact is :

- the locking is often to released itself even the statement dequeu not called...

so my question : is there any condition which make this lock released itself ? regarding this lock is fully controlled from my enhancement not by standard SAP...

i will reward points for someone who could gimme answer for this..

if you need more explanation pls feel free to ask me.. because the logic is complicated so maybe my summary not satisfied you...

thanks,

sasmito

7 REPLIES 7

raymond_giuseppi
Active Contributor
0 Kudos

There are three ways to release a lock

- Call of DEQUEUE_E module

- COMMIT WORK (lock is transmitted to update task which releases the lock at end of V1 updates)

- ROLLBACK WORK

As the end of the transaction LUW which locked the record executes a COMMIT or ROLLBACK it also releases the lock.

Look also at those documentations <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTUP/BCCSTUP_PT.pdf">Updates in the R/3 System (BC-CST-UP)</a> and

<a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTEQ/BCCSTEQ_PT.pdf">The SAP Lock Concept (BC-CST-EQ)</a>

Regards

0 Kudos

Dear Raymond..

that's confusing me..

there's no such call in my code (you mentioned....)

but the lock is release itself.. and for some other data (in loop) suddenly it lock again and it can released automatically again..

so if i have data in loop some part of it are encountered locking, but some others no..

like i mentioned before i lock at the beginning, so suppose all the data in loop are encountered locking... not partial

thanks,

sasmito

0 Kudos

In "The SAP Lock Concept" look at "The SAP Lock Concept" try to use _SCOPE = 3 so commit wont release the lock.

Also keep in mind that the lock is related to the luw. Some instructions can leave the current luw. (CALL TRANSACTION and the like)

Regards

Former Member
0 Kudos

it seems that Commit work is releasing urr lock .. hw ever if u still want to be in control of urr locks try the parameter scope = 2 it there will be two simultaious lock (note that urr lock type should be S or E ) one will be release by the update program and other will be release by your main program from which you are calling in update task and commit work ..

so now you have to call commitwork or deque all from urr update program also..

0 Kudos

sorry but i think the scope is set by default to 2..

if what you mean is the parameter _scope in lock enqueu function module..

so it is not working..

thanks,

sasmito

Message was edited by:

sasmito handoko

Former Member
0 Kudos

DA...

more information that in my development client the locking seems working well...

and we found this problem in our production/operational client..

is there possibility of SAP Setting/Configuration or else ?

thanks,

sasmito

Former Member
0 Kudos

the locking was not even released by itself..

the assumption was led to a mistaken..

the case is that the update throw in local update task.. so when the system go slow.. theres some error locking by itself..

case closed