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: 

issue with BAPI_REQUISITION_DELETE

Former Member
0 Kudos

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

Former Member
0 Kudos

please suggest how to overcome this error

Former Member

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.

Former Member
0 Kudos

Hi,

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

rg

Sandra_Rossi
Active Contributor
0 Kudos

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.