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: 

Error when updating PO and Inbound Delivery

Former Member
0 Kudos

Hi,

I am facing an error in one of my programs where I am making updates to a PO and its Inbound Delivery.

I am processing multiple POs, the details of which are read from a text file.

These PO's are processed in a loop, and for each PO, the 'BAPI_PO_CHANGE' is first called and then

I am using BDC over transaction 'VL32' to update the Inbound Delivery.

However, when I try to process multiple PO's, it gets stuck when updating the Inbound Delivery of the second PO

itself. When the BDC for updating the inbound delivery is called, I get an error message informing that the 'PO' is

still being processed.

I am not sure why this error is occurring because I am calling the 'BAPI_TRANSACTION_COMMIT' after updating the PO.

Any suggestions for solving this would be a great help.

Regards,

Sudeep

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I tried the Enque method suggest above to check for the locks. But that too is not working.

I still get the same error. I was making this check after calling the 'BAPI_TRANSACTION_COMMIT'

The problem is that I need to update each PO only if the Inbound Delivery is updated successfully.

Hence, I need to update the PO's one by one.

Regards,

Sudeep

4 REPLIES 4

Former Member
0 Kudos

Hi,

I think, this is due to locking of Purchase order while you process the inbound delivery of the same PO. I suggest you update all the Purcahse orders in one go and then proceed for updation of Inbound deliveries.

Regards

Vinod

SimoneMilesi
Active Contributor
0 Kudos

This because the locks aren't already deleted.

After the "BAPI_TRANSACTION_COMMIT", try this code



do.
 CALL FUNCTION 'ENQUEUE_READ'
   EXPORTING
     gclient = sy-mandt
     guname  = '*'
     gname   = 'EKKO'
     garg    = garg                     "YOUR PURCHASE ORDER
   IMPORTING
     subrc   = vn_subrc
   TABLES
     enq     = tb_enq
   EXCEPTIONS
     OTHERS  = 1.
if tb_enq[] is initial.
    exit.
endif.
enddo.

In this way, you avoid locks and you can process the Inbound delivery

Edited by: Simone Milesi on May 5, 2010 10:38 AM

Former Member
0 Kudos

Hi,

I tried the Enque method suggest above to check for the locks. But that too is not working.

I still get the same error. I was making this check after calling the 'BAPI_TRANSACTION_COMMIT'

The problem is that I need to update each PO only if the Inbound Delivery is updated successfully.

Hence, I need to update the PO's one by one.

Regards,

Sudeep

0 Kudos

Hi,

Try this piece of code. After calling Purchase order change BAPI

call function 'BAPI_TRANSACTION_COMMIT'
        exporting
          wait   = 'X'
        importing
          return = lt_return.

if lt_return is not initial.
  error in Calling PO Bapi.
else.
 Proceed with Inbound delivery BAPI.
endif.

Regards

Vinod