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

Locks

Former Member
0 Likes
801

Hi,

i have made three custom tcodes:

1. Form create

2. Form change

3. Display.

(Like standard SAP).

I want to implement the functionality that if somebody has opened say formno 20 in change mode.

Nobody shud open form 20 again.

It shud show a message 'Form 20 is currently edited by --- user'

Points will b awarded.

regards,

Nishant

3 REPLIES 3
Read only

harimanjesh_an
Active Participant
0 Likes
734

Hi Nishant,

To lock objects, SAP provides some Function Modules starting with ENQUEUE. Example, to lock Table LTAP SAP provides FM ENQUEUE_ELLTAPE.

Similarly, to unlock we have FM starting with DEQUEUE. Example, to unlock table LTAP we use FM DEQUEUE_ELLTAPE.

So, search the FM that meets your requirement.

check this link for more info:

http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

Reward me if useful,

Harimanjesh AN

Read only

Former Member
0 Likes
734

In your program when you go into Edit mode for a form, call the FM

ENQUEUE_ESINDX with RELID = 'ZZ' and your form name. If the FM returns SUBRC greater than 0, then throw the message .

Hope this helps.

Thanks,

Balaji

Read only

harimanjesh_an
Active Participant
0 Likes
734

Hi Nishant,

SAP provies LOCK OBJECTS to lock the database table and always provides exclusive access for editing and updating the Database.

All Locking Function Modules starts with ENQUEUE. Example to lock table LTAP, we can use FM ENQUEUE_ELLTAPE.

Similarly all unlocking function modules starts with DEQUEUE. To unlock table LTAP we can use function module DEQUEUE_ELLTAPE.

check this link for more info:

http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm

Reward me if useful....

Harimanjesh AN