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

Issue on Commit work

Former Member
0 Likes
1,235

Hi Friends ,

I am calling function module where I have created Background Job and Submitted it . In Submit call I am updating the database table . In a LOOP am updating service entry sheets of one Purchase order . (1 PO consists of More than 1 Service entry sheets)

Here I am able to update only First SES when it is processing the Second Service Entry sheet the PO get Locked.

I have used the COMMIT and WAIT command after the updating the Service entry sheet.

Here I am getting PO LOCK error by Same USER.

Can u suggest me in this Scenario.

Thanks in advance.

Jagadeshwar.G

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,138

hi ,

i also had the alike issue.

i resolved it using this code

syntax:

wait up to 2 seconds.

commitwork.

thanks & regards,

kat

9 REPLIES 9
Read only

Former Member
0 Likes
1,138

Hello,

Try using Lock object (Enqueue and Dequeue) while updating the database table.

Regards,

Jacky.

Read only

Former Member
0 Likes
1,138

Hi,

Enqueue the Purchase order before updating the Purchase order and after updating the Purchase order Dequeue the Purchase order.

Read only

0 Likes
1,138

Hi Ja,

try to use parameter WAIT = 'X' when you calling the BAPI_COMMIT_WORK FM.

regards,

Rama

Read only

Former Member
0 Likes
1,138

Use the BAPi - BAPI_PO_CHANGE to change the PO & BAPI_TRANSACTION_COMMIT to commit work.

Read only

Former Member
0 Likes
1,138

The Actual Message User is getting is 'Purchase order is processing XX user' .

Thanks in advance.

Read only

0 Likes
1,138

Hi, put wait in the commit and after the commit bapi, use the dequeue inside the loop. Hope this helps.

Best Regards,

Benedict

Read only

0 Likes
1,138

pl. paste the BAPI code how your are writing .

regards,

Rama

Read only

Former Member
0 Likes
1,139

hi ,

i also had the alike issue.

i resolved it using this code

syntax:

wait up to 2 seconds.

commitwork.

thanks & regards,

kat

Read only

0 Likes
1,138

Thanks for information .

Even i have coded as follows .

ITAB records as follows

S1 - Servcice Sheet

P1 PO

X - other flds

S1 P1 X X X

S2 P1 X X X

S3 p1 X X X

Loop at ITAB to WA.

UPDATE <ZTABLE> with .......

commit work and wait.

.............

...........

ENDLOOP.

Error Message : PO is already in process by XXXX.

- This program runs in Background .My problem is I can't test this prg in dev .

Could you please explain the situation u faced so that i can validate it . Thx in advance.

Thx