Application Development 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: 

Lock entry with Bapi BAPI_GOODSMVT_CREATE

FredericGirod
Active Contributor
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use functiom module DEQUEUE_ALL.

9 REPLIES 9

Former Member
0 Kudos

Hi,

You would be calling BAPI_TRANSACTION_COMMIT which should ideally release the locks.

Regards

Ravi

0 Kudos

I don't want to commit the transaction, because I run the function in test mode.

(not all the times)

Fred

Former Member
0 Kudos

use functiom module DEQUEUE_ALL.

0 Kudos

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

0 Kudos

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

0 Kudos

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 ?

0 Kudos

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

0 Kudos

Thanks for all your answers.

Have a nice day

Fred

Former Member
0 Kudos

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).