← Back to Cases
AP Invoice Distributions Stuck on PO-Matched Invoice
Case Number00030090
Oracle ModuleAccounts Payable (AP) / Purchasing (PO)
EBS VersionR12
Functional AreaInvoice Processing / PO Matching
Related PatchesNone

Symptoms

Root Cause

The AP invoice distributions for the affected invoice became orphaned or stuck due to a failed accounting or matching event. The PO distribution tables (PO_DISTRIBUTIONS_ALL, PO_LINE_LOCATIONS_ALL) retained non-zero quantity_billed and amount_billed values even though the corresponding AP distributions were in an inconsistent state. Additionally, charge allocation (AP_CHRG_ALLOCATIONS_ALL) and multi-currency distribution (AP_MC_INVOICE_DISTS) records were orphaned.

Resolution

Step 1 – Identify affected records

Verify the affected invoice ID and PO distribution/line location IDs by querying AP_INVOICE_DISTRIBUTIONS_ALL and PO_DISTRIBUTIONS_ALL.

Step 2 – Create backup tables

Run data_fix.sql — the script begins by creating backup tables for all rows that will be modified or deleted:

Step 3 – Reset PO billed quantities and amounts

Update PO_DISTRIBUTIONS_ALL and PO_LINE_LOCATIONS_ALL to zero out quantity_billed and amount_billed for the affected PO distribution and line location.

Step 4 – Delete AP distributions and related records

Delete records in the following order to avoid foreign key violations:

  1. Delete from AP_MC_INVOICE_DISTS for the affected invoice.
  2. Delete from AP_CHRG_ALLOCATIONS_ALL for charge allocations linked to the affected invoice distributions.
  3. Delete from AP_INVOICE_DISTRIBUTIONS_ALL for the affected invoice.
Step 5 – Commit and validate

Issue COMMIT. Verify that the invoice no longer shows distributions and the PO billed quantities are cleared.

Note: After this fix the invoice can be re-processed through standard AP validation and matching workflows. Ensure the PO is in the correct status before re-matching.

Script Inventory

FileDescription
data_fix.sqlCreates backup tables, resets PO billed quantities, deletes orphaned AP charge allocations, multi-currency distributions, and invoice distributions. Issues COMMIT.

Key Tables Affected

TableAction
PO_DISTRIBUTIONS_ALLUpdate quantity_billed, amount_billed to 0
PO_LINE_LOCATIONS_ALLUpdate quantity_billed, amount_billed to 0
AP_MC_INVOICE_DISTSDelete for affected invoice
AP_CHRG_ALLOCATIONS_ALLDelete for affected invoice distributions
AP_INVOICE_DISTRIBUTIONS_ALLDelete for affected invoice