Sub topic 5
The Universal Journal in finance
This chapter assumes you know the FI and CO modules at a working level and understand what a general ledger line item is. It also assumes you can read basic ABAP Open SQL. The previous chapter covered the simplified data model in general. This chapter looks at its largest single change in finance, the Universal Journal.
What the Universal Journal is
The Universal Journal is a single table, ACDOCA, that stores line items for financial accounting, management accounting, asset accounting, and the Material Ledger. The single table is the physical store behind the Universal Journal. The same line item is no longer copied to separate tables for each application.
In SAP ECC 6.0, one business transaction wrote to several places:
BKPFandBSEGfor the accounting document.FAGLFLEXAfor New General Ledger line items.COBKandCOEPfor controlling documents.ANEPandANLCfor asset line items and values.MLITand related tables for the Material Ledger.- Profitability tables for CO-PA.
- Aggregate tables such as
GLT0,FAGLFLEXT,KNC1, andLFC1, which hold balances per account and period.
Because several tables held the same data, finance teams ran reconciliation reports to prove they agreed. Closing the books often included an FI-CO reconciliation step.
In S/4HANA, ACDOCA holds one row per line item, and that row carries the account, cost center, profit center, segment, and amounts together. FI and CO views of the same posting come from the same row. Because they cannot disagree, there is nothing to reconcile.
Key fields in ACDOCA
You need a handful of fields to read the table. The names come from the new general ledger conventions.
| Field | Meaning |
|---|---|
| `RLDNR` | Ledger. `0L` is the leading ledger. |
| `RBUKRS` | Company code. |
| `GJAHR`, `BELNR`, `DOCLN` | Fiscal year, document number, and six-character line item. |
| `RACCT` | G/L account. |
| `HSL` | Amount in company code currency. |
| `KSL` | Amount in group currency. |
| `WSL` | Amount in transaction currency. |
| `RCNTR`, `PRCTR`, `SEGMENT` | Cost center, profit center, and segment. |
| `POPER` | Posting period. |
Amounts are signed. Debits are positive and credits are negative, so a sum over a P&L revenue account is usually negative.
Reading a balance from line items
In ECC you read an account balance from GLT0 or FAGLFLEXT, because the aggregate was stored for speed. In S/4HANA you can sum line items directly. The in-memory column store in SAP HANA makes this fast enough.
The report below is complete. Run it in a system with S/4HANA data and enter your own company code and account.
REPORT z_acdoca_balance.
PARAMETERS: p_rldnr TYPE acdoca-rldnr DEFAULT '0L',
p_bukrs TYPE acdoca-rbukrs DEFAULT '1000',
p_gjahr TYPE acdoca-gjahr DEFAULT '2024',
p_racct TYPE acdoca-racct DEFAULT '0000400000'.
START-OF-SELECTION.
SELECT SUM( hsl ) AS total_amount
FROM acdoca
WHERE rldnr = @p_rldnr
AND rbukrs = @p_bukrs
AND gjahr = @p_gjahr
AND racct = @p_racct
INTO @DATA(lv_total).
WRITE: / 'Total in company code currency:', lv_total.The query has four conditions on purpose. Each one removes a way to get a wrong answer.
rldnrselects one ledger. If you omit it, the sum includes every ledger that holds the account, and you can double count.rbukrsandgjahrlimit the sum to one company code and one fiscal year.racctlimits the sum to one account.
Two caveats apply. First, the query sums one fiscal year of postings and does not include a balance carried forward from earlier years, so for a balance sheet account you need to handle the opening balance. Second, HSL is in company code currency, so a company code with several currencies needs KSL or WSL where appropriate.
Compatibility views
Custom reports written for ECC often read GLT0, FAGLFLEXT, COEP, or BSIS. SAP did not delete those names. In S/4HANA, many of these objects are replaced by compatibility views, which are database views that return the old structure but compute it from ACDOCA. Old read-only code keeps working in most cases.
There are limits:
- The views are read-only. A custom program that writes directly to a replaced table fails or does nothing useful.
- The view computes results at query time. A report that formerly read a small aggregate table can now scan many line items, so test its runtime.
- Some fields in the old structures have no equivalent in the new model.
The authoritative list of which table is replaced by which view is in the Simplification Item Catalog, which a later chapter covers. Check it for your target release, because the list changes between releases.
What else the change brings
Document splitting and the segment
The Universal Journal uses the new general ledger design, so document splitting and the segment field are part of the model. Each line item can carry a segment and a profit center, which allows balance sheets per segment without extra tables.
Account-based CO-PA
Account-based profitability analysis reads from ACDOCA. It no longer needs a separate set of tables. Costing-based CO-PA is still available and keeps its own tables, so profitability designs need review before conversion.
Cost elements
Cost elements are G/L accounts in S/4HANA. A primary cost element is a G/L account with a cost element type, and secondary cost elements are maintained as accounts of a special type. The separate cost element master data from ECC is merged into the account master.
Extension fields
You can add custom fields to the journal. Add them through the field extension tools that SAP provides, not by modifying the table structure by hand. The fields then flow through posting and reporting.
Effects on migration
The Universal Journal changes the work of a system conversion in three ways.
- Data migration. During conversion, the migration tool fills
ACDOCAfrom existing FI, CO, asset, and Material Ledger data. Reconciliation before the conversion matters, because inconsistent ECC data is carried into the new table or causes errors during the run. - Custom code. Programs that read old aggregates need testing. Programs that write to replaced tables need rewriting.
- Finance process. The reconciliation steps at period end change. Teams should decide what they still check and what is now guaranteed by design.
Common mistakes
- Treating
ACDOCAas a replacement forBKPF. Header data remains inBKPF. - Forgetting the ledger filter, as covered above.
- Assuming a balance equals the sum of one year's line items. Opening balances come from carry-forward.
- Writing to old tables or inserting rows into
ACDOCAdirectly. Post through standard posting interfaces, such as BAPIs and the posting APIs, so that checks and splitting run. - Assuming that the reduced number of tables reduces storage in every case.
ACDOCAis wide and holds many rows, so the footprint depends on your data and on HANA compression.
Exercise
A colleague writes SELECT SUM( hsl ) FROM acdoca WHERE rbukrs = '1000' AND gjahr = '2024' AND racct = '0000400000' and gets an amount twice the value shown in the financial statements. The company uses a leading ledger and a non-leading ledger. What is the likely cause, and how do you fix the query?
Show answer
The query has no ledger condition, so it adds the postings of both the leading ledger and the non-leading ledger. Add AND rldnr = '0L' (or the ledger you intend to report on) to the WHERE clause.
Exercise
Name two ECC data stores whose roles are taken over by ACDOCA, and say why an FI-CO reconciliation step is no longer needed for postings in the Universal Journal.
Show answer
Examples are FAGLFLEXA (general ledger line items) and COEP (controlling line items), and also ANEP or MLIT. FI and CO views of a posting come from the same ACDOCA row, so the two cannot differ and there is nothing to reconcile for those postings.