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

Query about SAP locks /enqueue objects

Former Member
0 Likes
1,340

I have created an lock object for a bespoke table which has 5 key fields. For arguments sake let's call them

WERKS QMGRP QMCOD OTGRP OTEIL.

The problem I have is the following:

User 1 has a house profile that can access the following data:

WERKS QMGRP QMCOD OTGRP OTEIL
9026  HOUSE CUST 

User 2 has a functional profile which gives them access to the following:

WERKS QMGRP QMCOD OTGRP OTEIL
9026  HOUSE CUST  
9026  HOUSE CUST   CS    C001
9026  HOUSE CUST   CS    C002

I am building a front-end to the table to enable the users to change data associated with these keys. My problem is the following. If User 2 locks the entries,(s)he has access to first, the user 1 entry will be locked to changes, which is correct. If, however, user 1 locks its entry first, <b>all</b> of user 2's entries are locked even though only the first entry is allowed to be accessed by both. I think this is happening because the SAP lock object does not recognise ' ' ' ' as a separate value to 'CS' 'C001'. It thinks because 9026 HOUSE CUST ' ' ' ' is locked, then the other entries should be locked because they share 9026 HOUSE CUST from the key, even though there are other values in the key following 9026 HOUSE CUST.

What I want is if user 1 locks its entry first, then only the entry that matches the key totally for user 2 is locked, leaving the other 2 entries to which user 2 has access free to be edited.

Is there a way I can get the SAP lock object to recognise this eitehr by changing the enqueue function module or by the way I cal the enqueue object or not?

Any help would be appreciated.

Hope this makes sense

Larissa

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,231

Hi Larissa,

Go through the link below. It may help you.

http://www.sapsuperusers.com/forums/showthread.php?t=4896

<b>Reward points if it helps.</b>

Regards,

Amit Mishra

5 REPLIES 5
Read only

Former Member
0 Likes
1,232

Hi Larissa,

Go through the link below. It may help you.

http://www.sapsuperusers.com/forums/showthread.php?t=4896

<b>Reward points if it helps.</b>

Regards,

Amit Mishra

Read only

0 Likes
1,231

Thanks Amit but that is not what I am really looking for. I know how to create a lock object as I have already created one. What I am after is determing a space as a value for the key instead of the SAP locks locking any entry after that where the partial key matches.

Larissa

Read only

0 Likes
1,231

Hi Larissa,

As far as I know, You cannot change generated enqueue function module. The other way as i think might work would be to create a new FM and do manipulation (for space to be changed as some other value) before calling this generated Enqueue FM.

Hope this helps.

Regards,

Vicky

PS: Award points if helpful

Read only

Peter_Inotai
Active Contributor
0 Likes
1,231

You might use FM ENQUEUE_READ to check what is locked and build your logic based on the entries locked.

Peter

Read only

0 Likes
1,231

This does not really help though if I set a lock on the entries viewd by that user as the function module 'ENQUEUE_*' will produce a foreign lock. I have used Vicky's idea of adding a value by adding NULL where space which should hopefully do the trick.

Thank you

Larissa