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

BAPI_PO_CREATE1 problem

Former Member
0 Likes
448

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

2 REPLIES 2
Read only

Former Member
0 Likes
364

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

Read only

former_member222709
Contributor
0 Likes
364

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.