Skip to Content
0
Oct 29, 2019 at 08:31 AM

IDOC: Error in BAPI_PO_CHANGE "Vendor blocked" after XK05

180 Views Last edit Oct 30, 2019 at 09:05 AM 2 rev

Hello experts,

I'm facing an issue in IDOC processing with BAPI_PO_CHANGE.

Let me provide some context. We have an ECC6 inbound interface that is receiving ORDERS05 type Idocs. These contain data for purchase orders. Business requirement is to check "Final invoice" flag for existing items in those PO.

However, standard SAP behavior won't allow any changes if vendor in PO is blocked (LFA1-SPERM or LFM1-SPERM). In order to avoid this problem, we put in place the following solution (as recommended in OSS note 2512364):

1. Remove all vendor block flags ==> Via CALL TRANSACTION "XK05"

2. Wait for 3 seconds

3. Call BAPI_PO_CHANGE

4. Restore vendor block flags ==> Via CALL TRANSACTION "XK05"

2 problems arise:

- BAPI_PO_CHANGE (step 3) will throw an error stating that vendor is blocked, despite the fact that change documents for vendor (step 1) show that vendor was successfully unblocked

- The above error is not systematic, it seems to be triggered on a random basis when receiving multiple Idocs simultaneously (in our last run 150 idocs failed out of 600). Idocs concern multiple vendors. Furthermore, failed Idocs will be processed successfully when run manually at a later time through BD87.

Any ideas as to why BAPI_PO_CHANGE will still think vendor is blocked?

We have even tried putting in place a solution to logically lock vendors that are being currently processed by an active Idoc in order to avoid multiple Idocs working on the same vendor at the same time.

Right now we're tracking the possibility of XK05 program buffer interfering with BAPI_PO_CHANGE...

Thank you in advance for your help.

Regards,

Daniel