Okb9 Default Account Assignment Sap

Welcome to the tutorial about SAP CO Account Assignment. This tutorial is part of our free SAP CO training. You will learn how account assignment works in SAP ERP and what are different sources of information about account assignment that the SAP system uses.

Normally, when a financial document is entered in SAP FI module, user has the option of entering the cost center in the financial document. However, when documents are entered from different modules or a cross-module financial transaction occurs, such as from MM or SD, there is no option of entering the cost center in the document. In this situation, the SAP system will derive the cost center through automatic SAP CO account assignment, substitutions, or through default settings made in the primary cost element.

Automatic SAP CO Account Assignment

The automatic account assignment has to be configured in the transaction code OKB9. For posting made in external accounting, such as for price differences, exchange rate differences, etc., the SAP system automatically checks entries in the OKB9 settings and derives the cost center.

If you do not enter a CO object (order, cost center, or project) in external accounting postings made in FI, MM or SD modules and the posting is cost relevant, then the automatic account assignment checks the relevant cost center and makes the posting.

Here are examples of automatic account assignments:

  • Banking fees, exchange rate differences and discounts in FI
  • Minor differences and price differences in MM

The account assignment objects that can be maintained in the transaction OKB9 are:

Normally, the automatic account assignment runs on the company code level along with the CO object. However, if the user wants to make the posting on the business area level, valuation area level or profit center level, it is also available in OKB9 settings. So basically it includes the following levels:

  1. Company code level
  2. Business area level
  3. Valuation area level
  4. Profit center level

The above 3 excluding the company code level are used in cases when the account assignment is needed below the company code level.


Here are the prerequisites of activating automatic SAP CO account assignment:

  • Activation of the cost center accounting
  • Creation of cost centers
  • Maintenance of cost elements

Additionally, you can also create orders and profit centers as per the business requirements.

Settings in Transaction OKB9

Let’s discuss settings that are possible for automatic SAP CO account assignment in OKB9 transaction.

Step 1

Start SPRO transaction and navigate to the following path:

Controlling – Cost Center Accounting – Actual Postings – Manual Actual Postings – Edit Automatic Account Assignment (OKB9)

Alternatively, you can start OKB9 transaction directly from the command bar.

Step 2

  1. If you want to have the setting on the company code level only, then enter the company code and the cost element along with the corresponding CO object, i.e. a cost center, an order or a profit center.
  2. If you want to have the settings on the valuation area level, then enter the company code and the cost element and chose the ‘valuation area’ option in the account assignment detail as ‘1’.
  3. Similarly, if you want to have the settings on the business area or profit center level, then choose the option ‘2’ or ‘3’ respectively.


If you have chosen account assignment detail ‘1’ or ‘2’, then click on ‘Detail per business area/valuation area’ on the left sidebar.

Enter the valuation area and enter the corresponding CO object, then click save button.

Default SAP CO Account Assignment

In order to determine the correct CO account assignment, the SAP system performs several checks in the following sequence. First it checks the document which a user is posting. If the cost center is empty in the document, then the system checks if any substitutions are maintained for the particular G/L account. Next, if the substitution is also missing, then the system moves on to the OKB9 settings for automatic SAP CO account assignments. Finally, if these settings are also missing, the SAP system checks master data of the primary cost element (G/L Account) under the tab of Default Account Assignment. You can display this master data using the transaction KA03.

You can maintain the cost center and the order in the master data of the primary cost element.

So, basically the order of checks the system makes is:

  1. Financial document – Cost center
  2. Substitutions – transaction OKC9
  3. Automatic account assignments – transaction OKB9
  4. Default account assignments – transaction KA03/KA02

Lastly, if any of the above is not maintained, then the SAP system throws an error ‘Account X requires an assignment to a CO Object’ and doesn’t allow posting of a document.

SAP CO Account Assignment using Substitution

In cases where you don’t need OKB9 or default account assignment, the user can go for user exits where a specific G/L account is mentioned under the company and the value in the cost center is substituted by the cost center given in the substitution.

The transaction for maintaining the substitution is GGB1.

Usage of substitutions for SAP CO account assignment is justified by the business requirement and usually SAP CO account assignment requirements are fulfilled by OKB9 or default account assignments.

Did you like this tutorial? Have any questions or comments? We would love to hear your feedback in the comments section below. It’d be a big help for us, and hopefully it’s something we can address for you in improvement of our free SAP CO tutorials.

Page last updated by Cleo Isco on

This blog post is from our friends at SAPexpert - the source for trusted SAP tutorials, tips and training content.

With S/4 HANA Finance, the universal journal includes a single field account that covers both the general ledger (G/L) account and the cost element. As companies migrate to S/4 HANA Finance, the system merges their existing G/L accounts and cost elements. The transactions for the creation and maintenance of cost elements become obsolete, replaced by a single transaction for account maintenance. However, this technical change does not mean that the idea of a cost element has disappeared with S/4 HANA Finance. Learn what changes come with S/4 HANA Finance and what remains as before.


Key Concept

The cost element design is a key part of setting up your controlling (CO) system. In S/4 HANA Finance, as the accounts and cost elements are merged, the following changes result:

  • The primary cost elements represent the profit-and-loss accounts used to classify your journal entries. In all accounting approaches, you use cost elements to represent wages and salaries, material expenses, depreciation, and so on. If you use account-based profitability analysis (CO-PA) or if you have make-to-order processes requiring results analysis and settlement, you also use cost elements for revenues, sales deductions, and so on. In S/4 HANA Finance, the G/L account and the primary cost elements merge into one.

  • The secondary cost elements record the value flows within CO, such as the charging of utility costs from a support cost center to an operational cost center, the charging of machine hours to a production order, the charging of consulting time to a Work Breakdown Structure (WBS) element, or the settlement of research and development costs to CO-PA. In S/4 HANA Finance, accounts are created for every secondary cost element so that all value flows are visible in the universal journal and thus in reports such as the trial balance.


A Controlling (CO) implementation typically starts with the decision regarding which profit-and-loss (P&L) accounts require primary cost elements and which don’t. There are typically a handful of P&L accounts that do not need to be reflected in CO—either because they have no impact on the operational business or are needed for a special purpose, such as recording work in process (WIP). However, for the majority of P&L accounts, the implementation team creates a separate primary cost element for each account and makes sure that the correct CO account assignment can be updated as each journal entry is posted, capturing salary postings by cost center, material expense postings by Work Breakdown Structure (WBS) element, and so on.

All these changes with S/4 HANA Finance, where the accounts and cost elements merge and the master data settings for the cost elements become part of the general ledger (G/L) account master. This means that where you used to create primary cost elements using transaction code KA01, you now are directed to transaction code FS00 (Display G/L Account Centrally). While this all sounds quite radical, the fundamental nature of the account does not change and you continue to use the field status groups to control which account assignments are valid for each business transaction as before.

The merge of accounts and cost elements does have an impact on your authorization profiles. You can create accounts with no CO impact if you have authorization for G/L account maintenance (these are typically given by account, company code, and account type). However, if you want to create an account that is simultaneously a cost element, you need authorization for both the G/L account and the cost element (authorization object K_CSKB). The combination also means that you need to keep the period locks in sync and make sure that the account types that allow postings match the CO business transactions that allow postings at any given time.


Setting Up Your Accounts in S/4 HANA Finance

Figure 1 shows the account master data in S/4 HANA Finance (transaction code FS00), which is a combination of the account maintenance and the former cost element maintenance transactions (transaction code KA01-3).

Figure 1: G/L account showing the account type for the primary cost element


The main change to this screen is that you can choose between P&L accounts that do not require a cost assignment by selecting the account type Nonoperating Expense or Income and P&L accounts that are associated with a CO account assignment by selecting the Account Type Primary Costs or Revenue.

In my example, you have a raw material expense account and any raw material posting to this account needs to be assigned to a CO account, such as a cost center, order, or WBS element. If you are migrating, your field status groups will already be set up to include these CO account assignments.

As you go through the screens, notice that the old Default Assignment tab in the cost element master record is gone, so the only way to set up the default account assignments is to use transaction code OKB9 or follow IMG menu path Controlling > Cost Center Accounting > Actual Postings > Manual Actual Postings > Edit Account Assignment. If you have entered default account assignments in your cost element master data, the migration process creates entries in table TKA3A for these default assignments. You can check them using transaction code OKB9.

The account type alone does not define how the account is used in CO. This is done by assigning a cost element category to each account. To check the cost element category, select the Control Data tab as shown in Figure 2.

​Figure 2: Control data for G/L account showing the cost element category for primary costs


In this tab, you see that your raw material account has the cost element category 1 (Primary costs/cost reducing revenues). (This value appears in the CElem category field.) You want similar accounts or cost elements for wages and salaries, asset depreciation, material movements, and so on. You can also use cost elements of category 3 and 4 if you work with accrual postings. If you are using account-based profitability analysis (CO-PA), you also want cost elements of category 11 for revenue and of category 12 for sales deductions.

You also use these cost element categories if you have make-to-order processes requiring results analysis, where revenue or direct costs are assigned to a project or sales order. If you have settlement processes that capitalize expenses as either asset under construction or finished goods inventory, you also want cost elements of category 22 for external settlement. Note that the old restriction that WIP accounts must not be cost elements continues to apply (in other words, the account type for the WIP offsetting entry must be Nonoperating Expense or Income).

With the settings for the primary cost elements made to the relevant accounts, it’s time to think about the secondary cost elements. Before I go into detail here, it’s worth recalling how a primary cost element differs from a secondary cost element. A primary cost element is an extension of a P&L account, and the offsetting entry is always to a balance sheet account (so a salary expense will offset to accounts payable, a revenue posting will offset to accounts receivable, and so on). A posting to a secondary cost element balances to zero, but under the same account, so a direct activity allocation credits the cost center and debits the order under the same cost element.

The switch is in the sender (here the cost center) and the receiver (the order) and this, in turn, may trigger a shift in profit centers, functional areas, and so on, all of which are captured as partner relationships in the universal journal.

In the past, secondary cost elements were created using transaction code KA06, but in S/4 HANA Finance, you again are redirected to transaction code FS00 (Display G/L Account Centrally). During migration, secondary cost elements are migrated into the G/L account tables (SKA1, SKB1, and SKAT) for all company codes assigned to the CO area. Figure 3 shows the G/L account master data for a secondary cost element for the allocation of machine costs.

Figure 3: G/L account showing an account type for a secondary cost element


Again, you can see the cost element categories by selecting the Control Data tab. Figure 4 shows that this cost element can be used for internal activity allocations (in other words, to charge machine costs from a cost center to orders, projects, and so on).

Figure 4: Control data for G/L account showing cost element category for secondary costs


As you think about your secondary cost element categories, think about these sender-receiver relationships. These relationships give you a cost element category of 43 for internal activity allocation (as shown in Figure 4), 21 for internal settlement, 41 for overhead rates, and 42 for assessment. You’ll see an example of such a sender-receiver relationship and the associated value flow when I explain how a secondary cost element appears in the trial balance at the end of this article.

If you’ve been working with the classic General Ledger, these movements are recorded in the reconciliation ledger if they cross-company code boundaries and are moved to the classic General Ledger at the period close using transaction code KALC. If you’ve been working with the SAP General Ledger, you probably have set up real-time integration to create journal entries for these movements. Both these approaches are obsolete in S/4 HANA Finance.

You always see such movements reflected in the universal journal so you won’t need a reconciliation ledger. Because the secondary cost elements are now G/L accounts, you won’t need to map the CO business transactions to reconciliation accounts in FI. The secondary cost elements appear in your financial accounts whenever you perform the transactions listed above, provided that you include the new accounts in your financial statement versions. You can find the link by clicking the Edit financial statement version button shown in the ribbon in Figure 4.

If you are building up your financial statement version from scratch, you can still use transaction code KA23 (Cost Elements: Master Data List) to list all the cost elements and their attributes in your system. This makes grouping them for reporting purposes much easier than trying to use the F4 help.

Other secondary cost elements exist that don’t represent such sender-receiver relationships. If you work with Result Analysis, you still need cost elements of type 31 (order/project results analysis). If you are working with Project System, you still potentially need cost elements of types 50, 51, 52 (project-related incoming orders), and 61 (earned value).


Working with Accounts and Cost Elements in S/4 HANA Finance

Figure 5 shows a sample trial balance in S/4 HANA Finance. You see the classic view showing the balances by company code and account on the right, but also the option to drill-down by Account Type, Accounting Document, and Activity Type on the left. This view enables you to drill down by account type (material, asset, vendor, customer, and so on) in Financial Accounting but also by activity type (for example, the machine hours that are allocated using the account or cost element shown in Figures 3 and 4) in CO. This same merge is available in all new financial reports in S/4 HANA Finance.

Figure 5: Sample trial balance in S/4 HANA Finance


However, while the accounts and cost elements are merged in the new reports, you continue to see the term cost element on many of the screens. You find the term cost element in the assessment cycles, the settlement profiles, the costing sheets, and other areas. These configuration transactions work exactly as before.

You can use the example shown in Figures 3 and 4 to perform time recording or order confirmations via the work center. You can enter only accounts of cost element category 41 in your costing sheets and accounts of cost element category 42 in your assessment cycles, and so on. What’s important is that your secondary cost elements provide the transparency you need for your analysis. Particularly if you’ve only worked with costing-based CO-PA in the past, there is a tendency to allocate and settle under a single cost element and rely on the value fields to give you the detail you need for reporting. You may want to create separate secondary cost elements to distinguish between marketing expenses and sales and administration expenses in your assessment cycles.

In Figure 6, for my example, select the account for raw material costs that you looked at in Figures 1 and 2 within the trial balance (Figure 5) and drill down by cost center to show all the cost centers to which raw materials were posted within the selected time frame.

Figure 6: Trial balance showing raw material account and assigned cost centers


By comparison, in Figure 7, a more classic approach is taken in which the cost center line-item report transaction code KSB1) is used to select all postings to the raw material cost element with these cost centers in the same time frame.

Figure 7: CO line-item report showing raw material cost element and associated cost centers


What’s happening here is that the system is using compatibility views to simulate the existence of CO line items even though the CO data has been subsumed in the universal journal. This means that you won’t need to rework your existing reports after a migration to S/4 HANA Finance.

Indeed, if you use the relationship browser in the CO line-item display, you find it appears to show an accounting document and a controlling document, but actually both documents are views on the universal journal that display the data as if the old structures still existed. You could continue to explore the trial balance, focusing on single accounts, such as raw materials and selecting other account assignments (such as orders and projects) or looking at different accounts, such as revenue accounts and drilling down to the CO-PA characteristics.

Instead, look at the account for the secondary cost element you looked at in Figures 3 and 4, and drill down to the sender and receiver objects that were updated during these postings. 

Figure 8: Trial balance showing activity allocation and associated postings.


In Figure 8, note that you’ve drilled down to the sender cost center (1303) and the sender activity type (1420), which gives you a credit balance. The offsetting line is a debit balance. To see the account assignment, you have to pull the order number in by choosing the appropriate option in the navigation panel. This is a very simple example, but it gives you an impression of the fundamental changes available with S/4 HANA Finance.



Leave a Reply

Your email address will not be published. Required fields are marked *