How to Split Cost of Goods Sold (COGS) with SAP S/4HANA Finance

SAP S/4HANA Finance enables you to split the cost of goods sold (COGS) into the individual cost components according to the cost component structure of the material cost estimates.


COGS are posted in financial accounting and margin analysis when the goods issue to a delivery is posted. We know from the past that, originally, the goods issue in margin analysis has been posted to one G/L account according to the valuation class of the material. This account is defined in account determination of materials management with Transaction GBB-VAY (GBB stands for Offsetting Entry for Inventory Posting and VAY stands for Goods Issue for Sales Order). The posting for the goods issue still happens on the account that is maintained in the material account determination. In addition, SAP S/4HANA Finance enables you to split these costs according to the components of the cost component structure of the material cost estimate that has been used for inventory valuation.


Create G/L Account for Splitting COGS

Before you start configuring the split of the COGS, you need to create a G/L account with cost element category 1 for every cost component of the cost component structure. In the figure below, G/L Account 50301000 for COGS Direct Material is being created. Direct material is a cost component in the cost component structure. Cost element category 1 has been chosen for Primary costs/cost-reducing revenues, and Primary Costs or Revenue has been chosen for G/L Account Type in the Type/Description tab.


Create the G/L Account for the COGS Split


After you’ve created all the G/L accounts necessary for the COGS split, you can start with the configuration. To configure the split of the COGS in margin analysis, follow the configuration path Financial Accounting > General Ledger Accounting > Periodic Processing > Integration > Materials Management > Define Accounts for Splitting the Cost of Goods Sold.


Create a Splitting Profile

With New Entries or (F5), you can create a new splitting profile. For this example, you’re creating Cost Splitting Profile Z100 in the following figure and assigning it to CO Area Z100. The chart of accounts in the Chrt/Accts column will be derived automatically from the controlling area. If you activate the checkbox in the Acc Based Split (account based split) column, the system will always split the cost into the cost components when there is a posting on the Source Accounts you’ll determine in the next section.


For this example, don’t select the checkbox because you only want the system to split the COGS based on movements of the sales order. Mark your Cost Splitting Profile by selecting the checkbox at the beginning of the line, and navigate in the left section of the screen to the Source Accounts folder.


Create the Cost Splitting Profile


Maintain Source Accounts

Use New Entries or (F5) to maintain the Source Accounts (see next figure). The Source Accounts are the G/L accounts that get hit when the goods issue for the delivery is posted. The accounts for the goods issue are maintained in the materials management account determination with Transaction GBBVAY. In the example, you’re maintaining G/L account 54083000 for inventory change COGS as the Source Account. In the Valuation View column, you can maintain a specific valuation, such as a group valuation.


If you don’t maintain a valuation, the splitting will happen for all valuations that exist. Mark your Source Account by selecting the checkbox at the beginning of the line, and navigate in the left section of the screen to the Strategy Sequence folder.


Maintain Source Accounts


Define the Strategy Sequence

In the Strategy Sequence, you define for every source account a strategy after which the system is trying to split the cost. If the system doesn’t find a material cost estimate in the first sequence, it goes on to the next sequence, and so on. The example in the figure below is creating Strategy Z01 with Sequence Number 1, and the system will split the cost with the Current Standard Cost Estimate. This is the cost estimate that is active in the material master at the time of goods issue posting.


You can also split your COGS with the actual cost component split of the Material Ledger. If you’re using actual costing in the Material Ledger, you can select the Split Revalued Consumption with Actual Cost Component Split checkbox. Next, move to the Target Accounts folder in the Splitting of Cost of Goods Sold section on the left side of the screen.


Maintain the Strategy Sequence


Maintain Target Accounts

Below, you’re shown how to maintain a target account for every cost component of the cost component structure. The target account has to be a G/L account with cost element type 1 (primary costs/cost-reducing revenues); otherwise, you can’t save the cost splitting profile. With the (F4) Help, you can display the possible entries in every column. For one line, you have to select the checkbox in the Default column. If the system can’t determine a target account for a cost component according to the cost splitting profile, this cost component is assigned to the account in whose line a checkmark is set in the Default column. After you’ve maintained all your Target Accounts, navigate to the left side of the screen to the Offsetting Accounts folder.


Maintain Target Accounts


Maintain Offsetting Accounts

Below, you see how to maintain the Offsetting Accounts. Usually the COGS account is used as an offsetting account for the COGS component split. If you’re using the Material Ledger, you can compare the originally posted costs with the actual costs according to the Material Ledger. This isn’t the case in this example, so there’s no need to maintain an offsetting account. Move to the Company Code Settings folder on the left side of the screen.


Maintain Offsetting Accounts


Activate the Splitting Profile in the Company Code

Before you can save the cost splitting profile, you have to activate it for the company code. In the figure below, add with New Entries or (F5) a new entry for Company Code Z100. Assign Cost Splitting Profile Z100 with a Valid From date of 01.01.2020 to Company Code Z100. Mark your Company Code by selecting the checkbox at the beginning of the line, and navigate in the left section of the screen to the Document Type Mapping folder.


Activate the Cost Splitting Profile in Company Code Settings


Assign the Document Type

You can assign a different document type for the posting of the COGS splitting in the figure below with New Entries or (F5). Because for this example the COGS split shouldn’t be posted with a different document type, don’t maintain any entries here but save the cost splitting profile with or (Ctrl)+(S).


Maintain Document Type Mapping


Review COGS Split in the Predictive Journal Entry

Let’s create a sales order and review whether the COGS is getting split into the target accounts you defined earlier. In the following figure, you see the predictive journal entry that was created when you saved the sales order in table ACDOCA and that the COGS is getting split according to the configuration. The goods issue was split into the individual items of the costing. The value of the COGS is credited and debited to the account for the goods issue posting that is defined for record GBB-VAY in materials management account determination. The balance on change to stock account GBB-VAY is zero.


Review the COGS Split in the Predictive Journal Entry


Review Accounting Documents

After posting the goods issue to the sales order, you can see in the figure below that the system created two accounting documents. In the previous figure, the system also posted two predictive journal entries. Let’s take a more detailed look at the two accounting documents.


Review Documents in Accounting of Goods Issue


Review Accounting Documents

The next figure shows document 4900000025 in which you can see that the system reduced the inventory account and posted an expense to the inventory change account for COGS. There is no COGS split here.


Review Accounting Document of Goods Issue


Review COGS Split

The following figure shows the second accounting document 4900000026 that was created when the goods issue was posted. This accounting document shows the COGS split according to the configuration made earlier. The inventory change account for COGS is offset with the posting in the previous figure.


Review Accounting Document for COGS Split


Review Material Cost Estimate

Below shows the material cost estimate of the material that the goods issue was posted for to verify that the correct amounts have been split during the COGS split posting. The numbers do match exactly with the documents earlier.


Review Material Cost Estimate



The COGS split allows for a detailed analysis of the COGS in financial accounting and margin analysis. You can also activate the COGS split without using margin analysis, but you have to use the controlling functionality taco be able to take advantage of the COGS split in SAP S/4HANA.


Editor’s note: This post has been adapted from a section of the book Profitability Analysis with SAP S/4HANA by Kathrin Schmalzing. 


Profitability Analysis with SAP S/4HANA
Profitability Analysis with SAP S/4HANA

Whether you’re running account-based or costing-based CO-PA, this is your one-stop shop for profitability analysis with SAP S/4HANA! Get the step-by-step instructions you need for configuring master data, operating concerns, value flows, and setting up your system. From planning to reporting, this guide has the key to each step of your profitability operations. With this guide to CO-PA, you’re ready for SAP S/4HANA!

Learn More

SAP PRESS is the world's leading SAP publisher, with books on ABAP, SAP S/4HANA, SAP CX, intelligent technologies, SAP Business Technology Platform, and more!