Mass Cost Center Creation and Change Upload from Excel
Short answer: A custom program that creates or updates cost centers in bulk from Excel or CSV rows, with description, person responsible, company code, profit center and standard hierarchy node. It checks everything in test mode first, then lists the result of every row.
- Estimated effort
- M · 3–5 working days
- System
- ECC and S/4HANA
- Tables
- 4
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
KS01 creates one cost center; KS12 changes several cost centers on screen but neither reads a file nor creates new ones. In a reorganization, hundreds of cost centers must be created on the same day with the right profit center and hierarchy; doing this by hand takes days and is error-prone.
Who uses it? Controllers, master data teams and CO consultants handling reorganizations, new companies or new plants.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| CSKSCost Center Master Record | Cost center master: validity, category, person responsible, company code, profit center, hierarchy node | Write | ECC + S/4 |
| CSKTCost Center Texts | Cost center short and long description (per language) | Write | ECC + S/4 |
| CEPCProfit Center Master Data | Check that the profit center is valid and unlocked | Read | ECC + S/4 |
| TKA02Controlling Area Assignment | Check that the company code is assigned to the controlling area | Read | ECC + S/4 |
BAPIs and functions used
- BAPI_COSTCENTER_CREATEMULTIPLECreate One or More Cost Centers. Creates new cost centers
- BAPI_COSTCENTER_CHANGEMULTIPLEChange One or More Cost Centers. Updates existing cost centers
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful rows permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back changes in test mode and for a failed package
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\masraf_yerleri.xlsx |
| P_KOKRS | Controlling area | Single value | CSKS-KOKRS | Yes | 1000 |
| P_TEST | Test mode (check without saving) | Checkbox | — | No | X |
| P_CHANGE | Update existing cost centers | Checkbox | — | No | — |
Input file columns
The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.
| # | Column | Target field | Required |
|---|---|---|---|
| 1 | Cost center | CSKS-KOSTL | Yes |
| 2 | Valid from | CSKS-DATAB | Yes |
| 3 | Valid to | CSKS-DATBI | No |
| 4 | Name | CSKT-KTEXT | Yes |
| 5 | Description | CSKT-LTEXT | No |
| 6 | Person responsible | CSKS-VERAK | Yes |
| 7 | Cost center category | CSKS-KOSAR | Yes |
| 8 | Hierarchy node | CSKS-KHINR | Yes |
| 9 | Company code | CSKS-BUKRS | Yes |
| 10 | Profit center | CSKS-PRCTR | Yes |
| 11 | Functional area | CSKS-FUNC_AREA | No |
| 12 | Currency | CSKS-WAERS | No |
Sample upload file
| 1 | Cost center * | Valid from * | Valid to | Name * | Description | Person responsible * | Cost center category * | Hierarchy node * | Company code * | Profit center * | Functional area | Currency |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 4125 | 01/01/2027 | 12/31/9999 | Quality laboratory | Bursa plant quality laboratory | M. Arslan | F | TR-URETIM | 1000 | PC2100 | 0300 | TRY |
| 3 | 4126 | 01/01/2027 | 12/31/9999 | Process engineering | Bursa plant process engineering | S. Koç | F | TR-URETIM | 1000 | PC2100 | 0300 | TRY |
| 4 | 5210 | 01/01/2027 | 12/31/9999 | Ankara sales office | Central Anatolia regional sales office | E. Şahin | V | TR-SATIS | 2000 | PC3300 | 0400 | TRY |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Cost center | CSKS-KOSTL |
| 3 | Status | Calculated From the BAPI return messages: created, updated or error |
| 4 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Cost center | Status | Message |
|---|---|---|---|
| 2 | 4125 | Created | Cost center 4125 created |
| 3 | 4126 | Created | Cost center 4126 created |
| 4 | 5210 | Error | Profit center PC3300 is locked |
How does the program work?
- The file is read; the first row is skipped as the header.
- Every row is checked for mandatory fields and values: the company code must be assigned to the controlling area, the profit center must be valid and unlocked in CEPC, and the cost center category and currency must exist.
- If the cost center and valid-from date already exist in CSKS, the row is processed as a change (when P_CHANGE is set), otherwise as a new record.
- Rows are mapped to the BAPI_COSTCENTER_CREATEMULTIPLE or BAPI_COSTCENTER_CHANGEMULTIPLE structures; in test mode the BAPI is called with its test flag and rolled back with BAPI_TRANSACTION_ROLLBACK.
- In a real run, successful rows are saved with BAPI_TRANSACTION_COMMIT; results and messages are listed per row, and failed rows can be downloaded as a separate file.
Performance notes
The BAPI can take several cost centers in one call; sending rows in packages of 100 balances speed and error isolation well. Files with thousands of rows can run in the background.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file The corrected file can be uploaded again with the same template.
- Export to Excel An empty upload template can be downloaded as Excel.
- Runs as a background job
Authorization objects
- K_CSKSCost center master maintenance authorization by controlling area
- K_CCACost center accounting authorization
Frequently asked questions
Can cost center groups be created too?
The hierarchy node in the file must exist in the standard hierarchy. If new nodes should be created from the file as well, a group creation step can be added to the program; this extra scope increases the effort range.
How are time-dependent changes made?
If the valid-from date is given with a new date, a new time slice of the cost center is created from that date; a profit center change from the new year is loaded this way, for example.
Can it be used on S/4HANA?
Yes. The cost center BAPIs are supported on S/4HANA as well. With a clean core approach the same flow can be built on the released cost center APIs.
Packages that include this solution
Cost Center Reorganization Pack
A four-component pack for rebuilding the cost center structure after an organizational change: mass cost center creation and change from Excel, cost …
Related reports
Cost Center Cost Plan Upload from Excel
A custom program that loads periodic plan amounts per cost center and cost element from a budget file into the CO plan in bulk. It checks every row in …
Cost Centers with Missing or Invalid Profit Center Assignment Report
A custom ALV report that checks cost centers, and optionally internal orders, for their profit center assignment and lists records where the …
Let us build this program for your system
Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.