‎2011 Dec 06 4:24 PM
Hello,
I use a BAPI : BAPI_PO_CREATE1 in my program of data recovery. I have a csv file with 3 POs... The data is the same, N° of PO is different.
When I want launch the BAPI 2 ou 3 times (in LOOP), the first time it's ok, i've got a PO created. The second time I have a problem in a ACCOUNT table... The data is good, because I tested I separetely.
What can cause a problem?
Thanks beforehand,
Veronica
‎2011 Dec 06 7:09 PM
Hi,
Are you using BAPI_TRANSACTION_COMMIT after BAPI_PO_CREATE1.
Because i think problem is with the locking of Table so first try to use BAPI_TRANSACTION_COMMIT with wait.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.If after this also you aren't get rid from this try to use FM "DEQUEUE_ALL".
BR,
Vijay
‎2011 Dec 07 4:51 AM
Hi Veronica,
As you mentioned that the problem starts with the second PO, the problem might be with clearing the internal tables (header & line item) passed in the second loop.
You need to ensure that all the variables used, work areas and internal tables are cleared before the second loop pass. Also, if you are using internal tables with header lines, then you need to ensure the clearing of header lines also.
Verify this in debugging. If the problem still persists, post your code as I've been using 'BAPI_PO_CREATE1' without any problems for quite sometime.
Regards,
Pranav.