| Case Number | 00059272 |
| Oracle Module | Accounts Payable (AP) / Purchasing (PO) |
| EBS Version | 11i (11.5.10.2) |
| Functional Area | PO Accrual Reconciliation / Receipt Currency Rates / Accrual Write-Offs |
| Related Patches | None |
PO_ACCRUAL_RECONCILE_TEMP_ALL) shows a persistent 1-cent (net_po_line_amount = 0.01 or -0.01) variance between matched PO receipt amounts and AP invoice amounts for a set of foreign currency PO lines.RCV_TRANSACTIONS — the rate on the receipt transaction slightly differs from the rate implied by the AP invoice amount, unit price, and quantity, resulting in a 1-cent functional currency difference that does not resolve through normal processes.In Oracle 11i, the PO accrual reconciliation matches receipt transactions to AP invoice distributions using functional currency amounts computed from the receipt's currency_conversion_rate on RCV_TRANSACTIONS. When the rate on the receipt was stored with slightly less precision than the rate implied by the AP invoice (computed as AP_TRANSACTION_AMOUNT / (AP_TRANSACTION_QUANTITY × AP_TRANSACTION_UNIT_PRICE)), a 1-cent rounding difference appears in NET_PO_LINE_AMOUNT on the reconciliation temp table. Two alternative resolution approaches are provided:
RCV_TRANSACTIONS.currency_conversion_rate to match the rate implied by the AP invoice, eliminating the variance at source.PO_ACCRUAL_WRITE_OFFS_ALL for both the PO and AP sides of the variance, and mark the PO_ACCRUAL_RECONCILE_TEMP_ALL rows as written off (write_off_flag = 'Y', net_po_line_amount = 0).Run 01_setup_driver_tables.sql first. Creates:
RSI_PO_ACCR_59272 — mirrors PO_ACCRUAL_RECONCILE_TEMP_ALL structure with a unique index on (PO_HEADER_ID, PO_LINE_ID, LINE_LOCATION_ID, INVENTORY_ITEM_ID, TRANSACTION_SOURCE_CODE). Used as a backup for affected accrual reconciliation rows before write-off creation.RSI_AP_PO_ERRORS_59272 — error tracking table (transaction_id, trans_type, error_message, error_block) used by Phases B and C to log per-transaction processing errors without halting the full run.Note: Script 02 (Phase A) uses a separate backup table RSI_RCV_TRX_59272 (created inline with CREATE TABLE AS SELECT on first use, protected by a DUP_VAL_ON_INDEX handler for subsequent runs).
Selects pairs of matching PO and AP accrual reconciliation rows from PO_ACCRUAL_RECONCILE_TEMP_ALL where both sides have net_po_line_amount = 0.01 and org_id = 119. Joins PO rows (transaction_source_code = 'PO') to AP rows (transaction_source_code = 'AP') on matching PO_HEADER_ID, PO_LINE_ID, LINE_LOCATION_ID, and INVENTORY_ITEM_ID.
For each matched pair:
v_new_rate := AP_TRANSACTION_AMOUNT / (AP_TRANSACTION_QUANTITY × AP_TRANSACTION_UNIT_PRICE).RCV_TRANSACTIONS (receipt transaction_id and its parent_transaction_id chain) into RSI_RCV_TRX_59272. Skips backup if already present (DUP_VAL_ON_INDEX).RCV_TRANSACTIONS.currency_conversion_rate to the new calculated rate for the PO transaction ID and its parent transaction.RSI_AP_PO_ERRORS_59272 and proceeds to the next record on failure.Selects PO accrual records from PO_ACCRUAL_RECONCILE_TEMP_ALL where abs(net_po_line_amount) = 0.01, org_id = 119, transaction_source_code = 'PO', and write_off_id IS NULL (not yet written off).
For each PO record:
PO_ACCRUAL_RECONCILE_TEMP_ALL into RSI_PO_ACCR_59272 (protected by DUP_VAL_ON_INDEX).PO_ACCRUAL_WRITE_OFFS_ALL using PO_ACCRUAL_WRITE_OFFS_S.NEXTVAL, copying all relevant columns from the PO accrual row, with WRITE_OFF_CODE = 'WRITE OFF' and REASON_ID = 232.PO_ACCRUAL_RECONCILE_TEMP_ALL: sets write_off_id, write_off_flag = 'Y', net_po_line_amount = 0.PO_ACCRUAL_RECONCILE_TEMP_ALL for transaction_source_code = 'AP' matching on PO_HEADER_ID, PO_LINE_ID, LINE_LOCATION_ID, INVENTORY_ITEM_ID, and round(abs(transaction_amount)). Requires exactly one AP match — rolls back if zero or more than one AP row found.PO_ACCRUAL_WRITE_OFFS_ALL for the AP accrual row with a new sequence ID.PO_ACCRUAL_RECONCILE_TEMP_ALL: sets write_off_id, write_off_flag = 'Y', net_po_line_amount = 0.RSI_AP_PO_ERRORS_59272.Same logic as Phase B (Script 03), but accepts two user-supplied parameters at runtime:
&p_variable1 — Operating unit (org_id) to process.&p_variable2 — Variance amount threshold (e.g., 0.01 for 1-cent variances).Phase C adds an additional filter on PO_DISTRIBUTION_ID when locating the matching AP accrual row, improving accuracy when multiple AP lines exist for the same PO/line/location combination. Otherwise identical to Phase B in its write-off insertion and update logic. Use Phase C as the preferred general-purpose version when the org or variance amount differs from the hardcoded Phase B values.
| File | Description |
|---|---|
| 01_setup_driver_tables.sql | Creates backup table RSI_PO_ACCR_59272 (mirrors PO_ACCRUAL_RECONCILE_TEMP_ALL with unique index) and error table RSI_AP_PO_ERRORS_59272. Must be run before any fix script. |
| 02_data_fix_phase_a.sql | Phase A: Recalculates currency_conversion_rate on RCV_TRANSACTIONS for PO/AP accrual pairs with 1-cent variance (net_po_line_amount=0.01, org_id=119). New rate = AP_TRANSACTION_AMOUNT / (AP_TRANSACTION_QUANTITY × AP_TRANSACTION_UNIT_PRICE). Backs up to RSI_RCV_TRX_59272. |
| 03_data_fix_phase_b.sql | Phase B: Creates write-off records in PO_ACCRUAL_WRITE_OFFS_ALL for PO and AP accrual rows with abs(net_po_line_amount)=0.01 in org_id=119. Updates PO_ACCRUAL_RECONCILE_TEMP_ALL (write_off_id, write_off_flag='Y', net_po_line_amount=0). Requires exactly one AP match per PO row; rolls back pair if mismatch. |
| 04_data_fix_phase_c.sql | Phase C (parametric): Same write-off logic as Phase B but accepts runtime parameters for org_id (&p_variable1) and variance amount (&p_variable2). Adds po_distribution_id to AP matching criteria. Preferred general-purpose version. |
| Table | Action |
|---|---|
| RCV_TRANSACTIONS | Update currency_conversion_rate to corrected rate for affected receipt and parent transactions (Phase A) |
| PO_ACCRUAL_WRITE_OFFS_ALL | Insert write-off records for both PO and AP sides of each 1-cent variance (Phases B and C) |
| PO_ACCRUAL_RECONCILE_TEMP_ALL | Update write_off_id, write_off_flag='Y', net_po_line_amount=0 for written-off PO and AP rows (Phases B and C) |
| RSI_RCV_TRX_59272 | Backup of RCV_TRANSACTIONS rows before rate update (Phase A — created inline) |
| RSI_PO_ACCR_59272 | Backup of PO_ACCRUAL_RECONCILE_TEMP_ALL rows before write-off (Phases B and C) |
| RSI_AP_PO_ERRORS_59272 | Error log for per-transaction processing failures (Phases B and C) |