Sub topic 7
The Universal Journal
This chapter assumes you know basic accounting terms (debit, credit, G/L account, cost center) and relational database concepts (tables, keys, aggregation). It also assumes you have read the Finance and Controlling chapter.
The problem it solves
In SAP ERP (ECC), one business event wrote to several tables. A posting touched the FI line item table BSEG, the controlling table COEP, the asset table ANEP, and the ledger table FAGLFLEXA, among others. Reports then had to reconcile these tables, and the totals could disagree.
S/4HANA replaces this with one line item table, ACDOCA, called the Universal Journal. Each posting line is stored once. It carries both the financial fields (company code, G/L account, amounts) and the controlling fields (cost center, profit center, internal order, WBS element).
Key fields
| Field | Meaning |
|---|---|
| RLDNR | Ledger. `0L` is the leading ledger. |
| RBUKRS | Company code |
| GJAHR | Fiscal year |
| BELNR / DOCLN | Accounting document number and line |
| RACCT | G/L account |
| HSL | Amount in company code currency |
| RCNTR | Cost center |
| PRCTR | Profit center |
Reading the table
This query sums company code currency amounts per G/L account for the leading ledger.
SELECT rbukrs, racct, SUM( hsl ) AS balance
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1010'
AND gjahr = '2024'
GROUP BY rbukrs, racct
INTO TABLE @DATA(balances).Because debits are stored as positive amounts and credits as negative amounts, the sum is the balance. A balance sheet account shows its balance directly. No join to a controlling table is needed to get cost center detail, because RCNTR is on the same row.
How it connects to the other modules
The operational modules do not post to ACDOCA directly. A goods receipt in Inventory, a supplier invoice in Procurement, or a billing document in Sales creates an accounting document. That document is stored as ACDOCA rows.
- A goods receipt for a purchase order debits inventory and credits the goods receipt/invoice receipt (GR/IR) clearing account.
- A billing document debits the customer receivable and credits revenue. The row can carry the profit center and the sales organization's derived characteristics.
This is why the Universal Journal sits where the integration flows meet. Procure-to-pay and order-to-cash both end in the same table.
Common errors
- Summing without filtering the ledger. ACDOCA holds rows for every ledger. Without
rldnr, a company with a leading and a non-leading ledger gets double counts. - Mixing currencies. HSL is the company code currency. Other currency fields (KSL for controlling area currency, for example) are different columns. Do not add them together.
- Treating the old tables as the source. BSEG and COEP still exist in S/4HANA as compatibility views or secondary data. New reports should read ACDOCA or the CDS views built on it.
- Forgetting the fiscal year. Large tables need
gjahrin the filter, or the query scans all years.
Exercise
A report sums HSL from ACDOCA for company code 1010 and fiscal year 2024, grouped by G/L account. The totals are twice what Finance expects. The company has a leading ledger 0L and a non-leading ledger for local GAAP. What is the likely cause, and how do you fix the query?
Show answer
The query does not filter on the ledger (RLDNR), so rows from both ledgers are summed and many postings are counted twice. Add AND rldnr = '0L' (or the ledger Finance wants) to the WHERE clause.
Exercise
Why does a cost center report no longer need to reconcile against the G/L in S/4HANA?
Show answer
Both views read the same ACDOCA rows. The cost center field RCNTR sits on the same line as the G/L account RACCT, so Finance and Controlling cannot differ.