06-05-2017 1:13 PM
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
06-05-2017 1:13 PM
06-05-2017 1:34 PM
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.
06-07-2017 6:05 AM
Hi,
i used standard lock object to lock the PR and the issue is solved.
rg
06-07-2017 6:55 AM
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.