Quick Answer — SAP Cost Center Not Valid Error
- The error message is KS 042: "Cost center [XXXX] [YYYY] is not valid on [date]." SAP is telling you the cost center exists but cannot be used for the posting date of your document.
- The most common cause (80% of cases) is a validity period mismatch. The cost center's Valid From date is later than the posting date, or the Valid To date is earlier.
- Fix it in KS02 — extend the Valid From date to cover the posting date. If the cost center is locked, remove the lock indicator on the Control tab.
- Always check KS03 first — it shows the validity dates and lock status in one screen without making any changes.
- This is different from "account requires CO object". That error means no CO object was entered at all. This error means a cost center was entered but SAP rejects it.
KS03 is your first stop, not KS02. Always display the cost center first to understand the exact problem before making changes. Changing the wrong date or removing the wrong lock indicator can have downstream accounting consequences.
The posting date, not the document date, is what SAP validates against. A document with document date March 1 but posting date October 1 is validated against October 1. Knowing this helps you identify which date range needs to be extended.
This error and "account requires CO object" are different. "Cost center not valid" means a cost center was entered but rejected. "Account requires CO object" means no CO object was entered at all. The fix paths are completely different.
Cost center validity errors increase at fiscal year boundaries. Cost centers created for one fiscal year are often not extended to the next. Set up a period-end check to ensure all active cost centers are valid into the next fiscal year before it opens.
OKB9 prevents this error for automatic postings. When SAP posts to a P&L account automatically (during MIGO, AFAB, or MIRO), it cannot prompt for a cost center. OKB9 provides the default. Without it, automatic postings to cost-relevant accounts fail.
What Triggers "Cost Center Not Valid" in SAP?
The SAP error "Cost center [XXXX] [YYYY] is not valid on [date]" (message KS 042) appears when you post a financial document that includes a cost center assignment and SAP cannot accept that cost center for the posting date of the document. The error can occur in FI transactions (FB50, FB60, FB70, MIRO), in CO manual postings, and in automatic postings from MM (MIGO) or Asset Accounting (AFAB).
It is important to understand what this error is not saying. It does not mean the cost center number is wrong or does not exist in SAP. It means the cost center exists but cannot be used for that specific posting date. That distinction tells you exactly where to look for the fix.
How to read the error message: KS 042 shows three pieces of information: the cost center number, the controlling area code, and the posting date SAP tried to validate against. For example: "Cost center 1000 GRCA is not valid on 01.10.2023." The fix is almost always to extend the cost center's validity to cover 01.10.2023.
The KS03 display transaction is read-only — it never changes the cost centre. Use it freely to investigate without risk. Make changes only in KS02, and only after you have confirmed exactly which attribute needs adjusting and why the current setting is preventing the posting.
How SAP validates cost center at the time of posting: When you save a financial document, SAP checks the cost center against three things simultaneously — the validity period dates on the cost center master record, the lock indicators on the Control tab, and the controlling area assignment of the company code you are posting to. All three must pass for the posting to succeed. If any one fails, you see a variant of the KS 042 message.
Cost Center Validity Check: What SAP Looks at Behind the Scenes
- Posting date: 01.10.2023
- Cost center valid from: 01.01.2024
- Posting date is before valid-from date
- Result: "Cost center XXXX not valid on 01.10.2023"
- Fix: extend valid-from date back in KS02
- Posting date: 01.10.2023
- Cost center valid from: 01.01.2023
- Posting date is within validity period
- No lock indicator set on Control tab
- Controlling area matches company code
The compare above shows the most common scenario — cause 1 (validity period). The cost center exists and is correctly set up in every other way, but the valid-from date was set to the start of the next fiscal year when the cost center was created. Any posting to a prior period — a catch-up invoice, a period adjustment, a backdated accrual — will fail with this error until the valid-from date is extended backward.
Do not extend validity blindly. Before changing the valid-from date in KS02, confirm with the finance manager that the cost centre genuinely should have been active from that earlier date. If the cost centre represents an organisational unit that did not exist in the earlier period, extending validity allows backdated postings that may be materially incorrect for those periods.
4 Root Causes — How to Identify Each One
All four root causes produce the same or similar error message. Check them in the order below — cause 1 is responsible for the majority of cases.
When diagnosing across multiple failing documents, always check whether they share the same cost centre number. If the same cost centre appears on every failing document, the root cause is a single master data issue you can fix once. If different cost centres are failing, you may have a systemic validity or controlling area issue affecting multiple objects that needs a broader investigation using KS13.
Quick shortcut: In KS03, press the "Change" button (pencil icon) to jump directly from display to KS02 for the same cost centre and controlling area. This saves navigating back to the menu when you need to extend validity immediately after diagnosing the issue.
Step-by-Step Fix for KS 042
Follow this sequence every time. Diagnose first, then fix — never the other way around.
Do not extend a cost center's validity without understanding why it was restricted. If the cost center was intentionally locked or given a future Valid From date — for example because the organisational unit did not exist yet — extending it may allow backdated postings that distort historical reporting. Always confirm with the finance manager or cost center owner before extending validity.
Using KS02 to Change Cost Center Validity
| Transaction | Purpose | When to Use |
|---|---|---|
| KS03 | Display cost center — read-only view of all master data | Always check first before making any changes |
| KS02 | Change cost center — extend validity, remove locks, update master data | After KS03 confirms the root cause |
| KS01 | Create cost center — used only if the cost center genuinely does not exist yet | When a new cost center is needed |
| KA03 | Display cost element — verify that a primary cost element exists for the GL account | When the error persists after fixing validity and lock |
| KA01 | Create cost element — link a P&L GL account to CO as a primary cost element | When KA03 shows no cost element for the account |
| OKB9 | Default account assignment — set default cost center for automatic postings | When the error occurs during MIGO, AFAB, or MIRO automatic postings |
| OX15 | Assign company codes to controlling area | When diagnosing controlling area mismatch |
Trainer insight — the controlling area mismatch catch. Cause 3 (controlling area mismatch) is the hardest to spot because the error message looks identical to a validity period error. The giveaway is when the cost centre clearly exists and its validity covers the posting date, but the error still fires. Check transaction OKKS to see which controlling area your current session is set to. Then check OX15 to confirm the company code you are posting to is assigned to that same controlling area. If not, either the company code assignment is wrong or you are using a cost centre from the wrong controlling area entirely.
In multi-company-code SAP environments, this is especially common during post-merger integrations where two legacy systems are consolidated. Cost centres from legacy company A are often visible in the SAP system but belong to controlling area A — they cannot be used in company codes that belong to controlling area B without reconfiguring the enterprise structure. The fix in these cases is organisational, not a master data change.
Cost Centre Validity Across Fiscal Year Boundaries
The most common time to encounter KS 042 in bulk is the first two weeks of a new fiscal year. Cost centres that were created with a valid-to date of 31.12.2025 are suddenly invalid for all January 2026 postings — affecting every recurring document, automatic depreciation posting, and MIRO invoice that tries to post to them. A single annual check prevents dozens of January support tickets.
OKB9 is the hidden fix for automatic posting errors. When SAP generates a posting automatically — during AFAB (depreciation), F110 (payment run), MIRO (logistics invoice verification), or payroll — it cannot prompt a user to enter a cost centre. It looks up OKB9 for the GL account being posted to. If OKB9 has no entry, or if the cost centre listed in OKB9 is itself invalid, the automatic posting fails. Keeping OKB9 up to date whenever cost centres change is the single best preventive measure for automatic posting errors of this type.
How to Prevent This Error in Future
Most cost center validity errors are preventable with two simple practices applied at period-end and fiscal year boundary.
Annual check before new fiscal year opens: Run a cost center list report (KS13) for the current controlling area. Filter for cost centers with Valid To dates ending in the current year. Extend those that need to continue into the new year before opening period 1. This single check prevents the majority of validity errors that appear in January and February every year.
For automatic postings — MIGO, AFAB, depreciation, payroll — configure OKB9 with a default cost center for every cost-relevant GL account. This ensures that even when no cost center is manually entered, SAP has a valid assignment to use. Review OKB9 entries whenever new GL accounts are created or when cost center structures change.
For cost centers that should be retired, use the lock indicator (KS02, Control tab) rather than deleting the cost center or letting the validity expire unexpectedly. A locked cost center is still visible in reports and explains where historical costs were posted, but prevents new postings going forward.
Related SAP notes for KS 042 resolution: If the error persists after extending validity and removing locks, SAP Note 389348 covers known issues with cost centre validity in the New GL. SAP Note 1922718 addresses FAGL posting date validation. Search the SAP Support Portal (help.sap.com) with your exact error message text and your SAP release for the most relevant notes for your system version.
For teams managing large cost centre structures, the SAP Cost Centre Mass Maintenance transaction KS12 allows bulk validity extension across multiple cost centres in a single operation. This is particularly useful at fiscal year-end when dozens of cost centres need their Valid To dates extended simultaneously. KS12 requires the same authorisation as KS02 and generates a single transport for all changes in the session.
SAP Cost Center Not Valid — 20 Questions Answered
This error means SAP cannot accept the cost center you entered for the posting date of the document. The most common reason is that the cost center's validity period does not cover the date of the posting. For example, if the cost center was created with a valid-from date of 01.01.2024 and you are posting a document dated 01.10.2023, SAP will reject it with this message.
The most common message is KS 042: 'Cost center [XXXX] [YYYY] is not valid on [date]'. You may also see KS 013 if the cost center is locked for actual postings, or message F5 289 if the GL account requires a CO object assignment and none is provided. The exact message number appears in the status bar at the bottom of the SAP screen.
Four possible root causes: (1) The cost center's validity period does not cover the posting date. (2) The cost center is locked for actual postings. (3) The cost center belongs to a different controlling area than the company code you are posting to. (4) The cost element linked to the GL account is not assigned in the controlling area. Check KS03 first to identify which cause applies.
Use transaction KS03 (Display Cost Center). Enter the cost center number and controlling area, then navigate to the Basic Data tab. The Valid From and Valid To dates are shown there. If the posting date falls outside this range, that is the cause of the error. To check the controlling area assignment, use OKKS or look at the company code settings in OX15.
Use transaction KS02 (Change Cost Center) to extend the validity period. Enter the cost center number, controlling area, and the new Valid From date. You must have the appropriate authorisation object K_CSKS with the correct controlling area and cost centre assigned in your user profile. In production systems, this change requires a transport request.
KS02 is the SAP transaction for changing an existing cost center. You use it to extend the validity period (change the Valid From or Valid To date), remove a lock indicator, change the cost center hierarchy, or update the responsible person or department. Any change to a cost center in production requires the appropriate authorisation and typically a transport for configuration-level changes.
In KS02, enter the cost center number and controlling area. Change the Valid From date to cover the posting date you need. If the cost center is locked, uncheck the lock indicator on the Control tab. Save the change. The posting should now succeed. Always verify in KS03 after saving that the dates show correctly before attempting the posting again.
A locked cost center has the 'Lock actual postings' indicator set on the Control tab (visible in KS03). This prevents any actual financial postings to that cost center. Cost centers are locked when they are no longer in active use, when restructuring is in progress, or when the period being posted to has been locked for CO purposes. To unlock, remove the indicator in KS02.
In KS02, select the cost center and navigate to the Control tab. Uncheck the lock indicators: 'Lock actual postings', 'Lock plan postings', and 'Lock commitment postings' as required. Save. Verify in KS03 that the lock indicators are cleared. The cost center will then accept new postings for the relevant category.
These are two different errors. 'Cost center not valid' means you have entered a cost center but SAP cannot accept it due to validity, locking, or controlling area mismatch. 'Account requires CO object' means you have not entered any CO object at all and the GL account's cost element configuration requires one. The first error is about a bad cost center; the second is about a missing cost center.
Yes. Cost centers belong to a controlling area. A controlling area can be assigned to multiple company codes. If company code A and company code B both belong to controlling area CA01, they share the same cost centers. However, if company code C belongs to a different controlling area CA02, it cannot use cost centers from CA01. The error 'cost center not valid' can appear when a document is posted to a company code that is not assigned to the same controlling area as the cost center.
A controlling area is the organisational unit in SAP CO that links the management accounting structure to financial accounting. It defines the currency, fiscal year variant, and chart of accounts used for CO postings. One controlling area can span multiple company codes if cross-company cost accounting is needed. The assignment of company codes to controlling areas is maintained in transaction OX15.
SAP validates cost center validity against the posting date of the FI document, not the document date or the current date. If you are posting a document with a posting date of 01.03.2023 but the cost center was only created from 01.01.2024, the posting will fail. This is intentional: it prevents costs from being posted to cost centers that did not exist during the period being reported.
In KS03 (Display Cost Center), the controlling area is shown in the header of the screen alongside the cost center number. You can also search for cost centers by controlling area using the input help on the cost center field. The assignment of company codes to controlling areas is maintained in OX15, and the current controlling area for a posting session is set using OKKS.
A cost element is the CO representation of a GL account that posts costs or revenues. Primary cost elements correspond directly to P&L GL accounts in FI. For a P&L GL account to accept postings that include a cost center, it must have a primary cost element created in transaction KA01. If the cost element does not exist for the controlling area, postings to that GL account with a cost center will fail.
During MIGO, if the GL account determined by account determination (OBYC) is a cost-relevant account (P&L account), SAP requires a CO object assignment. If the account assignment tab in MIGO does not show a cost center, either the account determination is posting to an account that has no cost element set up, or the default account assignment in OKB9 is missing. Check OKB9 to set a default cost center for automatic postings.
OKB9 (Default Account Assignment) is the SAP configuration table where default CO objects are assigned to GL accounts for automatic postings. When SAP posts automatically to a GL account (for example during MIGO or depreciation), it looks up OKB9 to find the default cost center, profit center, or other CO object. If OKB9 has no entry for the account, the posting may fail with a CO object error or require manual intervention.
Use transaction KS01 (Create Cost Center). You need the controlling area, cost center number, valid-from date, name, responsible person, cost center category, and hierarchy assignment. The cost center category determines which types of costs can be posted. Save and the cost center is immediately available for postings from the valid-from date onwards. In production, cost center creation requires appropriate authorisation and a transport.
KS03 is the SAP display transaction for cost centers. It shows all master data for a cost center: validity dates, lock indicators, responsible person, cost center category, hierarchy node, and assigned profit center. KS03 is the first transaction to check when diagnosing a 'cost center not valid' error because it shows the exact validity dates and lock status of the cost center in question.
Yes. VoiSAP's SAP FICO training covers the full Controlling (CO) module including cost center accounting, profit center accounting, and internal order management. You practise creating and maintaining cost centers, running allocations, and troubleshooting CO errors on a live SAP S/4HANA system. Book a free demo to discuss how the training covers both FI and CO configuration.
Book a free demo — discuss your SAP FICO questions, career goals, and how VoiSAP training prepares you for real consultant work.