← Back to Cases
AR Adjustment Accounting Distributions Missing — Insert AR_DISTRIBUTIONS_ALL Records
Case Number00028013
Oracle ModuleAccounts Receivable (AR)
EBS VersionR12
Functional AreaAR Adjustments / Accounting / GL Transfer
Related PatchesNone

Symptoms

Root Cause

Accounting distribution records were not created in AR_DISTRIBUTIONS_ALL for several AR adjustment IDs at the time the adjustments were posted. Each AR adjustment requires a balanced pair of distribution lines: one with source_type = 'ADJ' (the adjustment account debit or credit) and one with source_type = 'REC' (the receivable account credit or debit). Without these rows, the GL Transfer cannot generate the journal entries for the adjustments. The fix manually inserts the missing balanced DR/CR distribution pairs for each affected adjustment using ra_cust_trx_line_gl_dist_s.nextval for the line IDs.

Identification SQL

Use the following query to identify AR adjustments missing distribution records:

SELECT adj.adjustment_id, adj.amount, adj.status
FROM   ar_adjustments_all adj
WHERE  adj.customer_trx_id IN (&customer_trx_ids)
  AND  NOT EXISTS (
         SELECT 1
         FROM   ar_distributions_all dis
         WHERE  dis.source_table = 'ADJ'
           AND  dis.source_id    = adj.adjustment_id
       );

Resolution

Step 1 – Create backup table

Run 01_gl_date_fix.txt. A backup of any existing AR_DISTRIBUTIONS_ALL rows for the affected adjustments (joined via AR_ADJUSTMENTS_ALL) is created in RSI_AR_DIST_00028013.

Step 2 – Insert missing distribution records

For each affected adjustment_id, insert two rows into AR_DISTRIBUTIONS_ALL:

  1. Adjustment account line (source_type = 'ADJ'): Uses the adjustment CCID; populates amount_dr and acctd_amount_dr (or amount_cr/acctd_amount_cr for credit adjustments). Uses ra_cust_trx_line_gl_dist_s.nextval for line_id.
  2. Receivable account line (source_type = 'REC'): Uses the receivable CCID; populates the opposing amount column to balance the entry.

Each insert includes org_id, currency_code, third_party_id, and third_party_sub_id from the original transaction. Commit after all inserts.

Step 3 – Validate and transfer to GL

Run the ARAdjustmentInfo diagnostics report for the affected adjustment IDs to verify the distributions are correct. Submit the GL Transfer concurrent program for adjustments. Run the ARClosing diagnostic to confirm the transactions are now accounted.

Note: The two fix scripts (01_gl_date_fix.txt and 02_adjustment_fix.txt) cover the same fix pattern. Script 01 is the final applied version covering all affected adjustments; script 02 is an earlier draft covering a subset. Use script 01 as the definitive reference. The code_combination_id values for the ADJ and REC distribution types must be verified against the original accounting rules for each transaction before inserting. Using incorrect CCIDs will cause the GL to post to wrong accounts.

Script Inventory

FileDescription
01_gl_date_fix.txtFinal fix. Creates backup table RSI_AR_DIST_00028013; inserts missing ADJ and REC source type distribution pairs into AR_DISTRIBUTIONS_ALL for multiple affected adjustment IDs. Includes post-fix diagnostic and GL Transfer instructions.
02_adjustment_fix.txtEarlier draft covering a single adjustment ID. Superseded by 01_gl_date_fix.txt for production use.

Key Tables Affected

TableAction
AR_DISTRIBUTIONS_ALLInsert missing ADJ and REC source type distribution records for each affected adjustment
AR_ADJUSTMENTS_ALLRead only — source for adjustment IDs and customer transaction IDs