Application Development and Automation 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: 
Read only

Lock entry with Bapi BAPI_GOODSMVT_CREATE

FredericGirod
Active Contributor
0 Likes
1,889

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
Read only

Former Member
0 Likes
1,305

use functiom module DEQUEUE_ALL.

9 REPLIES 9
Read only

Former Member
0 Likes
1,305

Hi,

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

Regards

Ravi

Read only

0 Likes
1,305

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

(not all the times)

Fred

Read only

Former Member
0 Likes
1,306

use functiom module DEQUEUE_ALL.

Read only

0 Likes
1,305

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

Read only

0 Likes
1,305

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

Read only

0 Likes
1,305

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 ?

Read only

0 Likes
1,305

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

Read only

0 Likes
1,305

Thanks for all your answers.

Have a nice day

Fred

Read only

Former Member
0 Likes
1,305

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