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

Problem using BAPI_REQUISITION_RESET_REL_GEN

Former Member
0 Likes
1,269

Hello Experts,

I need to close the PR ( Purchase requisition closed EBAKZ ) programatically. Firstly i am unreleasing PR and changing , because of using BAPI_REQUISITION_RESET_REL_GEN to unrelease , i am not able to change and giving an error message PR is already processing by user(myself) . The lock is not being released after using commit too. So i am not able to change. Please help me out, if there is any work around in resolvong the problem

Thanks in Advance

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
0 Likes
824

The error occurs during the 2nd function module (BAPI...CHANGE), right?

This is probably because the update of the first one is still going on, as it is generally done using update tasks which are asynchronous, and the locks are retained until the end of the update task.

So you have to wait for the end of the update task by calling function module BAPI_TRANSACTION_COMMIT with WAIT = 'X' (it's like COMMIT WORK AND WAIT but prefer to use this function module as it may contain "buffer refresh" processing)

Read only

0 Likes
824

I have followed what you have said. I am used transaction commit with wait option. but stil the locks are been therel

Read only

0 Likes
824

Okay so maybe it's an asynchronous task, is there some workflow?

A good option to see where the problem comes from: trace the locks using ST05 transaction. You will be able to see what program and in which line the locks are done (there is a button to display the source). Note that you have the possibility to see in the trace the result of each lock via the return code: 0 means successful, other (4) means failure.