‎2019 Nov 20 1:36 PM
Hi All,
In my module pool, I have two input fields and in application tool bar I have Create, Change and Display icons. For the given inputs user clicks on Create/Change and enter some data in the table controls and save the data into database. If one user is trying to Create/Change the data for the given inupts, other users should not be able to go Create/Change mode. Only Display mode should be allowed. I used the function module 'RSAU_WRITE_SM01_LOG' but still other users are able to go into change mode. How can we restrict this. Please let me know if anyone have done this.
Thanks,
Haritha
‎2019 Nov 20 1:42 PM
I think you go completely the wrong way with RSAU_WRITE_SM01_LOG!
What you are looking for is a lock to be set when a user is editing the "object", and any other person trying to edit this same object will be rejected because a lock exists. Please search the forum for "lock object" (enqueue, dequeue, etc.)
‎2019 Nov 20 1:47 PM
Hello,
You should look at locking objects concept in SAP. There you can find the way to lock a table and what are the options when doing the locking.
For more information, be free to ask.
Regards,
Igor
‎2019 Nov 20 1:48 PM
Hi,
I do not know which object you are updating but you may use lock objects to restrict access (via enqueue & dequeue).
‎2019 Nov 20 7:04 PM
You have to use the lock object. You will get enough information in google. So, basically when you create a lock object, 2 function module will be created. Once for en-queue that is to put a lock and another one is de-queue which is to release the lock. Once it's lock, you can see it in SM12.
Thanks,
Gourab
‎2019 Nov 21 5:24 AM
Create a custom (Z-) lock object for your T-Code. If a user can enqueue, he/she can edit. If not, he/she should see the data in read only mode.
‎2019 Nov 21 5:44 AM
@Haritha P It can be achieved by using lock object, create a lock object for the table which you are using in the Table control.
In the beginning of the program call created lock objects ENQUEUE to lock the data and at the end call DEQUEUE to release the lock
‎2019 Nov 21 7:02 AM
Hi Prakash,
I have already used this ENQUE and DEQUE function modules in my module pool program when updating my custom tables. Here what I am trying to do is, if one user click on Change icon in application tool bar, all the tabs are in editable mode. If other users try to click on Change icon, it should throw an error message 'One user already editing the data, only display allowed'.
Thanks,
Haritha
‎2019 Nov 21 9:16 AM
vidya.p that's the use of Lock objects!
‎2019 Nov 21 10:44 AM
Generally speaking, to support mass update in background in parallel processes, between the read (1) and the lock (3), it could be locked by another process, so I think it's best to use this logic as rule of thumb:
‎2019 Nov 21 7:20 AM
vidya.p If that is the case, under Change Icon user command, check for the lock entries using FM 'ENQUEUE_READ' and if there is lock for your transaction/program/table, then raise a message 'One user already editing the data, only display allowed'.