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: 

Locks when I try to do two entrysheet in the same call.

Former Member
0 Kudos

Hi

I call a FM for creating a entrysheet (BAPI_ENTRYSHEET_CREATE). I have to make them at purchase order item level. So I call the BAPI once each item.

With the first call, it works perfectly. But in the second when I execute I get the error "user xxxx already processing purchase order"

I have tried with

1.- BAPI TRANSACTIONCOMMIT

2.- COMMIT & WORK

3.- DEQUEUE (EMEKKOS, EMEKKOE, EMEKPOE)

I have traced and only appear these locks and some blocks about budget (could be those locks)

I only can see it trying with a WAIT sentence.

Does anybody know how I can avoid that lock situation??

Thanks again

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You have add this following code before the BAPI call.

SET UPDATE TASK LOCAL.

Hope this will help you

Bala

Note: Award points if helpful

3 REPLIES 3

Former Member
0 Kudos

Hi

You have add this following code before the BAPI call.

SET UPDATE TASK LOCAL.

Hope this will help you

Bala

Note: Award points if helpful

sridhar_k1
Active Contributor
0 Kudos

Since you are calling the BAPI in the same program again, the locks are still there after first BAPI_ENTRYSHEET_CREATE, do a DEQUEUE_ALL after BAPI TRANSACTIONCOMMIT.

Regards

Sridhar

Former Member
0 Kudos

Hi,

thankyou very much indeed

I have tried both of DEQUEUE_ALL (also ENQUEUE_DELETE) and the SET UPDATE TASK LOCAL.

In my case the last one solved the problem

Thanks again

King Regards