Quick answer

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 700 for 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.

  1. 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.
  2. One row per cost center. The controlling area goes in the BAPI's CONTROLLINGAREA import; 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 the COSTCENTERLIST table. By default PostNow.ai sends each row as its own call, so SAP's answer belongs to exactly one cost center.
  3. 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.
  4. 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.
  5. Simulate. PostNow.ai calls BAPI_COSTCENTER_CREATEMULTIPLE for every row and then BAPI_TRANSACTION_ROLLBACK instead of a commit, so SAP's own messages appear on each row and no cost center is created.
  6. Run. For each row PostNow.ai calls the BAPI and commits with BAPI_TRANSACTION_COMMIT only 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.
  7. 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:

JobSAP transactionRoute in PostNow.ai
Create new cost centersKS01Template on BAPI_COSTCENTER_CREATEMULTIPLE, or a recording of KS01
Change existing cost centers from a listKS02Template on BAPI_COSTCENTER_CHANGEMULTIPLE (free KS02 template)
Download, edit and post backKS02PostNow.ai Mass Change: current values into Excel, edit, post the changed rows
Check the resultKS03, KS13The 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:

ColumnBAPI fieldWhat SAP checks or does with it
Controlling areaCONTROLLINGAREAThe organisational key of every cost center. Company code, hierarchy and categories are all checked against it.
Cost centerCOSTCENTERYou supply the number. A number that already exists in the period raises KS 003.
Valid from / Valid toVALID_FROM, VALID_TOThe 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, DescriptionNAME, DESCRIPTShort name (20 characters) and description (40). These are what reports and F4 lists show.
Person responsiblePERSON_IN_CHARGE, PERSON_IN_CHARGE_USERA name, plus the SAP user ID where your reports or workflows use it.
Cost center categoryCOSTCENTER_TYPEOne character from the categories defined in Customizing. It proposes the lock indicators (below).
Hierarchy areaCOSTCTR_HIER_GRPThe 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 codeCOMP_CODEMust be assigned to the controlling area.
CurrencyCURRENCYOn the KS01 screen SAP proposes the controlling area currency. Put the currency in the file explicitly so nothing depends on a default.
Profit centerPROFIT_CTRMust 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 areaBUS_AREA, FUNC_AREAWhere your ledger reports by them. A functional area can also be proposed by the category.
Lock indicatorsLOCK_IND_ACTUAL_PRIMARY_COSTS and the othersX 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 OKEON and its groups with KSH1 and KSH2; 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 raises KS 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 parameterKindWhat a KS01 upload puts in it
CONTROLLINGAREAImportThe controlling area, once per call
COSTCENTERLISTTableOne 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
LANGUAGEImportThe language of the name and description, where it differs from the logon language
EXTENSIONINTableCustomer fields added to the cost center master, declared as extensions in the template
RETURNTableSAP'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.

ColumnRow 2 (first cost center)
Controlling area / company codeA000 / 1010
Cost center / valid from / valid to1010-5100 / 01.01.2027 / 31.12.9999
Name / descriptionHub Receiving / Logistics hub, goods receiving
Person responsible / userM. Brandt / MBRANDT
Category / hierarchy areaL (logistics in this system) / H1010-LOG
Currency / profit centerEUR / 1010-LOG
Lock actual revenuesX
  1. 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.
  2. Simulate. Five rows pass. Two return KS 070: they name H1010-LGS, a typing error for the new node. One returns KM 700: the IT cost center points at profit center 1010-ITS, which is valid only from 01.04.2027. Controlling moves it to 1010-LOG for now, and a second Simulate is clean.
  3. Run. All eight cost centers are created. Each row's Run Log shows SAP's result with user, time and system.
  4. Check. The controller opens 1010-5100 in KS03, then displays the standard hierarchy and finds all eight under H1010-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 COSTCENTERLIST line 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 in SE37 for 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:

TopicSAP ECCSAP S/4HANA
Create and changeKS01, KS02KS01, KS02, and the Manage Cost Centers app
Standard hierarchyOKEON, groups in KSH1/KSH2The same transactions, or the Manage Global Hierarchies app; check with controlling which one your system uses before changing nodes
Cost elementsSeparate master data (KA01, KA06)G/L accounts with a cost element category, maintained in FS00; see mass create G/L accounts (FS00)
PostingsCO documents next to FI documentsOne line in the Universal Journal (ACDOCA) carries cost center, profit center and G/L account together
Initial data loadLSMW or a custom programThe 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:

MessageWhat it meansFix
KS 070 Area … cannot be used hereThe hierarchy area names a group that is not an end node of the controlling area's standard hierarchyCorrect the node, or have controlling add it to the standard hierarchy before the run
KS 055 Controlling area … does not have a standard hierarchyNo standard hierarchy is assigned to the controlling areaControlling 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 intervalCheck 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 datesCreate 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 ERead 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 createdLook 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.

  1. The sheet holds one controlling area, and only new cost centers; changes are in a separate KS02 file.
  2. Every hierarchy area in the sheet is a node of the standard hierarchy today.
  3. Every profit center exists for the whole validity period of the cost centers that name it.
  4. Valid from is the first day the cost center may receive postings, not the date of the upload.
  5. Each category was chosen by controlling, and the lock columns are filled where the cost center must refuse revenues or other postings.
  6. Every company code is assigned to the controlling area, and the currency column is filled.
  7. Cost center and profit center columns are formatted as text, with Leading Zeros switched on where your numbers are numeric.
  8. Profit center and the other fields your controlling area needs are marked required in the template.
  9. 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 K and 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.

Frequently asked questions

How do I mass create cost centers in SAP from Excel?
With PostNow.ai, put one row per cost center (controlling area, cost center, valid from and to, name, description, person responsible, category, hierarchy area, company code, currency, profit center) in a template mapped to BAPI_COSTCENTER_CREATEMULTIPLE, such as the free KS01 template. Validate checks the sheet offline, Simulate lets SAP check every cost center and rolls it back, and Run creates them and writes SAP's result to each row.
What is KS01 in SAP?
KS01 is the Cost Center Accounting transaction that creates a cost center master record in a controlling area. It holds the validity period, name and description, person responsible, cost center category, the node in the standard hierarchy, company code, currency, profit center and the lock indicators. KS02 changes a cost center, KS03 displays it and KS12 changes a selection of cost centers collectively.
Which BAPI creates cost centers?
BAPI_COSTCENTER_CREATEMULTIPLE. The controlling area goes in the CONTROLLINGAREA import and the cost centers in the COSTCENTERLIST table, one line each, with no X structures. SAP's messages come back in RETURN, and the call is committed with BAPI_TRANSACTION_COMMIT. Changes go through BAPI_COSTCENTER_CHANGEMULTIPLE, and BAPI_COSTCENTER_GETDETAIL1 reads a cost center.
Does the hierarchy node have to exist before the cost center?
Yes. Every cost center is assigned to an end node of the controlling area's standard hierarchy in its hierarchy area field. A group that is not an end node of the standard hierarchy raises KS 070 "Area ... cannot be used here", and a controlling area with no standard hierarchy raises KS 055. Have controlling create the missing nodes, top down, in OKEON or the Manage Global Hierarchies app before the cost center run.
Why must the profit center exist before the cost center?
The cost center carries its profit center as a time-dependent assignment, and SAP checks it against the cost center's validity period. A profit center that does not exist on those dates raises KM 700 "Profit center ... does not exist for ...". Create profit centers first, with validity dates that cover the cost centers that will point to them.
How do I change many cost centers at once (KS02 / KS12)?
PostNow.ai changes them through BAPI_COSTCENTER_CHANGEMULTIPLE, from a change list in the free KS02 template or with Mass Change, which downloads the current cost centers into Excel and posts only the rows you edited. Because the BAPI has no X structures, check its RESET_FILLED_FIELDS flag in SE37 and test in Simulate what a blank cell does. KS12 is SAP's own collective change for setting values on a selection of cost centers for a period you enter.
What does SAP cost center automation from Excel cover?
In PostNow.ai it covers creating cost centers (KS01, BAPI_COSTCENTER_CREATEMULTIPLE or a KS01 recording), changing them (KS02, BAPI_COSTCENTER_CHANGEMULTIPLE), downloading and editing them with Mass Change, and checking the result per row in the Run Log. Each user runs the published template under their own SAP login, with an optional approval before Run. The cost center design, hierarchy and categories are controlling's decision.
What changes for cost centers in S/4HANA?
The cost center object stays: KS01, KS02 and the cost center BAPIs work in S/4HANA, and the Manage Cost Centers app is added. Cost elements become G/L accounts maintained in FS00, the hierarchy can be maintained in the Manage Global Hierarchies app, and postings carry cost center, profit center and G/L account on one Universal Journal line.
Your cost center design. SAP's controlling rules.

Mass create your next SAP cost centers from Excel

Map KS01 once, simulate every cost center against its hierarchy and profit center, then create them all in one run.

Start free trial
  • 14-day free trial
  • Works with ECC and S/4HANA
  • Posts under your own SAP login