05-05-2010 9:28 AM
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
05-05-2010 10:11 AM
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
05-05-2010 9:34 AM
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
05-05-2010 9:38 AM
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
05-05-2010 10:11 AM
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
05-05-2010 10:19 AM
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