How to mass create cost centers in SAP with KS01
KS01 in SAP creates one cost center in a controlling area, with a validity period, a cost center category, a node in the standard hierarchy, a company code and usually a profit center. To mass create cost centers in SAP and upload them from Excel, PostNow.ai calls BAPI_COSTCENTER_CREATEMULTIPLE, SAP's create interface for cost centers, with one row per cost center, so a whole cost center list becomes a KS01 mass upload in one run. Validate checks the sheet offline, Simulate lets SAP check every cost center and rolls it back, and Run writes SAP's result to each row.
- The hierarchy node comes first. Every cost center is assigned to an end node of the controlling area's standard hierarchy, and that node must exist before the cost center is created.
- The dates must fit. The profit center must exist on the cost center's dates, or SAP returns
KM 700for the row, so give it a validity that covers the cost center's.
This page covers one job: SAP cost center automation from Excel, creating cost centers in bulk and changing them afterwards. The profit centers the cost centers point to are created first, as described in SAP profit center upload. The other master data objects and the order to load them in are in SAP master data mass upload, and the assets that carry these cost centers are in mass create assets in SAP (AS01).
How PostNow.ai mass creates KS01 cost centers from Excel
PostNow.ai treats a KS01 mass upload as a template: a designer builds it once against your SAP system and publishes it, and controlling runs its own cost center lists through it, each user under their own SAP login on their own computer.
- Start from the template or the BAPI. Download the free KS01 cost center template, whose columns are already mapped to
BAPI_COSTCENTER_CREATEMULTIPLE, or search for that BAPI by name in your own system. Find with AI proposes the same BAPI when you describe the job as KS01. - One row per cost center. The controlling area goes in the BAPI's
CONTROLLINGAREAimport; everything else on the row (cost center, valid from and to, name, description, person responsible, category, hierarchy area, company code, currency, profit center, lock indicators) fills one line of theCOSTCENTERLISTtable. By default PostNow.ai sends each row as its own call, so SAP's answer belongs to exactly one cost center. - Keep the keys as text. Cost center and profit center numbers are often numeric with leading zeros in SAP. Format those columns as text and switch on Leading Zeros for the field, with a target length where needed, so PostNow.ai pads the value before it is sent.
- Validate the sheet. Validate checks every cell offline: required fields, type, length, date format and allowed values, such as an allow-list of cost center categories. Whether the hierarchy node exists or the profit center is valid on the dates is SAP's answer, and that comes in Simulate.
- Simulate. PostNow.ai calls
BAPI_COSTCENTER_CREATEMULTIPLEfor every row and thenBAPI_TRANSACTION_ROLLBACKinstead of a commit, so SAP's own messages appear on each row and no cost center is created. - Run. For each row PostNow.ai calls the BAPI and commits with
BAPI_TRANSACTION_COMMITonly when SAP returned no error; otherwise it rolls back. The Run Log cell shows SAP's result with the SAP user, time and system. A cost center is not a document, so the key you supplied is the number: the cost center column already holds it. - Re-run only what failed. Retry Failed re-posts only the rows marked ERROR. If someone clicks Run again on the same sheet, PostNow.ai first lists the rows whose Run Log already shows a success and offers Skip posted rows before anything is sent to SAP.
While the sheet is being filled, SAP Lookup (F4 help) on the ribbon lets the user pick valid values for the active cell, such as company codes, profit centers or cost center categories, from the SAP system they are connected to. Where controlling wants a second pair of eyes on new cost centers, an approval policy on the template holds the run until an approver has reviewed the rows in the PostNow.ai portal. The approval is tied to that exact data, so a sheet changed after approval needs approval again.
SAP cost center automation from Excel: what it covers
With PostNow.ai, SAP cost center automation from Excel covers the full life of a cost center's master record, each job in its own template:
| Job | SAP transaction | Route in PostNow.ai |
|---|---|---|
| Create new cost centers | KS01 | Template on BAPI_COSTCENTER_CREATEMULTIPLE, or a recording of KS01 |
| Change existing cost centers from a list | KS02 | Template on BAPI_COSTCENTER_CHANGEMULTIPLE (free KS02 template) |
| Download, edit and post back | KS02 | PostNow.ai Mass Change: current values into Excel, edit, post the changed rows |
| Check the result | KS03, KS13 | The Run Log per row; Cost Center Master 360 in the Report Library puts the cost centers and their assignments into Excel |
What stays with controlling is the design: which cost centers exist, where they sit in the standard hierarchy, which category each carries and which profit center it reports to. Agree that in the sheet first; the run then puts the agreed structure into SAP exactly as written.
The fields a KS01 upload maps
In a PostNow.ai KS01 template each column maps to one field of BAPI_COSTCENTER_CREATEMULTIPLE. These are the columns that decide whether a cost center is created and whether it behaves as controlling intended:
| Column | BAPI field | What SAP checks or does with it |
|---|---|---|
| Controlling area | CONTROLLINGAREA | The organisational key of every cost center. Company code, hierarchy and categories are all checked against it. |
| Cost center | COSTCENTER | You supply the number. A number that already exists in the period raises KS 003. |
| Valid from / Valid to | VALID_FROM, VALID_TO | The validity period of the record. Valid to is usually 31.12.9999; valid from is the first day the cost center may receive postings. |
| Name, Description | NAME, DESCRIPT | Short name (20 characters) and description (40). These are what reports and F4 lists show. |
| Person responsible | PERSON_IN_CHARGE, PERSON_IN_CHARGE_USER | A name, plus the SAP user ID where your reports or workflows use it. |
| Cost center category | COSTCENTER_TYPE | One character from the categories defined in Customizing. It proposes the lock indicators (below). |
| Hierarchy area | COSTCTR_HIER_GRP | The node of the standard hierarchy the cost center sits under. It must be an end node of that hierarchy; any other group raises KS 070. |
| Company code | COMP_CODE | Must be assigned to the controlling area. |
| Currency | CURRENCY | On the KS01 screen SAP proposes the controlling area currency. Put the currency in the file explicitly so nothing depends on a default. |
| Profit center | PROFIT_CTR | Must exist on the cost center's dates, or SAP raises KM 700. Give it a validity that covers the cost center's whole period. |
| Business area, functional area | BUS_AREA, FUNC_AREA | Where your ledger reports by them. A functional area can also be proposed by the category. |
| Lock indicators | LOCK_IND_ACTUAL_PRIMARY_COSTS and the others | X blocks that kind of posting, for example revenues. KS01 proposes them from the category; in the file, set the ones you want explicitly. |
Keep one controlling area per sheet. Almost every other column is checked against it, and a sheet for one controlling area is the natural unit for approval and for the hierarchy check below.
The standard hierarchy node comes first
A PostNow.ai KS01 template has the hierarchy area as a required column, because SAP will not create a cost center outside the standard hierarchy. The standard hierarchy is the tree of cost center groups assigned to the controlling area; each cost center hangs from one of its nodes, and reports roll costs up through it.
- The hierarchy must exist and be assigned. A controlling area without a standard hierarchy raises
KS 055"Controlling area … does not have a standard hierarchy" on the first row. The assignment is made in the controlling area settings (OKKP). - Every node in the file must already be in the tree. The standard hierarchy is maintained in
OKEONand its groups withKSH1andKSH2; in S/4HANA the Manage Global Hierarchies app does the same job. A node that is missing, sits outside the standard hierarchy, or is a summarization node with groups below it raisesKS 070"Area … cannot be used here" on every row that names it. - Compare before you load. Take the list of nodes in the file, compare it with the current standard hierarchy, and have controlling create the missing nodes, top down, before the cost center run.
- Choose the node carefully. SAP Help lists the hierarchy area as time-independent: a cost center has one node for its whole life, and a later move applies to every period, past ones included.
Cost center category: what it controls
PostNow.ai can restrict the category column to an allow-list, so operators pick only the categories controlling has approved for the file. The category matters more than its one character suggests:
- It proposes the control indicators. Each category carries defaults for recording consumption quantities and for the lock indicators on actual and plan primary costs, secondary costs, revenues and commitments. SAP proposes them when the cost center is created in KS01, and they can be changed per cost center. In the upload file, fill the lock columns you want rather than relying on the proposal.
- It decides which activity types fit. Each activity type lists the cost center categories it may be used with, so a cost center created with the wrong category may be refused the activity type planned for it.
- It can propose a functional area, which matters where the ledger reports by function of expense.
Categories are defined in Customizing (Define Cost Center Categories), so the values differ by system. Ask controlling for the list with each category's defaults, and decide each cost center's category on purpose rather than from its department name.
Time dependency: validity dates and the KS02 split
PostNow.ai sends the valid-from and valid-to dates exactly as they are in the row, and in cost center master data those dates carry meaning. Most fields are time-dependent: SAP keeps their values per period, so the same cost center can carry one profit center in the first half of the year and another in the second.
- A change can split the record. When a time-dependent field is changed for a new analysis period inside the existing validity, SAP creates a new data record from that date and shortens the existing one. The old value stays on the earlier period, the new one applies from the change date.
- The change date is a decision. A correction meant to apply from 1 January must be made from 1 January. Made from today, it leaves the wrong value on every earlier period of the year.
- Postings restrict some changes. Once a period has postings, SAP refuses some changes for it, such as the company code. Plan those fields correctly at creation.
- Profit center dates must cover the cost center's. A cost center valid from 01.01.2027 that names a profit center valid only from 01.07.2027 fails with
KM 700"Profit center … does not exist for …". Load the profit centers first, with dates that cover the cost centers.
Posting route: KS01 recording or BAPI_COSTCENTER_CREATEMULTIPLE
PostNow.ai creates cost centers either way: by calling BAPI_COSTCENTER_CREATEMULTIPLE over RFC, or by replaying a KS01 recording. The BAPI is the first choice for a create, because it takes every field of the cost center in one table line and returns SAP's verdict in its RETURN table without any screen in between.
| BAPI parameter | Kind | What a KS01 upload puts in it |
|---|---|---|
CONTROLLINGAREA | Import | The controlling area, once per call |
COSTCENTERLIST | Table | One line per cost center: COSTCENTER, VALID_FROM, VALID_TO, NAME, DESCRIPT, PERSON_IN_CHARGE, COSTCENTER_TYPE, COSTCTR_HIER_GRP, COMP_CODE, CURRENCY, PROFIT_CTR, the lock indicators and the address fields |
LANGUAGE | Import | The language of the name and description, where it differs from the logon language |
EXTENSIONIN | Table | Customer fields added to the cost center master, declared as extensions in the template |
RETURN | Table | SAP's messages; PostNow.ai writes them to the row's Run Log |
COSTCENTERLIST has no X structure: a value in the line is taken as it is. The BAPI does not commit on its own, so PostNow.ai follows a clean call with BAPI_TRANSACTION_COMMIT. Its TESTRUN flag can stay empty, because PostNow.ai's Simulate follows the call with BAPI_TRANSACTION_ROLLBACK instead of a commit.
Recording KS01 instead
A recorded KS01 works too: record one cost center in SHDB with the tabs your file fills (basic data, control, address), map the screen fields to columns, and PostNow.ai replays the recording for every row. The BDC recording guide covers how to record so the replay holds, and BAPI vs BDC in SAP compares the two methods.
- Recording mode needs PostNow.ai's
ZPOSTNOW_*objects in SAP, installed once per system. The BAPI route needs no add-on objects: RFC access plus the user's normal cost center authorizations. - Simulate on a recording walks the KS01 screens without saving, so SAP's save-time checks arrive at Run. Prove the recording on one cost center in Debug before the first full file.
- SAP GUI stays with the user. PostNow.ai logs in to SAP GUI only on the user's own computer, with the user's own stored login, when the user starts the action (Record, Run, Debug or Call Transaction); never on a server, never unattended, never with someone else's login.
Worked example: 8 cost centers for a new logistics hub in company code 1010
PostNow.ai handles this with one published KS01 template and one sheet for controlling area A000. Controlling has designed eight cost centers for a logistics hub that opens on 1 January 2027: receiving, storage, picking, dispatch, yard, maintenance, hub management and IT. They sit under a new node H1010-LOG, which controlling has already added to the standard hierarchy, and report to profit center 1010-LOG.
| Column | Row 2 (first cost center) |
|---|---|
| Controlling area / company code | A000 / 1010 |
| Cost center / valid from / valid to | 1010-5100 / 01.01.2027 / 31.12.9999 |
| Name / description | Hub Receiving / Logistics hub, goods receiving |
| Person responsible / user | M. Brandt / MBRANDT |
| Category / hierarchy area | L (logistics in this system) / H1010-LOG |
| Currency / profit center | EUR / 1010-LOG |
| Lock actual revenues | X |
- Validate. Two cells are flagged: a description of 46 characters, over the 40 allowed, and a category typed as
H, which is not on the template's allow-list. Both are fixed in the sheet. - Simulate. Five rows pass. Two return
KS 070: they nameH1010-LGS, a typing error for the new node. One returnsKM 700: the IT cost center points at profit center1010-ITS, which is valid only from 01.04.2027. Controlling moves it to1010-LOGfor now, and a second Simulate is clean. - Run. All eight cost centers are created. Each row's Run Log shows SAP's result with user, time and system.
- Check. The controller opens
1010-5100inKS03, then displays the standard hierarchy and finds all eight underH1010-LOG. A test posting to one cost center in the quality client confirms it accepts costs and refuses revenue.
The asset file and the plan data for the hub can now name these cost centers, because they exist from the date both files use.
Changing cost centers in bulk: KS02, BAPI_COSTCENTER_CHANGEMULTIPLE and KS12
PostNow.ai changes existing cost centers through BAPI_COSTCENTER_CHANGEMULTIPLE, the counterpart of the create BAPI, either from a change list in the free KS02 cost center change template or through Mass Change.
- Same table, different rules. The change BAPI takes the same
COSTCENTERLISTline as the create, again without X structures. The change BAPI adds one import of its own,RESET_FILLED_FIELDS, a single flag for the whole call. Check what it does inSE37for your release, and test in Simulate what a blank cell does before the first bulk change. - The dates pick the period. Valid from and valid to on the row say which period the change applies to. A change from a date inside the existing validity splits the record, as described above.
- Mass Change sends the whole record back. PostNow.ai's SAP mass change downloads the current cost centers into Excel, you edit the cells that should change, and it posts only the changed rows. Because every column was filled from SAP first, an unchanged column sends back the value SAP already holds.
- KS12 for one value across a selection. SAP's own collective change,
KS12, selects cost centers by interval, group or controlling area and changes the fields of a list variant for a period you enter. SAP Help asks that the cost centers' validity lie completely within that period, and only fields with one value across it can be changed. It is covered with SAP's other mass transactions in SAP mass change.
Deleting is rarely the answer for a cost center that has had postings. To retire one, set its lock indicators so nothing new can post to it; the cost center and its history stay readable.
KS01 and cost centers in S/4HANA
PostNow.ai uses the same KS01 template on ECC and S/4HANA, because the cost center object and its BAPIs carry over: SAP KBA 3640191 on BAPI_COSTCENTER_CHANGEMULTIPLE, for example, lists SAP ERP and SAP S/4HANA alike. What changes is around the cost center:
| Topic | SAP ECC | SAP S/4HANA |
|---|---|---|
| Create and change | KS01, KS02 | KS01, KS02, and the Manage Cost Centers app |
| Standard hierarchy | OKEON, groups in KSH1/KSH2 | The same transactions, or the Manage Global Hierarchies app; check with controlling which one your system uses before changing nodes |
| Cost elements | Separate master data (KA01, KA06) | G/L accounts with a cost element category, maintained in FS00; see mass create G/L accounts (FS00) |
| Postings | CO documents next to FI documents | One line in the Universal Journal (ACDOCA) carries cost center, profit center and G/L account together |
| Initial data load | LSMW or a custom program | The Migration Cockpit's cost center object; S/4HANA Cloud Public Edition calls it "CO - Cost center (new)" |
The practical effect of the Universal Journal: a cost center with the wrong profit center now shows the error in the same line finance reports from, so the cost center to profit center assignment deserves the same care as the G/L account.
KS01 upload errors and the fix
PostNow.ai writes SAP's message to each failed row's Run Log, so the fix starts from the message text. These are the ones a bulk KS01 run meets most:
| Message | What it means | Fix |
|---|---|---|
KS 070 Area … cannot be used here | The hierarchy area names a group that is not an end node of the controlling area's standard hierarchy | Correct the node, or have controlling add it to the standard hierarchy before the run |
KS 055 Controlling area … does not have a standard hierarchy | No standard hierarchy is assigned to the controlling area | Controlling assigns one in the controlling area settings (OKKP); usually seen in a new test client |
KS 003 Cost center already exists from … to … | The cost center already exists, at least in part, in that interval | Check it in KS03. If the row is a duplicate, drop it. A changed value belongs in the KS02 change file; a later validity period is created in KS01 with dates that do not overlap the existing ones |
KM 700 Profit center … does not exist for … | The profit center does not exist on the cost center's dates | Create the profit center first, or extend its validity to cover the cost center's period |
KI 552 / KI 553 You have no authorization to change / display cost center … | The SAP user lacks K_CCA authorization for that cost center or controlling area. SAP KBA 3586639 reports that the create BAPI can return these with type S instead of E | Read the message text, not only the status; check the cost center in KS03 and have the user's role extended (SU53 shows the failed check) |
| Run Log: UNKNOWN (PostNow.ai) | SAP's answer was lost after the row was sent, so the cost center may have been created | Look the cost center up in KS03 before running the row again; Retry Failed leaves UNKNOWN rows alone |
Checklist before a KS01 mass upload
PostNow.ai checks formats and allowed values and keeps operators on the published template; this list covers the decisions that stay with controlling.
- The sheet holds one controlling area, and only new cost centers; changes are in a separate KS02 file.
- Every hierarchy area in the sheet is a node of the standard hierarchy today.
- Every profit center exists for the whole validity period of the cost centers that name it.
- Valid from is the first day the cost center may receive postings, not the date of the upload.
- Each category was chosen by controlling, and the lock columns are filled where the cost center must refuse revenues or other postings.
- Every company code is assigned to the controlling area, and the currency column is filled.
- Cost center and profit center columns are formatted as text, with Leading Zeros switched on where your numbers are numeric.
- Profit center and the other fields your controlling area needs are marked required in the template.
- Simulate has run clean on the whole sheet in the target client.
What to plan for in a KS01 mass upload
PostNow.ai creates cost centers through SAP's cost center interface, so SAP's own hierarchy, profit center and company code checks decide every result.
- Run SAP's checks in Simulate. Validate checks formats, lengths and allowed values in Excel; hierarchy, profit center and date checks start when SAP sees the cost center in Simulate.
- Load in order. Profit centers first, then the hierarchy nodes, then the cost centers; assets, purchase orders with account assignment
Kand plan data come after. - Review the design as a person. A cost center in a valid but unintended node passes every check, so controlling compares the hierarchy after the run with the design.
- Prove the posting, not only the record. Post one test document to a cost center of each category in the quality client before the production run.
- Leave time for planning. Plan data is loaded per cost center, so the structure has to be in SAP before planning opens. The free KP06 cost center planning template is the load that follows.
- Keep re-runs in the same workbook. The re-post check reads this sheet's Run Log, and UNKNOWN rows are checked in SAP before anyone runs them again.
Making a template like this repeatable for a team (designers who build, operators who only run, a published template in the central library) is covered in Excel to SAP automation. Cost centers next to the other master data objects are in SAP master data mass upload, and the journals and invoices that post to them are in SAP FICO mass posting.
Free KS01 cost center upload template
PostNow.ai publishes a free KS01 cost center template: one row per cost center, five sample rows, and a field guide that maps every column to its BAPI_COSTCENTER_CREATEMULTIPLE field. Its companion, the KS02 change template, is mapped to BAPI_COSTCENTER_CHANGEMULTIPLE. Open either in PostNow.ai to map and simulate it against your own system, or browse the other SAP master data templates.
