Application Development and Automation 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: 
Read only

DB table locking in Order Save User exits...

Former Member
0 Likes
610

Hello All,

This may be a basic question for the experts, but to clear the confusion I am putting it infront of you.

Scenario :-

Let us assume that the standard order save user exit "USEREXIT_SAVE_DOCUMENT_PREPARE" is being used to populate/modify some data in the z-table which has fields like VBELN, POSNR, DATE, TIME etc.,

In the above case,

1) Do we really need to lock the z-table using an Enqueue lock objects with the row level parameters defined ?

(or)

2) Do we directly populate the database table without any lock object under the assumption that standard SAP lock object ENQUEUE_EVVBAKE takes care of locking the z-table as well because z-table has the VBELN as the parameter ??

Please comment / clarify my confusion. Appreciate your <removed by moderator> response on this.

Thanks,

Babu Kilari

Edited by: Thomas Zloch on May 7, 2011 1:20 PM - urgency reduced

Hello All,

This may be a basic question for the experts, but to clear the confusion I am putting it infront of you.

Scenario :-

Let us assume that the standard order save user exit "USEREXIT_SAVE_DOCUMENT_PREPARE" is being used to populate/modify some data in the z-table which has fields like VBELN, POSNR, DATE, TIME etc.,

In the above case,

1) Do we really need to lock the z-table using an Enqueue lock objects with the row level parameters defined ?

(or)

2) Do we directly populate the database table without any lock object under the assumption that standard SAP lock object ENQUEUE_EVVBAKE takes care of locking the z-table as well because z-table has the VBELN as the parameter ??

Please comment / clarify my confusion. Appreciate your <removed by moderator> response on this.

Thanks,

Babu Kilari

Edited by: Thomas Zloch on May 7, 2011 1:20 PM - urgency reduced

3 REPLIES 3
Read only

former_member191735
Active Contributor
0 Likes
565

1) It is upto you. How sensible is that information and do you really want to lock down the entries? if yes, go ahead

2) Again, it is upto you. SAP Lockobject doesnt lock Ztables.

Read only

Former Member
0 Likes
565

Standard locks doesn't lock ztables and locks are specific to table, not fields. You are the best person to decide if a lock is required or not, based on your requirement and how frequently data is modified. You can go ahead with lock, no harm.

Cheers.

S. Verma

Read only

Clemenss
Active Contributor
0 Likes
565

Hi Babu,

if the Z table has the VBELN in the key and the only process updating this table is the USEREXIT_SAVE_DOCUMENT_PREPARE, then you do not need any additional locking for this table.

But you should put this updating into a function module and call this function IN UPDATE TASK in the user exit.

Then you can be sure, that the update take place with the successful save of the sales document, any errors will roll it back together with order data. Database consistency is given.

Regards,

Clemens