← Back to Cases
AP Invoice Missing Cancellation Accounting Event
Case Number00030515
Oracle ModuleAccounts Payable (AP)
EBS VersionR12
Functional AreaInvoice Cancellation / Accounting Events
Related PatchesNone

Symptoms

Root Cause

During invoice cancellation processing, the INVOICE CANCELLATION event was not inserted into AP_ACCOUNTING_EVENTS_ALL. As a result the corresponding invoice distribution was not linked to a cancellation event and the accounting date/period was not set. This is typically caused by an interruption or error during the cancellation concurrent request.

Resolution

Step 1 – Create backup tables

Run data_fix.sql. The script first backs up the affected rows:

Step 2 – Update AP_INVOICES_ALL for cancellation

Stamp the cancelled_date, cancelled_amount, and clear temp_cancelled_amount on AP_INVOICES_ALL to reflect the correct cancellation state. Issue COMMIT.

Step 3 – Insert missing INVOICE CANCELLATION event

Insert a new row into AP_ACCOUNTING_EVENTS_ALL with:

Issue COMMIT. Validate with:

SELECT accounting_event_id
  FROM ap_accounting_events_all
 WHERE event_type_code = 'INVOICE CANCELLATION'
   AND source_table = 'AP_INVOICES'
   AND source_id = <invoice_id>;
-- Should return exactly one (1) record
Step 4 – Link distribution to cancellation event

Update AP_INVOICE_DISTRIBUTIONS_ALL to set the new accounting_event_id, accounting_date, and period_name for the affected distribution. Issue COMMIT.

Note: After this fix the invoice can be submitted to Create Accounting to generate the formal subledger accounting entries for the cancellation.

Script Inventory

FileDescription
data_fix.sqlBacks up invoice and distribution rows, updates AP_INVOICES_ALL cancellation columns, inserts the missing INVOICE CANCELLATION event into AP_ACCOUNTING_EVENTS_ALL, and links the distribution to the new event.

Key Tables Affected

TableAction
AP_INVOICES_ALLUpdate cancelled_date, cancelled_amount, temp_cancelled_amount
AP_ACCOUNTING_EVENTS_ALLInsert missing INVOICE CANCELLATION event
AP_INVOICE_DISTRIBUTIONS_ALLUpdate accounting_event_id, accounting_date, period_name