← Back to Cases
AP Liability Balance Missing Row and AE Lines CCID Incorrect (11i) — Two-Phase Fix
Case Number00031801
Oracle ModuleAccounts Payable (AP)
EBS Version11i
Functional AreaAP Accounting / Liability Balance / Trial Balance / AE Lines
Related PatchesNone

Symptoms

Root Cause

In Oracle 11i, AP_LIABILITY_BALANCE is populated from AP_AE_LINES_ALL LIABILITY-type rows during the GL Transfer process. For this case, a LIABILITY line in AP_AE_LINES_ALL (for ae_header_id = 15843039) has no corresponding row in AP_LIABILITY_BALANCE, and the CCID recorded across AP_AE_LINES_ALL, AP_LIABILITY_BALANCE, and AP_TRIAL_BAL is incorrect. The fix is executed in two phases: Phase A inserts the missing liability balance row and refreshes the trial balance flag; Phase B corrects the CCID across all three tables after backing up the original values.

Resolution

Phase A – Insert missing AP_LIABILITY_BALANCE row and refresh trial balance flag

Run 01_data_fix_phase_a.sql. This script:

  1. Inserts into AP_LIABILITY_BALANCE from AP_AE_LINES_ALL for ae_header_id = 15843039, selecting rows where ae_line_type_code = 'LIABILITY' and no matching row already exists in AP_LIABILITY_BALANCE (NOT EXISTS check on ae_header_id and ae_line_num).
  2. Calls AP_TRIAL_BALANCE_PKG.Update_Trial_Balance_Flag(l_gl_transfer_run_id) to refresh the trial balance flag for the affected transfer run, ensuring the newly inserted row is reflected in trial balance reporting.
  3. Commits after the insert and package call.
Phase B – Correct code_combination_id across AP_AE_LINES_ALL, AP_LIABILITY_BALANCE, and AP_TRIAL_BAL

Run 02_data_fix_phase_b.sql. This script:

  1. Creates backup tables:
  2. Updates AP_AE_LINES_ALL: sets code_combination_id = 68855 (correct CCID) where it was incorrectly set to 68985, for the specific ae_line_id and ae_header_id.
  3. Updates AP_LIABILITY_BALANCE: sets code_combination_id = 68855 where it was 68985, for the same ae_header_id.
  4. Updates AP_TRIAL_BAL: sets code_combination_id = 68855 where it was 68985, for the affected invoice ID.
  5. Commits after all updates.
Note: Phase A must be run before Phase B. The incorrect CCID (68985) and correct CCID (68855) are specific to this case — verify the correct code combination against the chart of accounts and the original invoice accounting rules before executing Phase B. The AP_TRIAL_BALANCE_PKG.Update_Trial_Balance_Flag call in Phase A requires the gl_transfer_run_id value used when the affected accounting entries were originally transferred to GL.

Script Inventory

FileDescription
01_data_fix_phase_a.sqlInserts missing AP_LIABILITY_BALANCE row for ae_header_id 15843039 from AP_AE_LINES_ALL (LIABILITY type, NOT EXISTS check). Calls AP_TRIAL_BALANCE_PKG.Update_Trial_Balance_Flag to refresh the trial balance flag.
02_data_fix_phase_b.sqlCreates backup tables RSI_AP_AE_LINES_31801, RSI_AP_LIABILITY_BAL_31801, RSI_AP_TRIAL_BAL_31801. Updates code_combination_id from 68985 to 68855 in AP_AE_LINES_ALL, AP_LIABILITY_BALANCE, and AP_TRIAL_BAL for the affected rows.

Key Tables Affected

TableAction
AP_LIABILITY_BALANCEInsert missing LIABILITY row from AP_AE_LINES_ALL; update code_combination_id to correct value
AP_AE_LINES_ALLUpdate code_combination_id from incorrect to correct CCID for affected ae_line_id
AP_TRIAL_BALUpdate code_combination_id from incorrect to correct CCID for affected invoice ID
AP_AE_LINES_ALLRead only in Phase A — source for LIABILITY line insert into AP_LIABILITY_BALANCE