Skip to Content
Technical Articles
Author's profile photo Christian Rainer

Live insights and faster financial close with real-time derivation in Margin Analysis in SAP S/4HANA

In this blog post I will explain how you can achieve live financial insights in real-time and speed up the financial close with the new real-time derivation in SAP S/4HANA. The real-time derivation is available in SAP S/4HANA in Margin Analysis, which is the new Profitability Analysis (CO-PA) within the Universal Journal. I will share my experiences and show practical examples and discuss the following topics:

  • Benefits of real-time derivation in Margin Analysis
  • What is a real-time derivation in Margin Analysis?
  • Examples and typical business cases for real-time derivation
  • Limitations of the real-time derivation and
  • Realignment of profitability segments

This blog post is initially based on release SAP S/4HANA 1909 but the explained concept is also applicable for higher releases. I added updates from latest releases up to SAP S/4HANA 2022 FPS1 in the What’s New section at the end.

Benefits of real-time derivation in Margin Analysis

In the past the derivation in CO-PA (Profitability Analysis) could be used to fill many of the CO-PA dimensions (typically product, customer and/or region) and CO-PA provided a first and second contribution margin. But for certain business cases you first had to post expenses and revenues to cost objects like WBS (Work Breakdown Structure) elements or internal orders or sales orders. And in the second step you had to do the settlement from these objects to CO-PA. Also, for overhead costs you first had to post expenses to cost centers and settle them at the period end close later. Thus, the profitability analysis was not complete until the allocations and settlement processes had run at period end close to bring the overhead and missing values into CO-PA. This typical scenario is illustrated in the picture on the left side.

With the new Margin Analysis in SAP S/4HANA you can set up derivation rules to derive market segments from cost centers, orders and WBS elements as you post. This means that you can have richer data in Profitability Analysis during the period. You can have live business insights in real-time and do not have to wait until period end close. That is why this new kind of derivation is also called real-time derivation. This scenario that is now possible with Margin Analysis in SAP S/4HANA is illustrated on the right side of the picture. You can find a summary of the main differences in the table:

Traditional ERP:
Costing-Based Profitability Analysis
Margin Analysis
Separate data model Universal Journal
Reconciliation challenges Reconciled by design
Not real-time Real-time derivation

While costing-based CO-PA is still supported in SAP S/4HANA the recommendation is to use the new Margin Analysis (which is technically account based and thus fully integrated to the Universal Journal) to benefit from the existing and future innovations in SAP S/4HANA.

A faster period end close can be done in SAP S/4HANA due to the elimination of reconciliation tasks (like Finance vs. Controlling), but maybe also due to the elimination of period end closing tasks like settlements or allocations for certain business cases. The question arises what are typical business cases and what are the limitations of the real time derivation? I will answer these questions later but let me first explain the functionalities of the new real-time derivation in Margin Analysis in SAP S/4HANA in more detail including the customizing and some examples. Further documentation about Margin Analysis is also available in SAP Help: Margin Analysis.

What is real-time derivation? 

There are now two cases with profitability segments recorded in the journal entry in SAP S/4HANA:

  1. Income statement items which carry a true account assignment to a profitability segment (ACDOCA-ACCASTY = EO)
  2. Income statement items with another cost object (not to profitability segment and ACDOCA-ACCASTY <> EO) where a profitability segment can also be derived.

In terms of accounting, postings from the second case are considered as „attributes“ (aka attributed profitability segments). They are stored in the same fields in the Universal Journal in table ACDOCA but can be reported separately from the final allocations and settlements at period close (when all driver data for the allocations should be available). The attributed characteristics are based on the “best-guess” principle, using the information that is available at that point in time. A refinement of the profitability characteristics at period end is still possible with the closing transactions such as settlement and allocation followed by top-down distribution.

Activation of derivation in customizing

The real time derivation for postings without true profitability segment can be activated in Customizing for the following controlling types:

  • Cost Center
  • Internal Order
  • Project
  • Sales Order
  • Production Order
  • Maintenance Order
  • Service documents (service orders or service contracts)

Maintenance and service orders are available with release 1809 (for release 1610 and 1709 see SAP Note 2497666 – S/4HANA Finance: Attributed profitability segments for service and maintenance orders).

In the implementation guide (IMG: Controlling->Profitability Analysis->Master Data->Activate Derivation for Items without Profitability Segment) you can activate the real time derivation separately for each supported cost object type and also for further criteria within an object type (e.g. only for a certain cost center category or project profile):

There are two special cases where even balance sheet accounts without an assigned cost element, or G/L accounts of type N – Nonoperating Expense or Income, are attributed:

  • WIP (Work in Process) postings from event-based revenue recognition
  • External settlement of results analysis data to FI (Finance)

That is why there is a separate activation flag for balance sheet accounts for projects and other revenue carrying objects available but not for cost centers:

It is also possible to supply material inventory lines with profitability characteristics which, in particular, can be derived from the moved product and corresponding plant (see SAP Note 2843578 – S/4HANA Finance: Attribute assignment for material inventory lines I).

Characteristic derivation tool and logic

The derivations of the attributed characteristics are done with the well-known powerful CO-PA derivation tool (SAP Help Characteristic Derivation).

The logic for the determination of attributed profitability segments depends on the account assignment category of the item. For internal orders, projects, sales and service orders the determination of the profitability follows a certain logic. The derivation can also read data from a settlement rule or from an assigned sales order. Thus, if you are settling to CO-PA, you can set up a derivation to read the settlement rule or the sales order item and extend the posting line to include the CO-PA characteristics whenever you post to an order or project. A detailed documentation of the derivation logic is available in SAP Help: Profitability Characteristics in Journal Entries.

Further information is available in SAP Note 2439201 – S/4HANA Finance: Derivation logic when determining “attributed” profitability segments, it contains:

  • frequently asked questions,
  • available BAdI’s to influence the standard logic and
  • derivation logic for plan data.

For derivation during plan data import with the Financial Plan Data app (App ID F1711), read more in:

Examples and business cases for a real-time derivation


Example 1: Posting to a cost center and immediate assignment of the respective profitability segment

In this simple example the material group (e.g. B900 for SAP S/4HANA) is derived from the cost center (e.g. 1000 for Development Financials) via a derivation table whenever a posting (e.g. 2.000 EUR salaries) is done to this cost center.

G/L Account Cost Center Material Group Debit Credit
Salaries and wages
Development Financials
 2.000 €

For the demo I use a derivation table to derive the material group from a cost center (transaction KEDR). You can also use other derivation types (see SAP Help – Derivation Types).

In this table a derivation rule is maintained to derive material group B900 for postings to cost center 1000:

When you post a general journal entry to the cost center the material group is derived:

The result in the Universal Journal (table ACDOCA) is a posting to cost center 1000 as a true account assignment and an attributed profitability segment with the derived material group B900:

The profitability segment is available for reporting in Fiori Apps, e.g.:

Transactional App Display Line Items in General Ledger (App ID F2217):

Analytical App Journal Entry Analyzer (App ID F0956A):

Example 2: Postings to a WBS element and derivation of characteristics from assigned sales order

In this example a sales order is created for customer 1710001 and product TG10. For demo purposes to show the derivation of attributed profitability segment, the sales order is assigned to WBS element 1000:

Post a goods issue with true account assignment to the WBS element:

Post a customer invoice with true account assignment to the WBS element:

The following picture shows the Universal Journal (table ACDOCA) with the line items coming from these 2 documents with true account assignment to WBS element 1000 and the attributed profitability segment:

The CO-PA characteristics (like customer, product and so on) are derived from the assigned sales order. All reporting relevant dimensions are immediately available in the Universal Journal and in Fiori Apps for reporting.

Transactional App Display Line Items in General Ledger (App ID F2217):

Thus, in SAP S/4HANA you maybe do not need to do the settlement to CO-PA at period end for certain business cases.

What are the limitations of the real-time derivation of attributed profitability segments?

Limitations of real-time derivation 

Follow up processes in CO-PA

Income statement items with true account assignment to a profitability segment are part of processes such as settlement, allocation, and top-down distribution. Attributed items only appear in reports and cannot be further allocated and are not part of a top-down distribution.

Recherche reporting in KE30

Actual data carrying attributed profitability segments are not displayed in recherche reporting in transaction KE30 or in account-based line item display in transaction KE24 (SAP Note 2439201, question 8).

Complex settlements

Anything that would create multiple lines won’t work in real-time. It is only possible to extend the posting line to post to e.g. cost center and certain CO-PA characteristics as shown in the examples. But you cannot split and distribute one posting line to different receivers as you can do with a settlement (e.g. distribute 50% to product group A and 50% to product group B).

A settlement of orders and projects will therefore still be required in the following cases:

  • Settlement is performed to multiple receivers and not done 100% to one profitability segment only
  • Settlement is not done to CO-PA but to other receivers (cost center, assets, G/L account…)
  • You must do a results analysis or calculation of work in progress (WIP) at the period end close

Event-Based Revenue Recognition

Another option would be the Event-Based Revenue Recognition, which enables as already mentioned above real-time margin reporting, but is currently supported only for certain scenarios OP. You can find more information about the Event-Based revenue recognition in the blog and in SAP Help:

Closing and archiving

If you have identified business cases where you do not have to settle orders and/or projects anymore, you should assign a settlement profile that is not relevant for settlement to these objects. Otherwise you will have issues when you want to set the status of the orders and/or projects to closed, which is usually one of the prerequisites for archiving.


Another important topic is reporting. Attributed CO-PA characteristics are available in the Universal Journal and in reporting. But if you are used to costing-based CO-PA and the old ERP world it might look strange to have CO-PA like reporting capabilities for postings on cost centers or projects. This could require some rethinking, because there is no separated CO-PA anymore with Margin Analysis in SAP S/4HANA like it was (or still is) with costing-based CO-PA. In Margin-Analysis all (attributed and real) CO-PA characteristics are directly available in the Universal Journal and data is not recorded in an additional dedicated persistency apart from external accounting like in costing-based CO-PA. If you want to know only real CO-PA postings in Universal Journal reporting, it is still possible, and you must select all postings with account assignment object (ACDOCA-ACCASTY) = profitability segment (EO).

If settlements, allocations and/or a top-down distribution are still required, I recommend checking the impact on reporting if you want to activate the real-time derivation.

The picture shows the impact for reporting in such a case. Settlement is still required due to a split of the profitability segment (e.g. settlement to 2 different product groups) and a change of another characteristic (e.g. customer group was not available or known at the time of posting):

  • Benefit: Real time Margin Analysis within the period
  • Disadvantage: Reporting within the period is based on best-guess principle only. After period end close you get different results on the changed CO-PA characteristics (e.g. product group and customer group).
  • Recommendation: If you expect a considerable change of the attributed CO-PA characteristics at period end close and you do not want to show best-guess results only in reporting within period, then do not activate real time derivation for such cases. Only activate real-time derivation for cases where you certainly know the final profitability segments (no further settlements or allocations to CO-PA or top-down distributions in CO-PA).

Realignment of profitability segments

Changes of the derivation or updates in the settlement rules are another important aspect, because they are not reflected in the already posted account-based line items. A workaround would be to use the new realignment functionality in the Universal Journal to update changeable CO-PA characteristics with transaction KEND. There you can set flag “Rederivation of ACDOCA Chars for Attributed Line Items” in the conversion rules (SAP Help – Realignment):

Compared to the realignment functionality in costing-based CO-PA there are some changes and limitations. Changes in the Journal Entries must always follow the guidelines of standard accounting principles. Therefore, realignment in Universal Journal can only be processed for non-GL-relevant information (e.g. profit center, functional area, account, values etc. will never be changed by realignment functionality). Changeable CO-PA characteristics are pre-defined, and selection cannot be changed by users.

The results of the realignments can be analyzed with the App Realignment Results – Profitability Analysis (App ID F2549):

  • With this app you can see the adjustments that were made to your posted profitability reporting dimensions by the realignment for Profitability Analysis
  • You gain insight into the changes resulting from realignment runs by reviewing the profitability characteristics as originally posted and after realignment

What’s New

SAP S/4HANA 2020:

  • Custom Fields for Profitability Analysis (CO-PA):

    You can add fields to Profitability Analysis using the Custom Fields and Logic app. Custom fields that are created in the Custom Fields and Logic app can be used along with custom fields that are created using the KEA5 – Edit Characteristics transaction. The main advantage of using the Custom Fields and Logic app is the compatibility with Core Data Services (CDS).

SAP S/4HANA 2021:

  • Term Replacement

    In SAP S/4HANA, the recommended method for profitability analysis is margin analysis. To align the user interface and the documentation and thus achieve maximum consistency, the term “account-based profitability analysis” has been replaced with the term “margin analysis” in the the product assistance on the SAP Help Portal (Profitability Analysis (CO-PA)) and system objects such as IMG activity texts, UI texts in transactions, the Easy Access menu, and messages.

SAP S/4HANA 2022:


In this blog post I have shown how you can use the new attributed profitability segments for real-time margin analysis in SAP S/4HANA. For certain business cases it is also possible to eliminate the settling of orders and projects to Profitability Analysis. But it is important to know and understand the derivation logic and the limitations and consider also the impact on reporting.

I’m looking forward to your feedback. Please share your experiences and thoughts in a comment.

Christian Rainer
Product Expert
SAP S/4HANA Regional Implementation Group

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Kris Stono
      Kris Stono

      Hi Christian,


      Great blog! I do have a related question around real-time derivation and Central Finance 🙂

      I am assuming that there will be additional rest "restrictions" in a scenario involving CFin. I can probably make the derivation work with cost centers and wbs (if settlement is maintained in Cfin) but what about Sales Order related derivation? The standard solution would probably not work as the SO is missing in the transfer so the example in the blog where WBS is the true assignment and SO is references would likely not work fully in Cfin. So, would replicating AVL tables help here i.e. direct the derivation to the AVL tables in Cfin...?







      Author's profile photo Christian Rainer
      Christian Rainer
      Blog Post Author

      Hi Kris,

      thanks for your feedback and question and sorry for my late reply due to my vacations.

      That is a good point. You are right, the derivation from sales order would not work, because there is no sales order in the target system in a CFIN scenario. The replication of AVL could help here and you can access these data in the derivation. But you would have to check how to access the required data (the link from WBS to sales order in AVL) and implement the derivation by your own (e.g. a user-exit in CO-PA derivation). It is not delivered in standard.