Cost Center Cost Plan Upload from Excel
Short answer: 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 test mode first, offers to overwrite or add to the existing plan and lists the result of every row.
- Estimated effort
- M · 3–5 working days
- System
- ECC and S/4HANA
- Tables
- 3
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
KP06 enters the plan cost center by cost center on layout-bound screens. Excel integration through the planner profile needs configuration and gives no error list per row. KSBL only displays the plan. A budget file with hundreds of cost centers and cost elements needs an upload program with test mode and results per row.
Who uses it? Budgeting and planning teams, controllers and finance teams that bring the annual budget into SAP.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| COSPCO Object: Cost Totals for External Postings | Primary cost plan totals (value type 01, plan version) | Write | ECC + S/4 |
| CSKSCost Center Master Record | Validity of the cost center in the fiscal year | Read | ECC + S/4 |
| CSKBCost Elements (Controlling Area Data) | Cost element defined as primary in the controlling area | Read | ECC + S/4 |
S/4HANA notes
- COSP → ACDOCA: In S/4HANA COSP is a view, not a table; actual totals are calculated from ACDOCA.
BAPIs and functions used
- BAPI_COSTACTPLN_POSTPRIMCOSTPost Primary Cost Planning. Posts the primary cost plan by cost center and cost element
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful packages permanently
- BAPI_TRANSACTION_ROLLBACKRoll Back BAPI Transaction. Rolls back the change in test mode and for failed packages
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\butce_2027.xlsx |
| P_KOKRS | Controlling area | Single value | CSKS-KOKRS | Yes | 1000 |
| P_GJAHR | Fiscal year | Single value | COSP-GJAHR | Yes | 2027 |
| P_VERSN | Plan version | Single value | COSP-VERSN | Yes | 0 |
| P_DELTA | Add to the existing plan (overwrite if not set) | Checkbox | — | No | — |
| P_TEST | Test mode (check without posting) | Checkbox | — | No | X |
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 | Cost element | COSP-KSTAR | Yes |
| 3 | Period (blank = annual) | By rule 1–12; if blank the amount is spread equally over 12 periods | No |
| 4 | Amount | By rule Written as the plan value of the period to COSP WKG001…WKG012 | No |
| 5 | Currency | COSP-TWAER | No |
Sample upload file
| 1 | Cost center * | Cost element * | Period (blank = annual) | Amount | Currency |
|---|---|---|---|---|---|
| 2 | 4100 | 770150 | 1 | 40,000 | TRY |
| 3 | 4100 | 770150 | 2 | 40,000 | TRY |
| 4 | 4300 | 760200 | 900,000 | TRY | |
| 5 | 4900 | 770300 | 1 | 30,000 | TRY |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | Cost center | CSKS-KOSTL |
| 3 | Cost element | COSP-KSTAR |
| 4 | Amount loaded | Calculated Total planned amount of the row |
| 5 | Status | Calculated From the BAPI return messages: posted, checked or error |
| 6 | Message | Calculated First error or success message from the BAPI return table |
Sample result list
| Row | Cost center | Cost element | Amount loaded | Status | Message |
|---|---|---|---|---|---|
| 2 | 4100 | 770150 | 40,000 | Posted | Plan for period 1 posted |
| 3 | 4100 | 770150 | 40,000 | Posted | Plan for period 2 posted |
| 4 | 4300 | 760200 | 900,000 | Posted | Annual amount spread equally over 12 periods |
| 5 | 4900 | 770300 | 30,000 | Error | Cost center 4900 is not valid in fiscal year 2027 |
How does the program work?
- The file is read from the user’s PC or, in a background job, from the application server; the first row is skipped as the header.
- Every row is checked: the cost center must be valid in the fiscal year (CSKS-DATAB/DATBI), the cost element must be a primary cost element in the controlling area (CSKB-KATYP), and the period must be between 1 and 12 or empty. An empty period means an annual amount that is spread equally over 12 periods.
- Rows are grouped by cost center / cost element and mapped to the header (controlling area, fiscal year, period range, version), object and period value structures of BAPI_COSTACTPLN_POSTPRIMCOST.
- With P_DELTA the amounts are added to the existing plan; without it the plan values are overwritten.
- In test mode the BAPI is called and rolled back with BAPI_TRANSACTION_ROLLBACK; in a real run BAPI_TRANSACTION_COMMIT is called after each cost center package. Results and messages are listed per row.
Performance notes
Calling the BAPI with one package per cost center isolates errors. Run files with tens of thousands of rows as a background job.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Download failed lines as a separate file Failed rows can be downloaded to a separate file, corrected and uploaded again.
- Export to Excel An empty upload template can be downloaded as Excel.
- Runs as a background job
Authorization objects
- K_CSKS_PLAPlanning authorization by cost center
Frequently asked questions
Can activity quantities and rates be loaded too?
The standard version loads the primary cost plan. Activity output and rate planning can be loaded with a separate BAPI using the same template logic; this extension adds 1–2 days to the effort range.
What happens if I load the plan a second time?
In overwrite mode the plan value for the same cost center, cost element and period is replaced by the file value. In add mode the amount is added to the existing plan, so add mode must be used carefully for correction files.
Can it be used on S/4HANA?
If classic cost center planning is still used on S/4HANA, the BAPI works the same way. If planning has moved to SAP Analytics Cloud or the new ACDOCP-based planning, the upload is adapted to that target.
Packages that include this solution
Cost Center Planning and Controlling Pack
A three-solution pack that covers the cost center planning cycle from start to end: plan upload from Excel, plan vs actual vs commitment comparison …
Related reports
Cost Center Plan vs Actual with Commitments Report
A custom ALV report that shows plan, actual and open purchasing commitments per cost center and cost element on one row, and calculates the remaining …
Mass G/L Journal Entry Upload from Excel
A custom program that posts multi-line G/L documents (accruals, reclassifications, allocation entries) in bulk from Excel or CSV rows. It checks every …
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.