‎2007 Feb 14 3:33 PM
Hi all,
Please help.
My program logic is as follows:
(1) enqueue pernr
(2) update infotypes for the pernr
(3) dequeue pernr
(4) commit work and clear buffer
(5) enqueue pernr
(6) additional logic
(7) dequeue pernr
(8) commit work and clear buffer
I have to perform to commit due to certain design requirements.
When i am performing the ENQUEUE action again at (5), i will get an error that the pernr cannot be locked. This error is not consistent, sometimes it happens, sometimes it doesn't.
Can anyone help me on this?
Regards,
Ming
‎2007 Feb 14 3:34 PM
Please try a COMMIT WORK AND WAIT. With a COMMIT WORK, the program will continue to be executed even though the commit may not of finished.
Also try putting it into debug mode and check SM12 for the table locks to see if they have been removed.
‎2007 Feb 14 3:36 PM
A lot of times there is a delay in the lock being released and how fast the program is running. This is what I typically do for the second enqeue. Put a do loop around it:
do x times.
enqueue pernr.
if sy-subrc = 0.
exit.
endif
enddo.
You can experiment with the number of times. Just set this so you don't end up in an endless loop.
Chris H.
‎2007 Feb 14 3:43 PM