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 with BAPI_REQUISITION_DELETE

Former Member
0 Likes
2,226

Hi Experts,

I am using BAPI_REQUISITION_DELETE to delete a complete purchase requistion . issue is I am able to delete only the first line item when it comes to deletion of second line item its throwing an error as PURCHASE REQ locked with my id itself.

I am using a loop and passing line item numnber for that PR and a commit work.

thanks,

rg

4 REPLIES 4
Read only

Former Member
0 Likes
1,562

please suggest how to overcome this error

Read only

Former Member
1,562

Hi,

Can u show the code.I think

BAPI_REQUISITION_DELETE will take all line items to be deleted for a PR in a table using Tables parameter.

So no need to loop for single line item.

Regards,

krishna.

Read only

Former Member
0 Likes
1,562

Hi,

i used standard lock object to lock the PR and the issue is solved.

rg

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,562

If the BAPI uses an update task (usually an asynchronous process triggered at commit work), then the lock may be transmitted there, and is retained until the end of the asynchronous update task, so it may still be there when the BAPI is called again.

You may use either commit work AND WAIT, or deactivate the update task (SET UPDATE TASK LOCAL) to execute the updates synchronously.

And, of course, Krishna's answer is correct too.