← Back to Cases
AP Invoice Batch Deletion — Remove Invoice, Tax Lines, Holds, and Batch Record
Case Number00171076
Oracle ModuleAccounts Payable (AP) / eBusiness Tax (ZX)
EBS VersionR12
Functional AreaInvoice Processing / Invoice Batches / Tax Lines / Invoice Holds
Related PatchesNone

Symptoms

Root Cause

An AP invoice and its associated invoice batch were incorrectly created, leaving orphaned or invalid records across the AP, ZX, and AP batch tables. The invoice cannot be processed or voided through the UI. A complete data-level deletion of the invoice record, its distributions, holds, tax lines, payment schedule, and the associated batch record is required to remove the erroneous data from the system.

Resolution

Step 1 – Create backup tables

Run data_fix.txt. Backup tables are created for:

Step 2 – Delete associated records

Delete records from the affected tables in the following order (child records before parent records to satisfy referential integrity):

  1. Delete from AP_HOLDS_ALL for the affected invoice.
  2. Delete from ZX_LINES_SUMMARY for the affected tax summary line.
  3. Delete from ZX_LINES for the affected tax line.
  4. Delete from AP_INVOICE_DISTRIBUTIONS_ALL for the affected invoice.
  5. Delete from AP_PAYMENT_SCHEDULES_ALL for the affected invoice.
  6. Delete from AP_INVOICES_ALL for the affected invoice.
  7. Delete from AP_BATCHES_ALL for the affected batch.
Step 3 – Commit and validate

Commit. Verify the invoice and batch no longer appear in the AP module.

Note: This fix script is delivered as a .txt file containing a partial action plan. The deletion step was not fully completed in the documented fix file — the order of deletions above is inferred from the backup tables created. Verify the correct deletion order and child/parent dependencies before executing in production. If the invoice has XLA accounting events, those must also be cleaned up before or after the AP record deletion.

Script Inventory

FileDescription
data_fix.txtPartial action plan (fix file is incomplete). Documents backup creation for AP_HOLDS_ALL, AP_PAYMENT_SCHEDULES_ALL, ZX_LINES_SUMMARY, ZX_LINES, AP_INVOICE_DISTRIBUTIONS_ALL, AP_INVOICES_ALL, and AP_BATCHES_ALL. Deletion step text is truncated.

Key Tables Affected

TableAction
AP_HOLDS_ALLDelete holds for the affected invoice
AP_PAYMENT_SCHEDULES_ALLDelete payment schedule for the affected invoice
AP_INVOICE_DISTRIBUTIONS_ALLDelete distributions for the affected invoice
AP_INVOICES_ALLDelete the affected invoice record
ZX_LINES_SUMMARYDelete tax summary line
ZX_LINESDelete tax line
AP_BATCHES_ALLDelete the associated invoice batch record