| Case Number | 00030933 |
| Oracle Module | Accounts Payable (AP) / eBusiness Tax (ZX) |
| EBS Version | R12 |
| Functional Area | Invoice Validation / Tax Processing / Holds |
| Related Patches | None |
discarded_flag/cancelled_flag values that prevent validation from succeeding.A failed or partial accounting run created an orphaned XLA event linked to specific AP invoice distributions. The associated ZX tax records (ZX_REC_NREC_DIST, ZX_LINES, ZX_LINES_SUMMARY, ZX_LINES_DET_FACTORS) and AP invoice lines/distributions retained stale data from the failed event. The line-level amount mismatches caused repeated DIST VARIANCE and LINE VARIANCE holds on validation. The fix removes the orphaned event and tax data, corrects line amounts, and releases the holds.
Query to identify the orphaned accounting event and affected distributions:
SELECT aid.invoice_id, aid.accounting_event_id, aid.invoice_distribution_id
FROM ap_invoice_distributions_all aid
WHERE aid.accounting_event_id = <event_id>
UNION
SELECT ah.invoice_id, ah.hold_lookup_code, ah.status_flag
FROM ap_holds_all ah
WHERE ah.invoice_id = <invoice_id>
AND ah.hold_lookup_code IN ('DIST VARIANCE','LINE VARIANCE')
AND NVL(ah.status_flag,'x') <> 'R';
Run data_fix.sql. The following backup tables are created automatically:
rsi_xla_events_<case>, rsi_ap_dist_<case>, rsi_ap_lines_<case>rsi_zx_rec_nrec_<case>, rsi_zx_lines_<case>, rsi_zx_line_sum_<case>, rsi_zx_det_fact_<case>rsi_ap_holds_<case>Delete the orphaned row from XLA_EVENTS by the affected event ID.
Delete in order: ZX_REC_NREC_DIST → ZX_LINES → ZX_LINES_SUMMARY → ZX_LINES_DET_FACTORS, filtering on the affected invoice and event combination.
Delete from AP_INVOICE_DISTRIBUTIONS_ALL for the orphaned accounting event. Delete from AP_INVOICE_LINES_ALL for the affected line numbers.
Update AP_INVOICE_LINES_ALL to set correct amounts and clear discarded_flag/cancelled_flag for remaining lines.
Update AP_HOLDS_ALL to set release_lookup_code = 'VARIANCE OVERRIDE' and status_flag = 'R' for all DIST VARIANCE and LINE VARIANCE holds on the affected invoice.
Issue COMMIT. Re-run AP Invoice Validation to confirm the invoice passes without holds.
| File | Description |
|---|---|
| data_fix.sql | Creates backup tables; deletes orphaned XLA event, ZX tax records, AP distributions, and invoice lines; corrects line amounts and flags; releases DIST VARIANCE and LINE VARIANCE holds. |
| Table | Action |
|---|---|
| XLA_EVENTS | Delete orphaned event |
| ZX_REC_NREC_DIST | Delete orphaned records |
| ZX_LINES | Delete orphaned records |
| ZX_LINES_SUMMARY | Delete orphaned records |
| ZX_LINES_DET_FACTORS | Delete orphaned records |
| AP_INVOICE_DISTRIBUTIONS_ALL | Delete for orphaned event |
| AP_INVOICE_LINES_ALL | Delete affected lines; correct amounts and flags |
| AP_HOLDS_ALL | Release DIST VARIANCE and LINE VARIANCE holds |