CO Program Custom development Mass upload

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

  • KS01 Create Cost Center. Creates one cost center; no bulk creation from a file.
  • KS12 Change Cost Centers (Collective). Changes several cost centers on screen; does not create cost centers or read a file.

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
CSKSCost Center Master RecordCost center master: validity, category, person responsible, company code, profit center, hierarchy nodeWriteECC + S/4
CSKTCost Center TextsCost center short and long description (per language)WriteECC + S/4
CEPCProfit Center Master DataCheck that the profit center is valid and unlockedReadECC + S/4
TKA02Controlling Area AssignmentCheck that the company code is assigned to the controlling areaReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\masraf_yerleri.xlsx
P_KOKRSControlling areaSingle valueCSKS-KOKRSYes1000
P_TESTTest mode (check without saving)Checkbox—NoX
P_CHANGEUpdate existing cost centersCheckbox—No—

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Cost centerCSKS-KOSTLYes
2Valid fromCSKS-DATABYes
3Valid toCSKS-DATBINo
4NameCSKT-KTEXTYes
5DescriptionCSKT-LTEXTNo
6Person responsibleCSKS-VERAKYes
7Cost center categoryCSKS-KOSARYes
8Hierarchy nodeCSKS-KHINRYes
9Company codeCSKS-BUKRSYes
10Profit centerCSKS-PRCTRYes
11Functional areaCSKS-FUNC_AREANo
12CurrencyCSKS-WAERSNo

Sample upload file

1Cost center *Valid from *Valid toName *DescriptionPerson responsible *Cost center category *Hierarchy node *Company code *Profit center *Functional areaCurrency
2412501/01/202712/31/9999Quality laboratoryBursa plant quality laboratoryM. ArslanFTR-URETIM1000PC21000300TRY
3412601/01/202712/31/9999Process engineeringBursa plant process engineeringS. KoçFTR-URETIM1000PC21000300TRY
4521001/01/202712/31/9999Ankara sales officeCentral Anatolia regional sales officeE. ŞahinVTR-SATIS2000PC33000400TRY
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Cost centerCSKS-KOSTL
3StatusCalculated From the BAPI return messages: created, updated or error
4MessageCalculated First error or success message from the BAPI return table

Sample result list

RowCost centerStatusMessage
24125CreatedCost center 4125 created
34126CreatedCost center 4126 created
45210ErrorProfit center PC3300 is locked
A view built with fictional sample data; not real system data.

How does the program work?

  1. The file is read; the first row is skipped as the header.
  2. 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.
  3. 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.
  4. 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.
  5. 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

CO Package Custom

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 …

4 components · v1.0

Related reports

CO Program Custom Mass upload

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 …

COSP · CSKS · CSKB

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.

Related report: Mass Cost Center Creation and Change Upload from Excel