Financial Reporting and Embedded Analytics

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Every accounting department ends a period with the same questions: what is the balance of each account, what do we own and owe, and did we make a profit? The answers are the trial balance, the balance sheet and the profit and loss statement. In SAP S/4HANA these reports are not built from separately stored totals. They are calculated from the line items of the Universal Journal when somebody asks, through a family of released CDS views, and analytical tools sit on top of those views. This page explains that chain, from the posted line to the report, names the views and tools SAP documents for it, and shows an ABAP SQL query that adds up amounts per G/L account. It is written against SAP S/4HANA 2025 FPS02 (on premise and Private Edition). The views and tools it names come from the on-premise help; the Cloud Public Edition has its own help, which this page does not cover, so check it before relying on a name there.

Before you read

Key terms

  • Trial balance: a list of every account with its starting balance, the debits and credits of a period, and the ending balance.

  • Balance sheet: the statement of assets, liabilities and equity at a date.

  • Profit and loss statement: the statement of revenue and expense over a period.

  • Universal Journal: the single list of journal entry lines for Financial Accounting and Controlling.

  • Embedded analytics: reporting tools that run inside SAP S/4HANA on its own data, without copying the data to another system.

  • Financial statement version: a hierarchy that groups G/L accounts into the lines of a balance sheet and a profit and loss statement.

From posted lines to a report

A posting stores lines, not totals. As the Universal Journal page explains, SAP states that totals such as the balance of an account are calculated on the fly when somebody asks for them. A report is therefore a question put to the line items: add up the amounts of these lines, grouped by this account, within this time frame. Three ideas carry the rest of the page.

  • A trial balance groups by account and shows four numbers per account: the starting balance, the debits of the period, the credits of the period and the ending balance.

  • A balance sheet and a profit and loss statement take the same account balances and arrange them under headings. The arrangement is a hierarchy of accounts, which SAP calls a financial statement version; a separate page covers it.

  • The line items belong to a ledger, a company code and a fiscal period, so every report fixes those first. A report on the leading ledger 0L of company code EX01 does not mix in a non-leading ledger.

A worked example: from lines to statements

Example Trading Co. (company code EX01, euro, leading ledger 0L) starts a month with 20,000 in the bank, matched by 20,000 of share capital. During the month it books three events. The amounts and accounts are made up for this site.

  1. A customer invoice for 7,000: debit accounts receivable 7,000, credit sales revenue 7,000.

  2. The customer pays 4,000: debit bank 4,000, credit accounts receivable 4,000.

  3. An office expense of 2,500 is paid from the bank: debit office expense 2,500, credit bank 2,500.

The trial balance of the month, with balances written as debit positive and credit negative (a presentation chosen for this page, not the sign convention of a particular SAP view):

Account Starting balance Debits Credits Ending balance

Bank

20,000

4,000

2,500

21,500

Accounts receivable

0

7,000

4,000

3,000

Share capital

-20,000

0

0

-20,000

Sales revenue

0

0

7,000

-7,000

Office expense

0

2,500

0

2,500

Total

0

13,500

13,500

0

Check it by hand. The debits are and the credits are , so they agree. Each ending balance is the starting balance plus the debits minus the credits, for example for the bank:

and the ending balances add up to zero, because every event was posted with equal debits and credits:

The two statements are the same balances under different headings. The profit and loss statement takes the revenue and expense accounts, profit. The balance sheet takes the others: assets of equal equity of , the share capital plus the profit of the period.

The views that serve reports

SAP’s virtual data model offers several released views over the same journal entry items. The help pages for them state a purpose, the business questions they answer and the authorizations they check. Their element lists are mostly given in words, and a technical element name is stated here only when the cited page gives it.

flowchart LR A[ACDOCA: journal entry lines] --> B[I_JournalEntryItem] B --> C[I_JournalEntryItemCube] B --> D[I_JournalEntryItemBrowser] E[I_GLACCTBALANCECUBE] --> F[C_Trialbalanceq0001] D --> G[Analytical apps and queries] F --> G

The arrows show only what the help pages state: the Journal Entry Item page names ACDOCA as its database table, the Cube and Browser pages say they are based on the Journal Entry Item view, and the Trial Balance page says its view is built on I_GLACCTBALANCECUBE. The last box stands for the tools of the next section.

View Type, as the help states What the help says it is for

I_JournalEntryItem

Cube

Access to all details of a journal entry item, with the most important business entities. It is the view you must use if you extend custom fields with the Custom Fields and Custom Logic apps. It does not expose the technical balance carried forward items of period 000.

I_JournalEntryItemCube

Cube

The same details, with some associations resolved so that fields of the header can be used. Its help page recommends using the Journal Entry Item Browser or the Journal Entry Item view instead, because a newer view is available.

I_JournalEntryItemBrowser

Cube

Based on the Journal Entry Item view, for the same business questions: which items were posted during the year, in which company code currency and for which amount.

I_JournalEntryItemBasic

Analytical data category: Cube

A detailed representation of journal entry items for analysis by ledger, company code, controlling area, cost center, profit center and others; its page lists its fields in a table.

C_Trialbalanceq0001

Consumption cube

Balances of various dimensions of the journal entry: G/L account, company code, cost center and profit center. It contains all balance carry forward postings and provides opening and ending balances.

Three details help in practice. First, the Trial Balance view takes two input parameters, P_FromPostingDate and P_ToPostingDate, that set the lower and upper limit of the reporting time frame, and its measures include the starting, debit, credit and ending balance in company code currency, which are the four columns of the worked example. Second, its help page says that for a report of only year-to-date (moving) balances it recommends the G/L Account Line Item Cube view. Third, the Journal Entry Item pages name measures for the amount in company code currency, in transaction currency and in global currency, and say the global currency corresponds in most cases to the group currency; in on premise you configure which currency is the global currency.

A balance sheet or profit and loss statement is built on a financial statement hierarchy. The released view I_FinancialStatementHier retrieves the header of such a hierarchy, whose hierarchy type is FSVN (financial statement version), and its special nodes such as Assets, Liabilities and Equity, and the net result nodes.

Embedded analytics

Embedded analytics means that reporting runs inside SAP S/4HANA, on the same data and the same virtual data model as the transactions, so a user can move from a business transaction to an analysis and back without any data replication. SAP’s overview lists tools for two kinds of people.

Audience Tools named on the help page

End users who analyze data and act on it

Multidimensional reports, analytical apps based on the Analysis Path Framework (APF), the Query Browser and analytical SAP Fiori apps.

Analytics specialists who prepare the data for end users

The Custom View app, the Custom Analytical Queries app, the APF Configuration Modeler, Manage KPIs and Reports, and the View Browser.

All of these consume CDS views, which together form the virtual data model. To use a CDS view of the type analytical query you must also set up the Analytic Engine, which evaluates and runs analytical queries at runtime. The end user reaches transactional and analytical apps from the same SAP Fiori launchpad. This page names no SAP Fiori app by number: the reference library of apps is the place to look up the apps that fit your release, because an app identifier given from memory is easy to get wrong.

Who may see which numbers

A report over the Universal Journal reads the same lines for every user, yet a general ledger accountant and a cost accountant should not see the same rows. The views therefore check authorizations. The Journal Entry Item page lists access to certain ledgers, company codes, financial account types and segments as prerequisites; the Cube and Browser pages list business areas in place of segments. The page on authorizations in analytics adds that SAP uses an authorization object, F_AcDocA_C, to set an authorization context, with predefined values such as GENLDGR for General Ledger Accounting and OVHDCOST for Overhead Cost Accounting, and then lists which CDS view fields are checked for each context.

The same page warns that assigning business catalogs with different authorization contexts to one user can override existing restrictions: a user restricted to some cost centers who gets an additional catalog with another context can end up seeing all cost centers. When a report shows a user more or fewer numbers than expected, check the assigned catalogs and contexts first. The page Users, Roles and Authorizations explains the general mechanism.

An ABAP SQL aggregate over journal entry items

Reading a view from ABAP is an ordinary SELECT; the aggregate SUM with GROUP BY lets the database add up the amounts, which is the core of a trial balance without the opening balance. A caution about names comes first. The help page of I_JournalEntryItem describes its attributes and measures in words ("Company code", "Amount in company code currency") and does not print the technical element names. The page of its sibling view I_JournalEntryItemBasic does, in a table of important fields: Ledger, CompanyCode, GLAccount, LedgerFiscalYear, CompanyCodeCurrency and the measure AmountInCompanyCodeCurrency, among others. The query below therefore uses I_JournalEntryItemBasic. The page prints the names in capitals; ABAP does not distinguish case. SAP’s page on the Journal Entry Item view is not enough to confirm that the same element names exist there, and the sign convention of the amount is not stated on the pages used, so confirm both in the data preview of the ABAP Development Tools before you rely on the numbers.

" Total amount per G/L account for one ledger, company code and fiscal year.
SELECT FROM I_JournalEntryItemBasic
  FIELDS GLAccount,
         CompanyCodeCurrency,
         SUM( AmountInCompanyCodeCurrency ) AS TotalAmount
  WHERE Ledger = '0L'
    AND CompanyCode = 'EX01'
    AND LedgerFiscalYear = '2026'
  GROUP BY GLAccount, CompanyCodeCurrency
  ORDER BY GLAccount
  INTO TABLE @DATA(totals).

Requires an SAP system; not run here. The playground of this site has no database views of the virtual data model, and it does not support GROUP BY or SUM. What the statement does: it keeps the lines of the leading ledger 0L of EX01 for fiscal year 2026, forms one result row per G/L account and currency, and puts the sum of the amounts into the column TotalAmount. The currency is in the field list and in GROUP BY so that every sum is a single-currency figure. For the worked example above, a query over the month would return one row per account, the debit and credit lines of a given account netted into one figure, which is the movement of the period; the starting balance of the trial balance needs the lines of earlier periods as well, and that is why SAP provides C_Trialbalanceq0001 with its date parameters.

Two points matter when you write such a query yourself. Whether a view is released for use in your development model, for example in ABAP Cloud, is shown by its release state in the ABAP Development Tools, not by this page. The view may also check authorizations as described above, so a test user sees only the rows that the roles allow.

Common mistakes

  • Reading ACDOCA directly for a new report. The released views carry the authorization checks and the documentation; see the Universal Journal page.

  • Building a report on a view that SAP has superseded. The Cube page itself points to the Journal Entry Item and Browser views.

  • Using a deprecated element. The help pages list deprecated elements with successors, for example SalesOrder with SalesDocument; SAP states that creating new content on a deprecated element is not allowed.

  • Using the trial balance view for a year-to-date report. The Trial Balance page says that view provides opening and ending balances and recommends the G/L Account Line Item Cube for year-to-date (moving) balances.

  • Adding amounts without the currency. Group by the currency or convert first.

Summary

  • Reports on the Universal Journal calculate balances from line items when asked; a trial balance shows starting balance, debits, credits and ending balance per account.

  • A balance sheet and a profit and loss statement are the same account balances arranged through a financial statement version.

  • SAP documents several released views over journal entry items, including I_JournalEntryItem, I_JournalEntryItemBrowser, I_JournalEntryItemBasic and the Trial Balance view C_Trialbalanceq0001, which takes a from and a to posting date.

  • Embedded analytics offers tools for end users and for analytics specialists, all consuming the CDS views of the virtual data model.

  • An ABAP SQL SUM with GROUP BY totals the amounts per G/L account; check element names and sign convention in your own system.

  • Authorization contexts decide which rows each user sees, and combining catalogs can override restrictions.

Try it

To do this by hand, follow the guide Allocate Costs and Read a Trial Balance: it allocates costs between cost centers and reads a trial balance.