| Case Number | 00172542 |
| Oracle Module | General Ledger (GL) |
| EBS Version | R12 |
| Functional Area | GL Journal Entries / GL Balances / GL Code Combinations / Intercompany Accounting |
| Related Patches | None |
code_combination_id (CCID) values on GL_JE_LINES: lines were posted to wrong account segments (e.g., segment1 62250 instead of the correct 62200, and/or missing segment5 194000) causing balances to accumulate on incorrect accounts.GL_BALANCES show activity on incorrect CCIDs (5621, 5625) while the correct CCIDs (5783, 5788) have no corresponding balance rows, or show incorrect beginning balances in subsequent periods.GL journal entries were posted referencing CCIDs that correspond to account strings with incorrect segment values. The correct account code combinations (accounts 62200.000.000000.50225.194000.00000000.00000000 and 62200.000.100100.62305.194000.00000000.00000000) did not exist in GL_CODE_COMBINATIONS at the time of posting, or the journal import process selected the wrong CCIDs. The fix creates the correct CCIDs, re-codes the GL journal lines, removes erroneous intercompany lines, and restates GL_BALANCES across all affected periods. The resolution was developed iteratively across four phases as the full scope of the problem (multiple journal headers, intercompany entries, multi-period balance impact) was established.
Run 01_setup_tables_a.sql. Calls FND_FLEX_EXT.GET_COMBINATION_ID with:
SQLGLGL#FND_ID_FLEX_STRUCTURES where ID_FLEX_STRUCTURE_CODE = 'ACCOUNTING_FLEXFIELD'62200.000.000000.50225.194000.00000000.00000000If the code combination does not exist, the function inserts a new row in GL_CODE_COMBINATIONS and returns the new CCID (stored as XXRSI_CCID_A / CCID 5783 in the subsequent fix scripts).
Run 02_setup_tables_b.sql. Same pattern as Script 01 using segment string 62200.000.100100.62305.194000.00000000.00000000 (CCID 5788 in subsequent fix scripts).
Script 03_data_fix_phase_1.sql contains diagnostic SELECT statements to understand the scope of the problem, followed by backup table creation:
GL_JE_BATCHES for the affected batch (name matching 'HAR%Acct%2872555%').GL_JE_HEADERS for je_batch_id = 75711.GL_JE_LINES for je_header_id = 14448, using FND_FLEX_EXT.GET_SEGS to display account segment strings alongside entered_dr/cr amounts.GL_CODE_COMBINATIONS to confirm existence/absence of the source CCIDs (5625, 5621) and target CCIDs (3726, 3967, then 5783, 5788) for both account patterns.GL_BALANCES for CCIDs 5625, 5621, 3726, 3967 in periods MAR-19 through JUN-19.Creates initial backup tables:
xxrsi_gl_je_line_172542 — snapshot of GL_JE_LINES for je_header_id=14448 where CCID in (5625, 5621, 3726, 3967).xxrsi_gl_bal_172542 — snapshot of GL_BALANCES for those CCIDs in MAR-19.Script 04_data_fix_phase_2.sql was the first fix attempt, targeting intermediate CCIDs. Drops and recreates the backup tables from Phase 1, then:
GL_JE_LINES for je_header_id = 14448: CCID 5625 → 3726; CCID 5621 → 3967.GL_BALANCES for MAR-19:
period_net_cr - 58.98period_net_cr + 58.98period_net_cr - 1065.67period_net_cr + 1065.67Script 05_data_fix_phase_3.sql corrects the Phase 2 fix by targeting the proper CCIDs (5783, 5788) and extending the balance restatement to include April and May carry-forward effects:
xxrsi_gl_je_line_172542A (GL_JE_LINES for je_header_id=14448, CCIDs 5625/5621) and xxrsi_gl_bal_172542A (GL_BALANCES for CCIDs 5625, 5621, 5788, 5783 in MAR-19).-1065.67) and 5625 (-58.98) on GL_BALANCES.period_net_cr for MAR-19.GL_BALANCES rows for CCID 5788 (period_net_cr=1065.67) and CCID 5783 (period_net_cr=58.98) in MAR-19, set_of_books_id=1001, period_year=2019, period_num=3.BEGIN_BALANCE_CR on GL_BALANCES:
Script 06_data_fix_phase_4.sql is the final and most comprehensive version, extending the fix to all four affected journal headers and removing erroneous intercompany entries:
xxrsi_gl_bal_172542B (GL_BALANCES for CCIDs 5625, 5621, 5788, 5783, 5752, 5380 in MAR-19 through JUN-19) and xxrsi_gl_je_lines_172542B (GL_JE_LINES for je_header_ids 14448, 15178, 15197, 15198).GL_JE_LINES rows for je_header_ids 14448, 15178, 15197, 15198 where CCID in (5380, 5752).GL_BALANCES for CCIDs 5621, 5625, 5752 in MAR-19 through JUN-19.period_net_cr and period_net_dr on CCID 5380 for APR-19; adjusts quarter-to-date, project-to-date, and begin-balance amounts for MAY-19 and JUN-19 to reflect removal of the deleted intercompany lines.| File | Description |
|---|---|
| 01_setup_tables_a.sql | Creates GL code combination for 62200.000.000000.50225.194000.00000000.00000000 via FND_FLEX_EXT.GET_COMBINATION_ID (SQLGL/GL# flexfield, chart_of_accounts_id=101). Returns CCID 5783. |
| 02_setup_tables_b.sql | Creates GL code combination for 62200.000.100100.62305.194000.00000000.00000000 via FND_FLEX_EXT.GET_COMBINATION_ID. Returns CCID 5788. |
| 03_data_fix_phase_1.sql | Phase 1: Diagnostic SELECT queries against GL_JE_BATCHES, GL_JE_HEADERS, GL_JE_LINES (with FND_FLEX_EXT.GET_SEGS), GL_CODE_COMBINATIONS, and GL_BALANCES to scope the problem. Creates backup tables xxrsi_gl_je_line_172542 and xxrsi_gl_bal_172542 for je_header_id=14448 in MAR-19. |
| 04_data_fix_phase_2.sql | Phase 2 (superseded): Recodes GL_JE_LINES for je_header_id=14448 from CCIDs 5625/5621 to intermediate CCIDs 3726/3967. Adjusts GL_BALANCES period_net_cr for MAR-19 only. Superseded by Phase 3 when the correct target CCIDs were established. |
| 05_data_fix_phase_3.sql | Phase 3 (partial fix): Recodes GL_JE_LINES for je_header_id=14448 from CCIDs 5625/5621 to 5783/5788. Inserts new GL_BALANCES rows for MAR-19; adjusts BEGIN_BALANCE_CR for APR-19 and MAY-19; inserts balance rows for APR-19/MAY-19. Superseded by Phase 4 which covers all headers. |
| 06_data_fix_phase_4.sql | Phase 4 (definitive fix): Recodes all 4 je_header_ids (14448, 15178, 15197, 15198) from CCIDs 5621/5625 to 5788/5783. Deletes intercompany lines (CCIDs 5380, 5752). Restates GL_BALANCES for MAR-19 through JUN-19: zeros old CCID balances, inserts new CCID balance rows, adjusts intercompany CCID 5380 balances. |
| Table | Action |
|---|---|
| GL_CODE_COMBINATIONS | Insert new code combinations for correct account strings (Scripts 01 and 02 via FND_FLEX_EXT.GET_COMBINATION_ID) |
| GL_JE_LINES | Update code_combination_id from incorrect CCIDs (5621, 5625) to correct CCIDs (5788, 5783) for je_header_ids 14448, 15178, 15197, 15198; delete intercompany lines (CCIDs 5380, 5752) (Script 06) |
| GL_BALANCES | Update period_net, quarter-to-date, project-to-date, and begin_balance columns for MAR-19 through JUN-19; zero out old CCID balances; insert new CCID balance rows (Scripts 04, 05, 06) |
| xxrsi_gl_je_line_172542 | Backup of GL_JE_LINES for je_header_id=14448 (Script 03) |
| xxrsi_gl_bal_172542 | Backup of GL_BALANCES for affected CCIDs in MAR-19 (Script 03) |
| xxrsi_gl_je_line_172542A | Revised backup of GL_JE_LINES (Script 05) |
| xxrsi_gl_bal_172542A | Revised backup of GL_BALANCES for Phase 3 affected CCIDs (Script 05) |
| xxrsi_gl_je_lines_172542B | Final backup of GL_JE_LINES for all 4 je_headers (Script 06) |
| xxrsi_gl_bal_172542B | Final backup of GL_BALANCES for all affected CCIDs in MAR-19 through JUN-19 (Script 06) |