| Case Number | 00043404 |
| Oracle Module | Accounts Payable (AP) / Subledger Accounting (XLA) |
| EBS Version | R12 |
| Functional Area | AP Invoices / Payments / Accounting Events / Exchange Rates / XLA Transaction Entities |
| Related Patches | Oracle Bug 8529957; Oracle Bug 8531305; Oracle Bug 17941503; Oracle Bug 9651687 |
XLA_EVENTS.event_date, causing period mismatches in the GL.entity_id rows exist in XLA_TRANSACTION_ENTITIES for the same AP transaction, causing XLA accounting errors or duplicate journal entries.amount_paid or payment_status_flag values requiring manual correction.This case applies seven separate scripts addressing four Oracle-released GDF bugs plus three client-specific one-off data corrections:
XLA_EVENTS.event_date. The fix updates the AP-side date columns to match XLA.ap_utilities_pkg.get_exchange_rate and gl_currency_api.convert_amount_sql to derive and populate missing rates, and calls AP_ACCTG_DATA_FIX_PKG.undo_acctg_entries to undo any incorrectly-accounted maturity events before re-populating.entity_id values exist in XLA_TRANSACTION_ENTITIES (and XLA_TRANSACTION_ENTITIES_UPG) for the same AP transaction. The fix reassigns all XLA events, AE headers, and distribution links to the minimum (surviving) entity ID and marks retired duplicate entities as entity_code = 'MANUAL'.amount_paid and payment_status_flag on AP_INVOICES_ALL for specified invoices.XLA_EVENTS, XLA_AE_HEADERS, AP_PAYMENT_HISTORY_ALL, and AP_INVOICE_PAYMENTS_ALL.Populate AP_TEMP_DATA_DRIVER_8529957 with the invoice_id or check_id and associated entity type (AP_INVOICES or AP_PAYMENTS) for all unaccounted transactions in closed periods. Optionally set sweep_to_date to override the target period start date.
start_date of the next open or future-entry GL period relative to the current accounting date.accounting_date on AP_INVOICE_DISTRIBUTIONS_ALL, AP_SELF_ASSESSED_TAX_DIST_ALL, AP_PREPAY_HISTORY_ALL, and ZX_REC_NREC_DIST to the target period start date.accounting_date on AP_INVOICE_DISTRIBUTIONS_ALL (AWT distributions), AP_INVOICE_PAYMENTS_ALL, and AP_PAYMENT_HISTORY_ALL.XLA_EVENTS.event_date to the same target date for both entity types.Populate AP_TEMP_DATA_DRIVER_8531305 with the event IDs for all transactions where AP accounting dates differ from XLA_EVENTS.event_date.
XLA_EVENTS.event_date.accounting_date on AP_INVOICE_DISTRIBUTIONS_ALL to match the XLA event date.accounting_date on AP_SELF_ASSESSED_TAX_DIST_ALL, ZX_REC_NREC_DIST, AP_INVOICE_PAYMENTS_ALL, AP_PAYMENT_HISTORY_ALL, and AP_PREPAY_HISTORY_ALL as applicable for the event type.Populate AP_TEMP_DATA_DRIVER_17941503 with the affected check_id values and the event types that are missing exchange rates (PAYMENT CREATED, PAYMENT MATURITY, PAYMENT CLEARING). Identify whether each payment is FOREIGN (foreign currency, domestic bank) or INTERNATIONAL (foreign bank account) using AP_RECONCILIATION_PKG.Case_Type.
AP_ACCTG_DATA_FIX_PKG.undo_acctg_entries to undo those accounting entries before applying the rate correction.ap_utilities_pkg.get_exchange_rate for the applicable exchange rate type and date.base_amount using gl_currency_api.convert_amount_sql.AP_CHECKS_ALL: sets exchange_rate, base_amount, and (for maturity events) maturity_exchange_rate and maturity_base_amount.AP_INVOICE_PAYMENTS_ALL: sets exchange_rate and payment_base_amount for affected payment rows.AP_PAYMENT_HISTORY_ALL: sets exchange_rate and pmt_to_base_xrate for PAYMENT CREATED, MATURITY, and CLEARING history rows.bank_to_base_xrate, cleared_base_amount) as appropriate for CLEARING events.Populate XTE_MULTIPLE_9651687 with the duplicate entity_id pairs — for each AP transaction that has multiple entity rows in XLA_TRANSACTION_ENTITIES, record the min_entity_id (surviving) and the duplicate entity IDs to be retired. Uses XLA_GLOBAL_DATA_FIX_PKG framework.
event_count = 0: sets entity_code = 'MANUAL' on XLA_TRANSACTION_ENTITIES and XLA_TRANSACTION_ENTITIES_UPG — effectively retiring the empty duplicate.XLA_EVENTS from the duplicate entity ID to the min_entity_id (surviving entity).XLA_AE_HEADERS from the duplicate entity ID to the min_entity_id.XLA_DISTRIBUTION_LINKS.applied_to_entity_id from the duplicate to the surviving entity ID.entity_code = 'MANUAL' on the now-empty duplicate entity row.Both scripts use the same template. For a specified invoice_id and trackit reference number:
XX_CUSTOM_AP_INV_DRIVER_<trackit> with the current AP_INVOICES_ALL row for the specified invoice.AP_INVOICES_ALL: sets amount_paid and payment_status_flag to the correct values for the specified invoice.AP_PAYMENT_HISTORY_ALL, AP_INVOICE_PAYMENTS_ALL, XLA_EVENTS, and XLA_AE_HEADERS for the 27 affected check and entity IDs.XLA_EVENTS: sets event_status_code = 'P' (Processed) and process_status_code = 'P' for the affected event IDs.XLA_AE_HEADERS: sets gl_transfer_status_code = 'Y' (transferred to GL) for the affected AE header IDs.AP_PAYMENT_HISTORY_ALL: sets posted_flag = 'Y' for the affected check IDs.AP_INVOICE_PAYMENTS_ALL: sets posted_flag = 'Y', accrual_posted_flag = 'Y', and cash_posted_flag = 'Y' for payments associated with the affected check IDs.XX_CUSTOM_. Script 06 targets a hardcoded list of 27 check IDs and entity IDs specific to this case engagement. All scripts use AP_ACCTG_DATA_FIX_PKG for HTML log output, backup management, and optional email delivery of logs. Always take a full database backup and verify driver table contents before executing any GDF script.
| File | Description |
|---|---|
| 01_ap_unacct_trx_closed_period_fix.sql | Oracle GDF Bug 8529957 (ap_unacct_trx_closed_period_fix.sql). Sweeps unaccounted AP invoice and payment event dates from closed periods to the start of the next open/future-entry GL period. Updates AP_INVOICE_DISTRIBUTIONS_ALL, AP_SELF_ASSESSED_TAX_DIST_ALL, AP_PREPAY_HISTORY_ALL, ZX_REC_NREC_DIST, AP_INVOICE_PAYMENTS_ALL, AP_PAYMENT_HISTORY_ALL, XLA_EVENTS. Driver: AP_TEMP_DATA_DRIVER_8529957. |
| 02_ap_acctg_date_out_of_synch_fix.sql | Oracle GDF Bug 8531305 (ap_acctg_date_out_of_synch_fix.sql). Synchronizes AP transaction accounting dates to match XLA_EVENTS.event_date. Updates AP_INVOICE_DISTRIBUTIONS_ALL, AP_SELF_ASSESSED_TAX_DIST_ALL, ZX_REC_NREC_DIST, AP_INVOICE_PAYMENTS_ALL, AP_PAYMENT_HISTORY_ALL, AP_PREPAY_HISTORY_ALL. Driver: AP_TEMP_DATA_DRIVER_8531305. |
| 03_ap_rate_missing_fix.sql | Oracle GDF Bug 17941503 (ap_rate_missing_fix.sql). Populates missing exchange rates on AP checks for PAYMENT CREATED, PAYMENT MATURITY, and PAYMENT CLEARING events. Undoes incorrectly-accounted maturity events via AP_ACCTG_DATA_FIX_PKG.undo_acctg_entries. Updates AP_CHECKS_ALL, AP_INVOICE_PAYMENTS_ALL, AP_PAYMENT_HISTORY_ALL. Handles FOREIGN and INTERNATIONAL payment types. Driver: AP_TEMP_DATA_DRIVER_17941503. |
| 04_xla_multi_entity_fix.sql | Oracle GDF Bug 9651687 (xla_mulent_fix.sql). Consolidates duplicate XLA_TRANSACTION_ENTITIES rows for AP transactions. Reassigns XLA_EVENTS, XLA_AE_HEADERS, and XLA_DISTRIBUTION_LINKS to the surviving min_entity_id. Retires duplicate entities by setting entity_code='MANUAL'. Uses XLA_GLOBAL_DATA_FIX_PKG. Driver: XTE_MULTIPLE_9651687. |
| 05_ap_invoice_update.sql | Client-specific parametric script. Creates backup table XX_CUSTOM_AP_INV_DRIVER_<trackit>. Updates AP_INVOICES_ALL.amount_paid and payment_status_flag for a specified invoice_id. |
| 06_ap_payment_update.sql | Client-specific script. Creates backups for 27 AP payment records. Force-sets XLA_EVENTS (event_status_code='P', process_status_code='P'), XLA_AE_HEADERS (gl_transfer_status_code='Y'), AP_PAYMENT_HISTORY_ALL (posted_flag='Y'), AP_INVOICE_PAYMENTS_ALL (posted_flag='Y', accrual_posted_flag='Y', cash_posted_flag='Y'). |
| 07_ap_inv_flexfield_update.sql | Client-specific parametric script (same template as script 05). Creates backup table XX_CUSTOM_AP_INV_DRIVER_<trackit>. Updates AP_INVOICES_ALL.amount_paid and payment_status_flag for a specified invoice_id. |
| Table | Action |
|---|---|
| AP_INVOICE_DISTRIBUTIONS_ALL | Update accounting_date (scripts 01, 02); update accounting_date for AWT distributions (script 01) |
| AP_SELF_ASSESSED_TAX_DIST_ALL | Update accounting_date (scripts 01, 02) |
| AP_PREPAY_HISTORY_ALL | Update accounting_date (scripts 01, 02) |
| ZX_REC_NREC_DIST | Update accounting_date (scripts 01, 02) |
| AP_INVOICE_PAYMENTS_ALL | Update accounting_date (scripts 01, 02); update exchange_rate/payment_base_amount (script 03); set posted_flag flags (script 06) |
| AP_PAYMENT_HISTORY_ALL | Update accounting_date (scripts 01, 02); update exchange rates (script 03); set posted_flag (script 06) |
| XLA_EVENTS | Update event_date (script 01); update event_status_code/process_status_code='P' (script 06); reassign entity_id (script 04) |
| XLA_AE_HEADERS | Set gl_transfer_status_code='Y' (script 06); reassign entity_id (script 04) |
| XLA_DISTRIBUTION_LINKS | Update applied_to_entity_id to surviving min_entity_id (script 04) |
| XLA_TRANSACTION_ENTITIES / XLA_TRANSACTION_ENTITIES_UPG | Set entity_code='MANUAL' on retired duplicate entities (script 04) |
| AP_CHECKS_ALL | Update exchange_rate, base_amount, maturity_exchange_rate, maturity_base_amount (script 03) |
| AP_INVOICES_ALL | Update amount_paid and payment_status_flag (scripts 05, 07) |