2010 May 14 5:17 PM
We have a requirement where in multiple users should be allowed to maintain the table at the same time. We have created a program which removes the table level lock and applies row level lock and allows the users to change the entries at the same time, which is working fine. But the problem is that when the first user is changing an entry in the table, then the subsequent user is not able to create a new entry in the table.
Any pointers would be appreciated.
Thanks in advance,
Sirisha
2010 May 14 6:22 PM
Hi,
If you create a temporary table (itab) to save new data when this case happens and before the user leave the program try to insert new rows. Let me know if this solution is good for you.
Regards
2010 May 15 10:01 AM
Hi,
When one user is changing an entry in the table, then for the subsequent users the New entries screen opens in the Display mode. Is it a function module which does the locking of the table when creating new entries, if yes, then how do we unlock the table(by changing the parameters passed to the function module)?
My program also works for 'copy from' option to create new entries..but it doesn't work when the subsequent user clicks on 'New entries' button(screen opens in dispay mode).
Thanks,
Sirisha
2010 May 18 7:36 AM
2010 May 18 9:19 AM
Hi sirisha,
Can you please post the solution.
once issue gets resolve, Please try to give the soultion.
thanks
Vinod
2010 Jun 01 10:16 AM
Hi All,
Sorry for not posting the reply earlier, was busy that time but I had a reminder in my mind to post the solution.
Please check SAPTechnical to achieve row level locking of database table. I have made a little modification in the code in PBO module. ( IF sy-ucomm NE 'NEWL' then open screen in Display mode.)
MODULE m_change_locking OUTPUT.
*Call the function module corresponding to the lock object we created
CALL FUNCTION 'ENQUEUE_EZTEST_SHUKS3'
EXPORTING
matnr = ztest_shuks3-matnr
werks = ztest_shuks3-werks
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc NE 0.
IF sy-ucomm NE 'NEWL'.
row is locked..hence gray..
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDIF.
ENDMODULE. " m_change_locking OUTPUT
Regards,
Sirisha
2011 Jun 21 3:50 PM
Thanks a lot for the excellent solution , As i was also getting the same issue and was trying hard to resolve the issue .
Thanks alot .
2011 Jun 23 5:44 AM
Hi Sirisha ,
I have developed a row level locking and as per solution which you have provided , its working for new entreis also .
Now i ahve a requirement to display each row details in another screen .To acheive this i have created another screen .
But the here is even the locked row will be editable in the second screen . My requirement is locked row in first screen should be greyout in the second screen .
Appreciate your help and support .
Thanks,
NJ