Sub topic 7
The Universal Journal
This chapter assumes you know what a G/L account and a cost center are, and that you are comfortable with tables, keys, and joins. It also assumes you have read the chapters on organizational structure and on Finance and Controlling.
What the Universal Journal is
The Universal Journal is the single table of accounting line items in SAP S/4HANA. Its technical name is ACDOCA. Every posting from Financial Accounting (FI), Controlling (CO), Asset Accounting, and Material Ledger lands in this table as a line item. Each line carries both the financial and the management-accounting attributes.
In SAP ERP, the same posting was spread across several tables:
| Area | Classic ERP tables | Content |
|---|---|---|
| Financial Accounting | BKPF, BSEG | Document header and line items |
| Controlling | COEP, COBK | CO line items and headers |
| General ledger totals | GLT0, FAGLFLEXA | Balances and new G/L items |
| Asset Accounting | ANEP, ANLC | Asset line items and values |
| Material Ledger | MLIT, MLHD | Valuation line items |
Keeping these in sync needed reconciliation reports. In S/4HANA, ACDOCA holds the line items and the other areas read from it. BKPF still holds the document header. Older table names such as BSEG remain as compatibility views, so older code keeps working.
Why the design changed
Three changes made the single table possible:
- No stored aggregates. Totals tables such as GLT0 were removed. SAP HANA is an in-memory columnar database, so balances are computed from line items when you query them.
- One source of truth. FI and CO read the same rows, so a cost center posting and its G/L posting cannot disagree.
- Wide line items. One row can carry the account, cost center, profit center, segment, functional area, and more.
The trade-off is that ACDOCA becomes very large, and queries on it depend on HANA's compression and column scans. Always filter on the leading key fields.
Anatomy of an ACDOCA line
The primary key is the ledger, company code, fiscal year, accounting document number, and line item (RLDNR, RBUKRS, GJAHR, BELNR, DOCLN). The fields below are the ones you will meet most often.
| Field | Meaning |
|---|---|
| RLDNR | Ledger, for example 0L for the leading ledger |
| RBUKRS | Company code |
| GJAHR | Fiscal year |
| BELNR | Accounting document number |
| DOCLN | Line item in the ledger |
| RACCT | G/L account |
| RCNTR | Cost center |
| PRCTR | Profit center |
| HSL | Amount in company code currency |
| KSL | Amount in group currency |
| TSL | Amount in transaction currency |
| DRCRK | Debit/credit indicator |
| POPER | Posting period |
Amounts are stored signed. A debit is positive and a credit is negative, so a plain sum gives a balance.
Reading ACDOCA
This query sums the company code currency amount 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).The WHERE clause uses ledger, company code, and fiscal year, which are the first key fields. That keeps the scan narrow. Because the sign convention is built in, no debit/credit split is needed. A balance sheet account such as a bank account can show a positive balance. A revenue account shows a negative sum, because revenue is a credit.
For new code, SAP recommends reading through released CDS views, not the table directly. The analytics chapter covers this.
How a posting reaches the journal
An operational document does not write to ACDOCA itself. The accounting interface creates an accounting document from it, and that document writes the journal lines.
For example, a goods receipt for a purchase order produces a debit to inventory and a credit to the goods receipt/invoice receipt (GR/IR) clearing account. Both lines are rows in ACDOCA, and each row carries the plant-related and organizational fields derived at posting time.
Ledgers and parallel accounting
The RLDNR field is what lets one table serve several accounting views.
- The leading ledger (0L) follows the group's main accounting principle, such as IFRS.
- Non-leading ledgers hold a second principle, such as local GAAP, for companies that must report both ways.
- Extension ledgers hold only the adjustments on top of another ledger. This saves storage, because the unchanged postings are not copied.
Most postings are written to all assigned ledgers at once. Differences, for example in depreciation, are posted only to the relevant ledger. When you read data, always filter on RLDNR. If you leave it out, a sum counts the same business event once for each ledger and the result is too high.
Joining Finance and Controlling
In classic ERP, a CO posting such as an allocation between cost centers had no matching FI document unless a real-time integration step was configured. Reconciling the two was a regular period-end task.
In the Universal Journal, an allocation is an ordinary journal entry with a cost center and a G/L account (a secondary cost element) on the same row. Two things follow:
- Cost elements are G/L accounts. Primary cost elements are G/L accounts of a specific type. Secondary cost elements, used for allocations, are also G/L accounts, with their own account types.
- Profit center and segment are always on the line. Segment reporting and profit center reporting need no separate extraction.
Reconciliation between FI and CO becomes unnecessary for postings in the journal, since both views read the same rows.
Common errors
- Forgetting the ledger filter. Summing across all ledgers double counts amounts. Filter on RLDNR.
- Treating HSL as always positive. Credits are negative. Use DRCRK or the sign when you need a debit or credit split.
- Mixing currencies. HSL, KSL, and TSL are different currencies. Add them only within the same currency type, and group by the currency key field when you use TSL.
- Filtering only on non-key fields. Without ledger, company code, and year in the WHERE clause, a query may scan billions of rows.
- Writing to ACDOCA directly. Never insert or update the table. Post through the accounting interface or a released API, so that validations, number ranges, and the document header stay consistent.
- Assuming old table names are stored. Tables such as BSEG, GLT0, and COEP may exist only as compatibility views. They can be slower than reading ACDOCA or a released CDS view.
Summary of the key ideas
- ACDOCA is the single line item table for FI, CO, Asset Accounting, and Material Ledger.
- Balances are computed from line items, not stored.
- The ledger field separates accounting principles inside one table.
- Always filter on ledger, company code, and fiscal year.
- Operational documents reach the journal only through the accounting interface.
Exercise
A colleague writes SELECT SUM( hsl ) FROM acdoca WHERE rbukrs = '1010' AND gjahr = '2024' AND racct = '800000' and reports revenue that is about double the figure in the financial statements. The company has a leading ledger 0L and a non-leading ledger 2L for local GAAP. What is the likely cause, and how do you fix the query?
Show answer
The query has no filter on the ledger (RLDNR). Most postings are written to both 0L and 2L, so the sum counts each revenue posting twice. Add rldnr = '0L' to the WHERE clause (or the ledger that the statements use). The result will be negative if the account holds revenue, because credits are stored as negative amounts.
Exercise
Why can S/4HANA drop totals tables such as GLT0 and still report balances quickly, and what does this change about reconciling FI and CO?
Show answer
SAP HANA is an in-memory columnar database. It can aggregate line items at query time, so stored totals are no longer needed. Because FI and CO both read the same ACDOCA rows, a cost center posting and its G/L posting come from one record, so there are no two data sets to reconcile for postings in the journal.