| Case Number | 00076964 |
| Oracle Module | General Ledger (GL) |
| EBS Version | R12 |
| Functional Area | GL Balances / Posting / Balance Calculation |
| Related Patches | None |
GL_BALANCES return multiple rows for the same combination of set_of_books_id, code_combination_id, currency_code, period_name, actual_flag, budget_version_id, encumbrance_type_id, template_id, and translated_flag — indicating duplicate balance rows exist.Duplicate rows in GL_BALANCES occurred for specific ledger, account, and period combinations, likely caused by a failed or aborted posting run that partially committed balance updates. The duplicate rows cause double-counting in balance calculations and reports. The fix identifies the duplicates using a driver query, backs them up, and removes the extra rows.
The following query identifies affected account/period combinations with duplicate GL balance rows:
SELECT set_of_books_id, code_combination_id, currency_code, period_name,
actual_flag, budget_version_id, encumbrance_type_id, template_id,
DECODE(translated_flag, 'Y', 'Y', 'N', 'Y', 'R', 'R', 'X'),
COUNT(*)
FROM gl_balances
GROUP BY set_of_books_id, code_combination_id, currency_code, period_name,
actual_flag, budget_version_id, encumbrance_type_id, template_id,
DECODE(translated_flag, 'Y', 'Y', 'N', 'Y', 'R', 'R', 'X')
HAVING COUNT(*) > 1;
Run data_fix.sql. The script first creates a driver table (rsi_driver_76964A) containing the unique key combination for all GL_BALANCES rows that appear more than once, along with their counts.
A backup table (rsi_gl_bal_76964A) is created containing all GL_BALANCES rows for the affected ledger and period that have matching code_combination_id values in the driver table.
Delete the duplicate GL_BALANCES rows, retaining only one row per unique key combination. The duplicate rows are identified by ROWID, keeping the row with the lowest ROWID for each duplicate group.
Issue COMMIT. Re-run the affected GL balance reports and confirm the totals are correct with no duplicate rows remaining.
| File | Description |
|---|---|
| data_fix.sql | Creates driver table identifying duplicate GL_BALANCES rows; creates backup table for affected rows; removes duplicate rows retaining one per unique key combination. |
| Table | Action |
|---|---|
| GL_BALANCES | Delete duplicate rows; retain one row per unique key combination |