Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Showing results for 
Search instead for 
Did you mean: 
Many of the previous blogs and articles about Margin Analysis have focused on the difference between working with value fields and accounts while ignoring the market segments. In this blog I'm going to explain what we mean by a market segment in the context of the universal journal and how this definition is evolving thanks to recent developments in SAP S/4HANA. I'll describe two use cases that illustrate how the market segments are filled in Margin Analysis.

  • The first shows the sale of a manufactured product in a make-to-stock environment, where the market segment is the multi-dimensional account assignment for the revenue and cost of goods sold (the true account assignment) and the benefit of a move to Margin Analysis is that the account information and the associated market segment are captured in the same document, the first document being for the delivery and the second for the invoice. If there is a significant time gap between the delivery and the invoice, the matching principle needs to be followed and additional journal entries generated to accrue the future revenue to ensure that the profitability of the business transaction is shown in the correct accounting period.

  • The second shows the sale of a service-related project where the cost of goods sold are determined by looking at the costs captured on a project (a Controlling object). In SAP ERP settlement was needed to move the costs from the original account assignment (the project) to the market segment at period close. In SAP S/4HANA the process of capturing the costs on the project remains as before, but it’s possible to enrich these cost postings with attributes that represent the market segment in which the service is performed. To give a simple example, if travel expenses are posted to a project, the journal entry will capture these costs with respect to the project, but the document will also include the assignment to the customer and product related market segments that would previously have been updated during settlement. We call these attributed items – we have captured the affected market segments in the universal journal, but the true account assignment remains the project and any follow-on processes take place with reference to the project. In this scenario the matching principle can be supported using event-based revenue recognition which results in the automatic creation of follow-on postings for revenue recognition and work in process, instead of waiting for results analysis and settlement to prepare the relevant postings at period close.

Market Segments in the Universal Journal

Before we look at the use cases in detail, it’s important to understand what we mean by a market segment within the universal journal. The market segment describes the elements by which you want to analyze your revenues and costs and these elements are fields in the universal journal just like cost centers, orders, and projects. SAP delivers a number of standard fields for this purpose, but you can add your own to meet the specific needs of your organization and these are included in the part of the universal journal reserved for the profitability fields. Figure 1 shows the various parts of the universal journal considered in Margin Analysis.

Figure 1: Relevant Sections of the Universal Journal

These three sections are implemented as INCLUDE structures in the universal journal (table ACDOCA).  Figure 2 shows the INCLUDE structure ACDOC_SI_CO which contains the Controlling (CO) fields (Type, Cost Center, Internal Order, WBS Element, and so on, plus Profitability Segment) and the INCLUDE structure ACDOC_SI_COPA which contains the Profitability (CO-PA) fields (Customer, Product, Customer Group, Product Group, and so on). The definition of the market segment straddles these two parts of the universal journal and it's important to understand whether the profitability segment is the true account assignment within the journal entry and thus anchored directly in the ACDOC_SI_CO structure or an enrichment of another account assignment, such as a cost center or order, to tag the affected market segment.

Figure 2: Controlling (CO) fields and Profitability (CO-PA) fields in the universal journal

The rules for the update of the Controlling (CO) fields are driven by the account/cost element. Non-operating income and expenses cannot be assigned to a market segment. Market segment information is captured with respect to a profit and loss account, which can either be of type P (primary costs and revenue) or S (secondary costs).  The G/L account forces an update of an account assignment (ACCAS) and an account assignment type (ACCASTY) plus the associated object (a cost center, order, WBS element, or a market segment).  In the case of a customer invoice, the system updates a revenue account and an account assignment of type EO (profitability segment) and in the case of a delivery, a cost of goods sold account and an account assignment of type EO (profitability segment). The market segment is derived from the sales document in each case. If you run allocations, settlement or use top-down distribution the market segment is the receiver of these costs and the sender either a cost center, an order/project or a higher-level market segment.

The structure of the profitability segment is defined in the CO-PA fields part of the universal journal and a field is created for every characteristic in the operating concern during conversion to SAP S/4HANA. SAP delivers the following standard fields: Billing Type, Sales Organization, Distribution Channel, Division, Product Sold, Product Sold Group, Customer Group, Country/Region Key, Industry Key, Sales District, Bill-To Party, Ship-To Party and Group. In SAP S/4HANA Cloud you can use the Custom Fields and Logic app to add further fields to the Market Segment context. In SAP S/4HANA you can choose whether you use the Custom Fields and Logic app (F1481) to add fields or take the traditional approach of adding additional fields (the WW-fields) to the operating concern using transaction KEA5.

Some of the profitability fields are filled directly from the sales documents (the Billing Type, Sales Organization, Distribution Channel, Division, Product Sold, and so on) and a derivation is used to fill the other fields, so you might set up rules to determine how the Product Sold Group and the Customer Group are to be filled from the associated product and customer master data. In SAP S/4HANA Cloud you must use the Manage Substitution and Valuation Rules app (F4406) to perform these derivations. In SAP S/4HANA you can choose whether to use this app or take the traditional approach of using transaction KEDR to define the derivation rules.

What’s new in SAP S/4HANA is that as well as creating journal entries where the profitability segment is the true account assignment, you can also update the Controlling fields such that the true account assignment is a cost center, order, WBS element, and so on, and have the system enrich the document with the associated market segments. The advantage of this approach is that these fields are immediately visible in reporting so that users don't need to wait for settlement to move the costs from the order or project to the market segment at period close. The market segment is then not the true account assignment but rather an attributed line. The allocation and settlement processes continue to select data records for further processing using the true account assignment, but users have immediate visibility into the market segments in the profitability reports that read directly from the universal journal (the Fiori apps).

Figure 3 shows how to activate the attribution option for Cost Centers, Internal Orders, Projects, Sales Orders, Production Orders, Maintenance Orders and Service Documents in the IMG (Controlling > Profitability Analysis > Master Data > Activate Derivation for Items without Profitability Segment). If you do this, the true account assignment is the object shown on the left of the screen (the cost center, internal order, and so on) and this is reflected in the account assignment type (ACCASTY) KS for cost centers, OR for internal orders, PR for projects, and so on. The activation flag triggers an additional derivation step to enrich the journal entry with the affected market segments in the Profitability fields part of the universal journal.  You can, of course, continue to use market segments as receivers of allocations and settlements at period close. This can allow you to make an initial assignment of your cost center costs to a high-level market segment, such as a region, and then use an allocation or top-down distribution to break down these costs to a more granular market segment, such as your products or customers at period close when detailed sales information is available to use as a driver for the allocation.

Figure 3: Activation of Derivation for Items without Profitability Segment

Notice in Figure 3 that you can activate the additional derivation for the P&L Accounts, but also for Balance Sheet Accounts. This is used whenever event-based revenue recognition generates postings to balance sheet accounts with reference to an account assignment, such as a project, on the P&L side of the posting, which is why I am going to talk about the logic for the event-based postings alongside the update of market segments for the P&L accounts in this blog. From a business point of view this represents a fundamental shift in understanding from Profitability Analysis in SAP ERP which focused on the cost of goods sold and can now include the inventory being accumulated with respect to the order or project.

Contribution Margins for the Sale of Goods

We’ll start by looking at the contribution margins for the sale of a manufactured item from stock. This will involve the creation of three documents: the sales order item to initiate the process, the outbound delivery to record the cost of goods sold and the customer invoice to record the revenues. Since we anticipate a time lag between delivery and invoicing, we’ll use revenue recognition to trigger adjustment postings when the goods are issued from stock and reverse them when the final revenue is posted.

When you create a sales order item, the system will automatically fill the profitability segment as shown in Figure 4. The fields for the Customer, Product, Billing Type, Company Code, Plant, Sales Organization, Distribution Channel, and Division are copied from the sales order item and additional fields can be derived using the rules we discussed above. You can access this view from the Account Assignment tab in the sales order item.

Figure 4 - Assignment of Sales Order Item to Profitability Segment

In this simple make-to-stock example, we created the outbound delivery and triggered a material document and the two accounting documents shown in Figure 5. The first accounting document records the goods movement from finished goods inventory to cost of goods sold and the second the revenue adjustment in accordance with the recognition key for the sales order item.

Figure 5 - Accounting Documents Following Goods Issue

Figure 6 shows the results of this business transaction in the Product Profitability with Production Variances app, where we see the COGS line from the first accounting document and the revenue adjustment from the second accounting document. Both the COGS line and the revenue adjustment line have the account assignment EO, and are linked with market segments, so that we can display the associated customer, product, and so on that we saw in Figure 4 by choosing Drilldown and selecting the customer dimension.

Figure 6 - Product Profitability App Following Goods Issue

Figure 7 displays the customer served and we could continue to include further drilldowns for each of the market segments in the same way. In this context, it's worth knowing that fields added using the Custom Fields and Logic app are automatically included in these Fiori apps, but if you add fields to the operating concern using transaction KEA5, you'll have to adjust the CDS views to include these fields manually as part of your implementation project.

Figure 7 - Product Profitability by Customer

To understand how the journal entries for revenue recognition have been made, use the Event-Based Revenue Recognition – Sales Orders app shown in Figure 8. The purple column shows the actual costs resulting from the outbound delivery and the orange block the revenue adjustment generated in accordance with the recognition key. Notice that this is normally a display app, but you can also use it to trigger a revaluation, if the planned values behind your revenue assumptions have changed or you want to make a manual allowance for a situation on the sales order.

Figure 8 - Event-Based Revenue Recognition Following Goods Issue

We’ll now continue the process by creating the customer invoice to record the revenue for the business transaction as shown in Figure 9. This again results in an accounting document that is linked with the market segments shown in Figure 4.

Figure 9 - Journal Entries Following Invoicing

If we compare the Product Profitability with Production Variances app shown in Figure 10 with the one in Figures 7 and 8, we see a new line for billed revenue and that the revenue adjustment has been cancelled following final invoicing.

Figure 10 - Product Profitability Following Invoicing

If we compare the information in Figure 11 with Figure 9 we see a new block (red) for billed revenue.

Figure 11 - Event-Based Revenue Recognition Following Invoicing

In this scenario we have focused on the revenues and COGS (primary costs) assigned to an account assignment of type EO. Figure 12 shows the revenue and COGS lines for our customer and product in the Display Line Items - Margin Analysis app, an approach that will be familiar to anyone who has worked with account-based Profitability Analysis in the past.

Figure 12 - Line Items for Revenues and Cost of Goods Sold with Assignment to EO

If we extend the line item selection to include other G/L accounts assigned to market segments, then we see the postings that were generated during event-based revenue recognition. The revenue adjustment account is also a primary cost account and is offset against a balance sheet account for accrued WIP. In Figure 13 we have selected Line Item Details to show the account assignment fields for the WIP account, where we see the G/L Account Type X (balance sheet) together with the Account Assignment Type EO (market segment). This is a clear change in focus from the traditional account-based Profitability Analysis which only included P&L lines.

Figure 13 - Line Item for WIP Accrued Revenue

I've concentrated here on the market segments and the matching principle. For information on Margin Analysis in general, please refer to nitin.gupta10's post: Margin Analysis in SAP S/4HANA or Anton Miranda's post: Real Time Profitability Analysis. For more information on transition scenarios to SAP S/4HANA, please refer to the SAP Note: S4TWL - Profitability Analysis.

Event-based revenue recognition for make-to-stock was introduced as a pilot release with OP2021 (for details, please refer to the SAP Note: Event-Based Revenue Recognition - Pilot Note) and has been available in the cloud via the scope item 1K2 since 2020.

Contribution Margins for the Sale of Services

In the next section we'll take this idea further to look at a different scenario, where the costs are posted against one of the CO objects shown in Figure 3 and the market segments derived as attributes. Figure 14 shows the Project Profitability app with the columns Billed Revenue, Actual Cost, Recognized Revenue and Recognized COGS. Billed revenue is captured against the project when the customer is invoiced, and costs are captured when expenses are charged, or time recorded against the project, but instead of waiting for settlement to move the revenues and costs from the project to the market segments at period close, we can immediately see the link to the customer and the product sold because the derivation logic that we discussed earlier has been used to derive the associated product and customer either from the settlement rule or from the associated sales order item, removing the need to run settlement.

Figure 14 - Project Profitability App, showing market segment attributes

The postings against the project take place with reference to the WBS element as before. Figure 15 shows some of the line items that resulted in costs for the project P1, all resulting from time recording (business transaction type RKL) on the project. These have credited the cost center (Account Assignment Type KS) and debited the project (Account Assignment Type PR).

Figure 15 - Line Items for Project in the General Ledger

We can display the true account assignment for these postings by choosing the line items details and looking at the Account Assignment Fields in Figure 16 where we see the G/L account type S for secondary costs (the time recording), the account assignment type PR and the account assignment P1.1.1 (the WBS element). However, we can see in Figure 14 that in addition to the posting to the true account assignment (the WBS element) we also have an update of the affected market segment (the product sold and customer) without any need to settle the project costs.

Figure 16 - Account Assignment Details for Posting of Consulting Hours to Project

To understand the contents of the Recognized Revenue and Recognized Costs columns in Figure 14, we must look at the Event-Based Revenue Recognition - Projects app, shown in Figure 17. Just as we saw in the previous example, each cost posting to the project results in revenue being recognized in accordance with the recognition key and each revenue posting with accrued revenue being cancelled until we have the situation shown here where the billed revenue and recognized revenue are identical as are the actual costs and recognized cost of goods sold because the project is complete.

Figure 17 - Event Based Revenue Recognition for Project

For clarity I've concentrated here on the derivation of the market segments and support for the matching principle. Please also refer to the SAP documentation on Margin Analysis: SAP Help: Margin Analysis. For more information on how to configure the derivation, please refer to anand003's post: Real-Time CO-PA/Margin Analysis. For more information on event-based revenue recognition, please refer to Stefan Walz and Gabi Hoffmann's post: An Introduction to Event-Based Revenue Recognition.

Closing Remarks

So far we looked at the update of the market segments for make-to-stock manufacturing and projects for professional services, but the next stage of the journey will be to implement the same approach for valuated project stock, where we must deal with physical inventory and its correct inclusion in the balance sheet for a customer project. This use case will be described in a future blog.

If you're new to the topic, please also consider reading Chapter 7 of my book.

Controlling with SAP S/4HANA: Business User Guide