CO Program Custom development Mass upload

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

  • KP06 Change Cost Element/Activity Input Planning. Enters the plan on a layout-bound screen; no bulk upload from a file with results per row.
  • KSBL Cost Centers: Planning Overview. Displays the cost center plan; does not enter plan values.

Tables used

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

TableRoleAccessSystem
COSPCO Object: Cost Totals for External PostingsPrimary cost plan totals (value type 01, plan version)WriteECC + S/4
CSKSCost Center Master RecordValidity of the cost center in the fiscal yearReadECC + S/4
CSKBCost Elements (Controlling Area Data)Cost element defined as primary in the controlling areaReadECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\butce_2027.xlsx
P_KOKRSControlling areaSingle valueCSKS-KOKRSYes1000
P_GJAHRFiscal yearSingle valueCOSP-GJAHRYes2027
P_VERSNPlan versionSingle valueCOSP-VERSNYes0
P_DELTAAdd to the existing plan (overwrite if not set)Checkbox—No—
P_TESTTest mode (check without posting)Checkbox—NoX

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
2Cost elementCOSP-KSTARYes
3Period (blank = annual)By rule 1–12; if blank the amount is spread equally over 12 periodsNo
4AmountBy rule Written as the plan value of the period to COSP WKG001…WKG012No
5CurrencyCOSP-TWAERNo

Sample upload file

1Cost center *Cost element *Period (blank = annual)AmountCurrency
24100770150140,000TRY
34100770150240,000TRY
44300760200900,000TRY
54900770300130,000TRY
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2Cost centerCSKS-KOSTL
3Cost elementCOSP-KSTAR
4Amount loadedCalculated Total planned amount of the row
5StatusCalculated From the BAPI return messages: posted, checked or error
6MessageCalculated First error or success message from the BAPI return table

Sample result list

RowCost centerCost elementAmount loadedStatusMessage
2410077015040,000PostedPlan for period 1 posted
3410077015040,000PostedPlan for period 2 posted
44300760200900,000PostedAnnual amount spread equally over 12 periods
5490077030030,000ErrorCost center 4900 is not valid in fiscal year 2027
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. 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.
  3. 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.
  4. With P_DELTA the amounts are added to the existing plan; without it the plan values are overwritten.
  5. 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

CO Package Custom

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 …

3 components · v1.0

Related reports

CO Report Custom ALV report

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 …

COSP · COSS · CSKS · CSKT

FI Program Custom Mass upload

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 …

BKPF · BSEG · SKB1 · CSKS

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: Cost Center Cost Plan Upload from Excel