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
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 | Periodic plan cost of the WBS element (WRTTP 01) | Write | ECC + S/4 |
| PRPSWBS Element Master Data | WBS element existence, planning flag and controlling area | Read | ECC + S/4 |
| PROJProject Definition | Project definition and closing check | Read | ECC + S/4 |
| JESTIndividual Object Status | Whether the WBS status allows planning | 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_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
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | — | Yes | C:\temp\proje_plan_2027.xlsx |
| P_KOKRS | Controlling area | Single value | PRPS-PKOKR | Yes | 1000 |
| P_VERSN | Plan version | Single value | COSP-VERSN | Yes | 0 |
| P_DELTA | Delta mode (write only the difference to the existing plan) | 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 | WBS element | PRPS-POSID | Yes |
| 2 | Cost element | COSP-KSTAR | Yes |
| 3 | Fiscal year | COSP-GJAHR | Yes |
| 4 | From period | By rule 1–12; 1 if blank | No |
| 5 | To period | By rule 1–12; 12 if blank | No |
| 6 | Amount | By rule Written into the COSP-WKG001…WKG012 period fields according to the distribution key | No |
| 7 | Currency | COSP-TWAER | No |
| 8 | Distribution key | By rule 1 = equal distribution, 0 = single entry in the from period | No |
Sample upload file
| 1 | WBS element * | Cost element * | Fiscal year * | From period | To period | Amount | Currency | Distribution key |
|---|---|---|---|---|---|---|---|---|
| 2 | P-27003-01 | 620000 | 2027 | 1 | 12 | 480,000 | TRY | 1 |
| 3 | P-27003-02 | 400100 | 2027 | 3 | 8 | 1,250,000 | TRY | 1 |
| 4 | P-27003-02 | 620000 | 2027 | 6 | 6 | 85,000 | TRY | 0 |
| 5 | P-27009-01 | 417000 | 2027 | 1 | 12 | 210,000 | EUR | 1 |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Row | Calculated Row number in the file |
| 2 | WBS element | PRPS-POSID |
| 3 | Description | PRPS-POST1 |
| 4 | Cost element | COSP-KSTAR |
| 5 | Fiscal year | COSP-GJAHR |
| 6 | Amount posted | Calculated In delta mode file amount − existing plan, otherwise file amount |
| 7 | Status | Calculated Posted, test passed or error |
| 8 | Message | Calculated Pre-check or BAPI return message |
Sample result list
| Row | WBS element | Description | Cost element | Fiscal year | Amount posted | Status | Message |
|---|---|---|---|---|---|---|---|
| 2 | P-27003-01 | Engineering | 620000 | 2027 | 480,000 | Posted | Distributed equally over 12 periods |
| 3 | P-27003-02 | Fabrication | 400100 | 2027 | 1,250,000 | Posted | Distributed over periods 3–8 |
| 4 | P-27003-02 | Fabrication | 620000 | 2027 | 85,000 | Posted | Written to period 6 |
| 5 | P-27009-01 | Site works | 417000 | 2027 | 0 | Error | WBS element is not a planning element |
How does the program work?
- The file is read; WBS element, cost element, fiscal year and amount are mandatory.
- 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.
- 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).
- 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.
- 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
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 …
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 …
Project Definition and WBS Structure Upload from Excel Program
A custom program that creates the project definition and a multi-level WBS structure in bulk from Excel rows, including descriptions, dates, …
WBS Plan Cost vs Original Budget vs Current Budget Comparison Report
A custom ALV report that places the original budget, supplements, returns, budget transfers, current budget and plan cost of each WBS element side by …
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.