An accountant posts an expense to a G/L account and SAP refuses, asking you to create the account as a cost element in a controlling area. The account exists, the amount is right and the period is open, but the system cannot pass the cost to controlling because the account has no cost element for that date. The cure is short: create the cost element with transaction KA01. This guide explains what the message means, how accounts and cost elements are linked, the exact KA01 steps with the original screenshots, how to choose the cost element category and how to avoid the error in future. If you run into any errors while following along, feel free to send a screenshot to pramod@learntosap.com for help.
| Item | Value in This Example |
|---|---|
| Message text | Create account 500018 for 21.08.2023 as a cost element in controlling area 2004 |
| G/L account | 500018 |
| Date | 21.08.2023 |
| Controlling area | 2004 |
| Module | SAP CO (Controlling), triggered by an FI posting |
| Where to fix it | KA01, create a primary cost element |
| Message type | Error: the document cannot be posted |
The account, the date and the controlling area in your own message may differ from this example. The same steps apply with your own values.
Every expense and revenue posting in SAP FI has a controlling side. When you post to an account that carries costs or revenues, SAP wants to know to which cost center, order or project the amount belongs, and it can only do that through a cost element. A cost element is the controlling view of an account: it tells CO that the account is relevant for cost accounting and what kind of cost or revenue it carries.
The message says that account 500018 has no cost element in controlling area 2004 that is valid on 21.08.2023. Either the cost element has never been created, or it was created with a valid-from date later than the posting date. In both cases the posting cannot go on, because the amount would have nowhere to go in controlling.
The error is therefore not a mistake in the posting itself. It is a gap in master data, and it is solved once in master data, not by changing the document.
In classic SAP ERP, the G/L account and the cost element are two master records that share one number. The account lives in the chart of accounts and is created in FS00. The cost element is created on top of it in controlling, in the controlling area that uses that chart of accounts. Because both share the number, a cost element can only exist for an account that already exists.
| Item | G/L Account | Cost Element |
|---|---|---|
| Module | FI | CO |
| Transaction | FS00 | KA01, KA02, KA03 |
| Level | Chart of accounts and company code | Controlling area |
| Time dependent | No | Yes, valid-from and valid-to dates |
| Purpose | External financial reporting | Internal cost accounting |
Two kinds of cost elements exist. A primary cost element mirrors a P&L account that is posted from FI or MM, for example consumption of materials or rent. A secondary cost element exists only in controlling and is used for internal flows such as allocations and settlements. The message in this guide always concerns a primary cost element, which is why the transaction is KA01.
| Cause | What Is Wrong |
|---|---|
| New P&L account | The account was created in FS00 but nobody created its cost element. |
| Wrong valid-from date | The cost element exists but starts after the posting date, for example valid from today while the posting date is earlier. |
| Different controlling area | The cost element was created in another controlling area than the one the company code belongs to. |
| Account type changed | The account was changed to a P&L account later, so it now needs a cost element. |
| Automatic creation not set up | The system is not configured to create cost elements automatically, so each one must be created by hand. |
| Data migration | Accounts were loaded with a migration tool, but the cost elements were not part of the load. |
In daily work the first cause is by far the most common. A finance team adds a new expense account, a user posts to it the same day, and the first posting stops with this message.
The message does not belong to one transaction. It can appear in any posting that reaches a P&L account:
Because MM and SD postings reach the account through automatic account determination, the user may never have typed the account number. That is why the message sometimes surprises people: the account comes from configuration, not from the screen.
Read the message. Note the account, the date and the controlling area. All three matter for the fix.
Display the account in FS00. Check that it exists in the chart of accounts and that its account type is a P&L account. If it does not exist, create it first.
Check for an existing cost element in KA03. Enter the account and the controlling area. If it exists, look at the valid-from date.
Confirm the controlling area. Check that the company code of the posting belongs to controlling area 2004, for example in OX19, and that the area uses the same chart of accounts as the account.
If KA03 shows nothing, the cost element is missing and the solution below applies. If it shows a cost element that starts after the posting date, change its valid-from date or create a new validity period.
✅ SOLUTION-
In SAP ERP 6.0 a cost element is created with transaction code KA01. Here are the detailed steps to follow to create cost element 500018 for the date 21.08.2023 in controlling area 2004:
Go to Tcode KA01.
The original path shown for this fix is SPRO → Controlling → Cost Element Accounting → Master Data → Cost Elements → Automatic Creation of Primary and Secondary Cost Elements. That IMG node is where automatic creation of cost elements is set up, while KA01 is the transaction you use to create a single cost element by hand.
Select 1) Cost Element: 500018.
Select 2) Valid From: 21.08.2023 to 31.12.9999.
1) Enter the basic data: Name – for example "Cons – Quality Chem".
Enter the basic data: Description – for example "Cons – Quality Chemicals". Then choose Create Cost Element.
2) Choose the Cost Element Category. Choose "01" for Primary Costs/Revenue if this cost element pertains to direct expenses or income.
Save. Review the entered details for accuracy. You should see a confirmation message indicating that the cost element has been created successfully.
Post again. Repeat the posting that failed. The message should no longer appear.
✅ NOTE-
The category tells CO how the cost element may be used. For the error in this guide the choice is category 01, but it helps to know the others.
| Category | Name | Typical Use |
|---|---|---|
| 01 | Primary costs / cost-reducing revenues | Direct expenses such as materials, rent or services |
| 11 | Revenues | Revenue accounts posted from sales |
| 12 | Sales deductions | Discounts and rebates on sales |
| 21 | Internal settlement | Settlement of orders or projects inside the company |
| 22 | External settlement | Settlement to FI accounts |
| 41 | Overhead rates | Overhead surcharges |
| 42 | Assessment | Cost allocation by assessment |
| 43 | Internal activity allocation | Allocation of activities between cost centers |
Categories 21, 22, 41, 42 and 43 are for secondary cost elements, which are created with KA06 and have no matching posting from FI.
Pooja Mishra, a finance lead at Learn Pharma, asked Rupali Pawar to help after the quality team could not post their first invoice for laboratory chemicals. Account 500018 had been created in FS00 the same morning, and the first posting stopped with the message about the cost element in controlling area 2004.
Rajesh checked the account in FS00, where it existed as a P&L account, and then looked in KA03, which showed nothing. He ran KA01, entered cost element 500018 with a valid-from date of 21.08.2023 and a valid-to date of 31.12.9999, and typed a name and description for the quality chemicals. Anita Shah confirmed that this was a direct expense, so he chose category 01 and saved.
Suresh Mehta's team repeated the posting and it went through. Rajesh then asked the finance team to add the creation of a cost element to the checklist for every new expense account, so that the first posting would never fail again.
| Symptom | Likely Reason | What to Check |
|---|---|---|
| KA01 says the account does not exist | The G/L account is missing in the chart of accounts | Create it in FS00 first |
| Same message after saving | Valid-from date is later than the posting date | Display in KA03 and correct the validity |
| Message names a different controlling area | The company code belongs to another area | Check the assignment in OX19 |
| No authorization for KA01 | Missing authorization for cost element master data | Ask the security team |
| Cost element exists but posting still fails | Another message, for example a missing cost center | Read the new message and fix it |
Authorization matters too. Creating cost elements normally needs the authorization for cost element master data (authorization object K_CSKB), which is often held by the controlling team and not by every finance user.
In current SAP S/4HANA releases cost elements are no longer a separate master record. They are part of the G/L account master. You set the account type to primary costs or revenue in FS00, or in the Fiori app for G/L accounts, and the cost element is created together with the account. The separate KA01 transaction is therefore replaced, and the missing-cost-element message appears much less often because the account and the cost element are maintained in one place. Check your own release, because older S/4HANA versions still behave like ERP 6.0.
| Transaction | Purpose |
|---|---|
| KA01 | Create a primary cost element. |
| KA02 | Change a cost element. |
| KA03 | Display a cost element. |
| KA06 | Create a secondary cost element. |
| FS00 | Maintain G/L account master data. |
| OX19 | Assign a company code to a controlling area. |
| FB03 | Display an accounting document. |
Q: What is a cost element?
It is the controlling view of an account. It marks the account as relevant for cost accounting and says whether it carries primary costs, revenues or internal flows.
Q: Why does SAP ask for a cost element when posting to an expense account?
Because the amount must be assigned to a cost center, order or project, and controlling can only do this through a cost element.
Q: What is the difference between a primary and a secondary cost element?
A primary cost element matches a G/L account posted from FI or MM. A secondary cost element exists only in controlling and is used for allocations and settlements.
Q: Why does the message contain a date?
Cost elements are valid for a period of time, and the date is the posting date for which no valid cost element was found.
The message asking you to create account 500018 as a cost element in controlling area 2004 is a master data gap, not a posting error. Create the cost element in KA01 with a valid-from date on or before the posting date, choose category 01 for a direct expense, save, and repeat the posting. To keep it from coming back, create the account and its cost element together every time. Keep this guide handy the next time a new expense account is added.