Sub topic 5
The Universal Journal in finance
This chapter assumes you know FI and CO at a working level, know what a database table is, and can read basic ABAP. It covers what the Universal Journal is, how it differs from the ECC layout, and the mistakes people make when they first query it.
The ECC layout it replaces
In ECC, one business event wrote to several places. FI line items went to BKPF and BSEG. CO postings went to COEP. Asset postings went to ANEP. Ledger totals and profit center totals went to aggregate tables such as GLT0, FAGLFLEXT, and COSP/COSS. Reconciling FI with CO meant a separate reconciliation step, because the same event existed as several copies that could drift apart.
The S/4HANA approach
S/4HANA stores line items for FI, CO, asset accounting, material ledger, and profitability analysis in one table, ACDOCA. This table is the Universal Journal. Each posting is one row with both its financial fields (account, company code, ledger) and its controlling fields (cost center, profit center, order, segment).
Because HANA can aggregate millions of rows quickly, the stored totals are no longer needed. A balance is computed from line items when you ask for it. The old tables still exist as compatibility views, so older reports and code can often keep reading them. BSEG, for example, is now a view over the new storage.
Reading the table
This query sums the amount for one account, ledger, company code, and fiscal year. It reads line items directly. No aggregate table is involved.
SELECT SUM( hsl ) AS total_amount
FROM acdoca
WHERE rldnr = '0L'
AND rbukrs = '1000'
AND gjahr = '2024'
AND racct = '0000400000'
INTO @DATA(lv_total).The fields used are:
| Field | Meaning |
|---|---|
| RLDNR | Ledger. `0L` is the leading ledger. |
| RBUKRS | Company code |
| GJAHR | Fiscal year |
| RACCT | G/L account, with leading zeros |
| HSL | Amount in company code currency |
What this changes in practice
- Fewer reconciliation differences, because FI and CO read the same row.
- Profit center, segment, and cost center are available on every G/L line, so reports no longer depend on separate totals.
- Multiple ledgers (for example local GAAP next to IFRS) live in the same table, separated by the ledger field.
- Data volume in ACDOCA is larger than in any single ECC table, so queries need selective filters.
Common errors
- Omitting the ledger. If you do not filter on RLDNR, rows from every ledger are summed together. Amounts can be counted twice.
- Forgetting leading zeros. Account
400000does not match0000400000. - Writing to old tables. Custom code that inserts into tables such as BSEG or COEP directly is not supported. Posting must go through standard functions or APIs.
- Relying on removed totals. Code that reads GLT0 or similar tables may work through compatibility views, but it can be slower than reading ACDOCA directly. Check it during custom code adaptation.
Exercise
A custom report sums HSL from ACDOCA for one company code, year, and account, and its result is exactly double the balance in the leading ledger. The company code has two ledgers. What is the most likely cause, and how do you fix it?
Show answer
The query has no filter on the ledger field RLDNR, so rows from both ledgers are summed. Add a condition such as RLDNR = '0L' to select a single ledger.