04-24-2006 8:33 AM
Hi,
I have created a program with an ALV grid, when a user select a line and press a button that will call the function BAPI_GOODSMVT_CREATE.
The problem is, each time I call the BAPI, there was lock entry created. And this lock entry is only release when the users leave the program.
There is a way to release all the lock entry after the end of the function ?
Or maybe, other solution, is too call in background task the function ?
any idea?
Rgd
Frédéric
04-24-2006 8:39 AM
04-24-2006 8:38 AM
Hi,
You would be calling BAPI_TRANSACTION_COMMIT which should ideally release the locks.
Regards
Ravi
04-24-2006 8:45 AM
I don't want to commit the transaction, because I run the function in test mode.
(not all the times)
Fred
04-24-2006 8:39 AM
04-24-2006 8:47 AM
Maybe a good idea ..
I will check, but I'm not sure about the impact of dequeue ALL the lock entry (cause my users could play with a lot of entry ... )
Thanks
04-24-2006 8:52 AM
If you are using it in TEST MODE swtich on the flag TESTRUN of the BAPI and after that even if you COMMIT the changes will NOT be there in the DATABASE.
Then the locks will be released and changes are also NOT committed to DB if you have the TESTRUN flag on.
Its not recommended that you unlock the locks manually.
Regards,
Ravi
04-24-2006 9:05 AM
I have played with the TESTRUN option, but, for me, it's a logical problem to use a function to commit change when I use the test mode.
And maybe, what about using the function BAPI_TRANSACTION_ROLLBACK ?
04-24-2006 9:07 AM
BAPI_TRANSACTION_ROLLBACK also should release the locks, how ever you need to be careful to see that the changes that you do want to save are NOT lost.
regards,
Ravi
04-24-2006 9:15 AM
04-24-2006 9:31 AM
if user selects only one entry and makes changes maybe u can use ENQUEUE_READ, then pass those entries to specific DEQUEUE_(locks with respect to Goods movement).