# Mass TECO and Close (CLSD) Status Change Program for WBS Elements

> A custom background program that runs selected WBS elements, or those listed in a file, through checks for open commitments, non-zero balance and open networks, and sets technically completed (TECO) or closed (CLSD) in bulk for those that pass. For every WBS element that fails, the reason is listed.

- Type: Program, Custom development, Background program
- Module: PS
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-teco-and-close-status-change-program-for-wbs-elements/


## Why is the standard not enough?

In CJ20N and CJ02 the status is set by hand for each project or WBS element; a status set at the top of the structure passes down to lower elements but does not check which element is ready to close. For CLSD the zero balance and open commitment checks come back to the user one error message at a time. Companies with hundreds of old WBS elements spend days on this by hand at year end.

### Closest standard alternatives

- CJ20N: Sets the status by hand for a project or WBS element; does not check collectively which ones are ready to close.
- CJ02: Changes one WBS element; has no mass processing or check list.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| JEST | Object status: TECO or CLSD becomes active here; also read for the current status | Write | - | ECC + S/4 |
| JCDS | Status change document | Write | JCDS-OBJNR = JEST-OBJNR | ECC + S/4 |
| PRPS | WBS element: external number, description, object number | Read | PRPS-OBJNR = JEST-OBJNR | ECC + S/4 |
| PROJ | Project definition (BAPI call per project) | Read | PROJ-PSPNR = PRPS-PSPHI | ECC + S/4 |
| RPSCO | Open requisition and order commitment | Read | RPSCO-OBJNR = PRPS-OBJNR | ECC + S/4 |
| COSP | Actual balance (settlement check) | Read | COSP-OBJNR = PRPS-OBJNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_PS_INITIALIZATION: Starts the PS BAPI logical unit
- BAPI_BUS2054_SET_STATUS: Sets the TECO or CLSD system status on WBS elements
- BAPI_PS_PRECOMMIT: Checks the changes before saving
- BAPI_TRANSACTION_COMMIT: Saves the status changes permanently
- BAPI_TRANSACTION_ROLLBACK: Rolls back changes in test mode or on error
- STATUS_READ: Reads the current statuses of the WBS element

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_PSPID | Project definition | Range / multiple | PROJ-PSPID | No |
| S_POSID | WBS element | Range / multiple | PRPS-POSID | No |
| S_PBUKR | Company code | Range / multiple | PRPS-PBUKR | Yes |
| R_TECO | Target status: TECO (otherwise CLSD) | Radio button | - | No |
| P_CHKCM | Check open commitments | Checkbox | - | No |
| P_CHKBL | Check zero balance (CLSD) | Checkbox | - | No |
| P_FILE | WBS list file (optional) | Single value | - | No |
| P_TEST | Test mode (check without changing) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Project | PROJ-PSPID |
| WBS element | PRPS-POSID |
| Description | PRPS-POST1 |
| Current status | Calculated: Active system status read with STATUS_READ |
| Target status | Calculated: TECO or CLSD from the selection screen |
| Open commitment | Calculated: Σ RPSCO values (WRTTP 21, 22) |
| Balance | Calculated: Σ COSP actual values (WRTTP 04, all years) |
| Check result | Calculated: Passed or the first failed check |
| Status | Calculated: Changed, skipped or error |
| Message | Calculated: Skip reason or BAPI return message |

## How does the program work?

1. WBS elements are read from the selection screen (project, WBS, company code) or from the list given with P_FILE; the current status comes from JEST (STATUS_READ), and those that already have the target status are skipped.
2. TECO checks: requisition and order commitments in RPSCO (WRTTP 21, 22) must be zero (P_CHKCM); linked networks must also be TECO or be completed together.
3. CLSD checks: the WBS element must already be TECO; the all-year total of actual values (WRTTP 04) in COSP must be zero, meaning it has been settled (P_CHKBL); there must be no open commitment.
4. WBS elements that pass are processed per project with BAPI_PS_INITIALIZATION, BAPI_BUS2054_SET_STATUS (target system status TECO or CLSD) and BAPI_PS_PRECOMMIT; in test mode BAPI_TRANSACTION_ROLLBACK follows PRECOMMIT.
5. In a real run BAPI_TRANSACTION_COMMIT is done per project; the status change is written to JEST and the change document to JCDS. The result list gives the changed, skipped and failed WBS elements with their reasons.

## Authorization objects

- C_PROJ_TCD: Authorization by project business transaction (status change)
- C_PROJ_KOK: Project authorization by controlling area

## Frequently asked questions

### Can the TECO or CLSD status be reversed?

Yes. Both statuses can be reversed in CJ20N with the business transaction. If needed, the program can be extended with an undo option that returns the same list to its previous status in bulk.

### Are linked networks closed as well?

When a WBS element is set to TECO, the linked networks need to be completed too. The program checks the networks and can optionally set the network status in the same run with BAPI_BUS2002_SET_STATUS.

### Does the program work on S/4HANA?

Yes. The PS BAPIs and status tables are the same in S/4HANA. On S/4HANA the balance check can be done directly from ACDOCA if preferred.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=ps-wbs-mass-status-change
