PS Program Custom development Mass upload

WBS Element Cost Element Plan Upload from Excel Program

Short answer: A custom program that loads the WBS × cost element × period plan prepared by project teams in Excel into SAP in one run, tests it first and returns a result per row. During the annual planning cycle and revisions, the plan of hundreds of WBS elements is updated without manual entry.

Estimated effort
M · 4–6 working days
System
ECC and S/4HANA
Tables
4
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

CJR2 enters the cost element plan screen by screen per WBS element; although the planning layout supports a file transfer, the file format is rigid and it gives no pre-check and no error list per row. CJ40 only maintains the overall plan. The custom program reads a flexible Excel template, checks the WBS status and planning flag, runs the BAPI check in test mode and returns errors as a file.

Who uses it? Project control (PMO) teams, project cost accounting and project managers.

Closest standard alternatives

  • CJR2 PS: Change Plan Cost Element/Activity Input. Enters the cost element plan per WBS element on screen; no flexible Excel template, pre-check or error file.
  • CJ40 Change Project Plan. Maintains only the overall plan without cost elements.

Tables used

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

TableRoleAccessSystem
COSPCO Object: Cost Totals for External PostingsPeriodic plan cost of the WBS element (WRTTP 01)WriteECC + S/4
PRPSWBS Element Master DataWBS element existence, planning flag and controlling areaReadECC + S/4
PROJProject DefinitionProject definition and closing checkReadECC + S/4
JESTIndividual Object StatusWhether the WBS status allows planningReadECC + 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_CHECKPRIMCOSTPrimary Cost Planning: Check. Checks the plan lines without saving in test mode
  • BAPI_COSTACTPLN_POSTPRIMCOSTPost Primary Cost Planning. Writes the cost element plan into the periods for the WBS element
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful plan groups permanently

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\proje_plan_2027.xlsx
P_KOKRSControlling areaSingle valuePRPS-PKOKRYes1000
P_VERSNPlan versionSingle valueCOSP-VERSNYes0
P_DELTADelta mode (write only the difference to the existing plan)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
1WBS elementPRPS-POSIDYes
2Cost elementCOSP-KSTARYes
3Fiscal yearCOSP-GJAHRYes
4From periodBy rule 1–12; 1 if blankNo
5To periodBy rule 1–12; 12 if blankNo
6AmountBy rule Written into the COSP-WKG001…WKG012 period fields according to the distribution keyNo
7CurrencyCOSP-TWAERNo
8Distribution keyBy rule 1 = equal distribution, 0 = single entry in the from periodNo

Sample upload file

1WBS element *Cost element *Fiscal year *From periodTo periodAmountCurrencyDistribution key
2P-27003-016200002027112480,000TRY1
3P-27003-024001002027381,250,000TRY1
4P-27003-0262000020276685,000TRY0
5P-27009-014170002027112210,000EUR1
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1RowCalculated Row number in the file
2WBS elementPRPS-POSID
3DescriptionPRPS-POST1
4Cost elementCOSP-KSTAR
5Fiscal yearCOSP-GJAHR
6Amount postedCalculated In delta mode file amount − existing plan, otherwise file amount
7StatusCalculated Posted, test passed or error
8MessageCalculated Pre-check or BAPI return message

Sample result list

RowWBS elementDescriptionCost elementFiscal yearAmount postedStatusMessage
2P-27003-01Engineering6200002027480,000PostedDistributed equally over 12 periods
3P-27003-02Fabrication40010020271,250,000PostedDistributed over periods 3–8
4P-27003-02Fabrication620000202785,000PostedWritten to period 6
5P-27009-01Site works41700020270ErrorWBS element is not a planning element
A view built with fictional sample data; not real system data.

How does the program work?

  1. The file is read; WBS element, cost element, fiscal year and amount are mandatory.
  2. Pre-checks: the WBS element exists in PRPS, is a planning element (PLAKZ = X), belongs to the controlling area on the selection screen and its project is not closed; the cost element is valid in the selected controlling area.
  3. Rows are grouped by WBS element, fiscal year and version. The amount is split into period values between the start and end period according to the distribution key (equal distribution or a single period).
  4. In test mode BAPI_COSTACTPLN_CHECKPRIMCOST is called, in a real run BAPI_COSTACTPLN_POSTPRIMCOST, with the WBS element as the object. If “delta mode” is selected, the existing COSP plan values are read and only the difference is written.
  5. Successful groups are saved with BAPI_TRANSACTION_COMMIT. The result of each row is shown in the ALV log; failed rows can be exported to a correction file.

Performance notes

Do the PRPS check in a single read with all WBS numbers from the file. Call the BAPI once per WBS and year group instead of once per row; for large plans run the program in the background.

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 in the same template and uploaded again after correction.
  • Export to Excel The existing plan can be downloaded in the upload template format for the selected projects.
  • Runs as a background job

Authorization objects

  • C_PROJ_KOKProject authorization by controlling area
  • C_PRPS_KOKWBS element planning authorization by controlling area

Frequently asked questions

Is the existing plan overwritten or added to?

By default the amount in the file becomes the plan of the related periods. In delta mode the program reads the existing COSP plan values and saves only the difference; this avoids rewriting unchanged rows during revisions.

Is the budget created automatically after the plan upload?

No. Plan and budget are separate values. The budget can be copied from the approved plan in CJ30, or a separate budget upload step can be added if the customer wants.

Can it be used on S/4HANA?

Yes. BAPI_COSTACTPLN_POSTPRIMCOST is supported in S/4HANA for classic planning. If the customer has moved to the new planning solution, the same file template can be routed to its upload interface.

Packages that include this solution

PS Package Custom

Project Planning and Earned Value Pack

A four-component pack that brings the project plan into SAP and measures performance with earned value: WBS cost plan upload from Excel, transfer of …

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: WBS Element Cost Element Plan Upload from Excel Program