| Case Number | 00164579 |
| Oracle Module | Accounts Payable (AP) / Subledger Accounting (XLA) |
| EBS Version | R12 |
| Functional Area | Invoice Processing / Accounting Events |
| Related Patches | None |
accounting_event_id.The accounting_event_id was not populated on one or more AP_INVOICE_DISTRIBUTIONS_ALL rows for the affected invoice during the normal validation process. Without an event ID, AP_ACCOUNTING_EVENTS_PKG.Create_Events cannot link distributions to an XLA event, and Create Accounting has no event to process. The fix allocates a new event ID from the XLA_EVENTS_S sequence, stamps it onto the affected distributions, and then calls AP_ACCOUNTING_EVENTS_PKG.Create_Events to generate the missing invoice accounting event.
Use the following query to identify AP invoice distributions with a missing accounting event ID:
SELECT * FROM ap_invoice_distributions_all WHERE invoice_id = &Invoice_ID AND accounting_event_id IS NULL;
Run data_fix.sql. A backup of the affected AP_INVOICE_DISTRIBUTIONS_ALL rows (those with accounting_event_id IS NULL) is created.
Call MO_GLOBAL.SET_POLICY_CONTEXT('S', <org_id>) to establish the correct operating unit context for the affected invoice.
Select xla_event_s.nextval to obtain a new accounting event ID that will be used to link the distributions to the new XLA event.
Update AP_INVOICE_DISTRIBUTIONS_ALL.accounting_event_id to the newly allocated event ID for all distributions on the affected invoice where accounting_event_id IS NULL. Commit.
Call AP_ACCOUNTING_EVENTS_PKG.Create_Events with event type 'INVOICES', passing the invoice ID and the new event ID. This creates the XLA event record and links it to the stamped distributions. Commit after the call.
Re-run the Create Accounting process for the affected invoice to generate the XLA accounting entries and transfer to GL.
accounting_event_id. For cases involving multiple invoices or invoices with payment or cancellation events also missing, see case 00088818 which uses the full Oracle GDF framework with driver tables for batch processing across invoices, payments, and prepayments.
| File | Description |
|---|---|
| data_fix.sql | PL/SQL anonymous block. Creates backup of affected AP_INVOICE_DISTRIBUTIONS_ALL rows; sets MO_GLOBAL org context; allocates xla_event_s.nextval; updates accounting_event_id on distributions with NULL event ID; calls AP_ACCOUNTING_EVENTS_PKG.Create_Events to generate the missing INVOICES accounting event. |
| Table | Action |
|---|---|
| AP_INVOICE_DISTRIBUTIONS_ALL | Update accounting_event_id from NULL to new xla_event_s.nextval |
| XLA_EVENTS | New event record created by AP_ACCOUNTING_EVENTS_PKG.Create_Events |