Automatic Technical Completion (TECO) of Production Orders Program
Short answer: A custom background program that finds production orders that are fully delivered, have no open reservations or COGI records left and whose last goods receipt is older than a grace period, and technically completes them automatically. Orders that fail a check are listed with the reason.
- Estimated effort
- M · 3–5 working days
- System
- ECC and S/4HANA
- Tables
- 6
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
COHV can set TECO in bulk but only looks at the selection criteria; it does not check the delivery tolerance, open reservations, movements pending in COGI or the time since the last goods receipt. Unchecked TECO hides open reservations and failed movements; without TECO, hundreds of old orders stay open, inflate month-end WIP and variance runs and leave wrong requirements in MRP.
Who uses it? Production planners, cost accountants and the PP/CO teams that run month-end closing.
Closest standard alternatives
Tables used
The tables the program reads and updates. ECC and S/4HANA differences are marked separately.
| Table | Role | Access | System |
|---|---|---|---|
| AUFKOrder Master Data | Order type, plant and object number | Read | ECC + S/4 |
| AFKOOrder Header Data for PP Orders | MRP controller and basic finish date | Read | ECC + S/4 |
| AFPOOrder Item | Order quantity, quantity received and last goods receipt date | Read | ECC + S/4 |
| RESBReservation/Dependent Requirements | Open component reservation check | Read | ECC + S/4 |
| AFFWGoods Movements with Errors from Confirmations | Check for failed movements pending in COGI | Read | ECC + S/4 |
| JESTIndividual Object Status | System status; TECO is set through the BAPI | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_PRODORD_COMPLETE_TECHTechnically Complete Production Orders. Technically completes the orders that pass the checks
- BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves the status change permanently
Selection screen parameters
| Parameter | Description | Type | Reference field | Required | Example |
|---|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | AUFK-WERKS | Yes | 1000 |
| S_AUART | Order type | Range / multiple | AUFK-AUART | No | PP01 |
| S_DISPO | MRP controller | Range / multiple | AFKO-DISPO | No | 001 |
| S_GLTRP | Basic finish date | Range / multiple | AFKO-GLTRP | No | 01.01.2026 – 31.10.2026 |
| P_GRACE | Grace period after last goods receipt (days) | Single value | — | Yes | 14 |
| P_TOLPCT | Under-delivery tolerance (%) | Single value | — | No | 2 |
| P_TEST | Test mode (candidate list only) | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Production order | AFKO-AUFNR |
| 2 | Material | AFPO-MATNR |
| 3 | Order qty | AFPO-PSMNG |
| 4 | Received qty | AFPO-WEMNG |
| 5 | Delivered % | Calculated AFPO-WEMNG ÷ AFPO-PSMNG × 100 |
| 6 | Open reservations | Calculated Number of RESB items with BDMNG − ENMNG > 0 and KZEAR blank |
| 7 | COGI records | Calculated Number of AFFW rows of the order |
| 8 | Last goods receipt | AFPO-LTRMI |
| 9 | Result | Calculated Technically completed, candidate (test) or skipped |
| 10 | Message | Calculated Reason for skipping or BAPI return message |
Sample result list
| Production order | Material | Order qty | Received qty | Delivered % | Open reservations | COGI records | Last goods receipt | Result | Message |
|---|---|---|---|---|---|---|---|---|---|
| 1000352 | FG-5003 | 1,000 | 1,000 | 100 | 0 | 0 | 10/20/2026 | Technically completed | Order technically completed |
| 1000360 | FG-6100 | 400 | 396 | 99 | 0 | 0 | 10/22/2026 | Technically completed | Within tolerance (1% under-delivered) |
| 1000371 | SF-2210 | 150 | 150 | 100 | 2 | 0 | 10/25/2026 | Skipped | 2 open reservation items |
| 1000378 | FG-5003 | 800 | 800 | 100 | 0 | 1 | 10/28/2026 | Skipped | 1 failed goods movement pending in COGI |
How does the program work?
- Production orders in the selection are read from AUFK and AFKO; orders with REL (I0002) active and TECO (I0045), CLSD (I0046) and the deletion flag (I0076) inactive in JEST become candidates.
- Delivery check: AFPO-WEMNG ≥ AFPO-PSMNG × (1 − tolerance ÷ 100), or the delivery completed flag (AFPO-ELIKZ) is set. The last goods receipt date (AFPO-LTRMI) must be older than the grace period.
- Open reservation check: if RESB has an item of the order that is not deleted (XLOEK blank), has no final issue (KZEAR blank) and BDMNG − ENMNG > 0, the order is skipped.
- COGI check: if AFFW has records for the order, it is skipped; otherwise the failed movement becomes hard to follow after TECO.
- For orders that pass all checks BAPI_PRODORD_COMPLETE_TECH is called and saved with BAPI_TRANSACTION_COMMIT; in test mode the BAPI is not called and only the candidate list is produced. Reservations and capacity requirements are closed as standard and TECO becomes active in JEST.
- The result is written to the application log and a summary is emailed to planning.
Performance notes
Run the program weekly or as a nightly background job before month end. Do the RESB and AFFW checks once with FOR ALL ENTRIES for the candidate orders; call the BAPI in packages (for example 50 orders) and commit after each package.
Features
- Test mode (check without posting)
- Line-by-line result and error log
- Runs as a background job Scheduled weekly or as a nightly job before month end.
- Send the result by email A summary of completed and skipped orders is sent to planning.
Authorization objects
- C_AFKO_AWKAuthorization to change orders (TECO) by plant and order type
- C_AFKO_AWAProduction order authorization by order type
Frequently asked questions
Can TECO be reversed?
Yes. Technical completion can be reversed as standard (revoke TECO in CO02). The program logs the orders it completes in every run, so it is always clear which order was completed when.
Does the program close (CLSD) the orders?
No. The program only sets TECO. Closing should follow variance calculation and settlement; if needed, it can be added as a separate step with BAPI_PRODORD_CLOSE.
Can it be used on S/4HANA?
Yes. BAPI_PRODORD_COMPLETE_TECH and the tables it reads work the same way on S/4HANA.
Packages that include this solution
Production Order Control Pack
A pack that combines four reports and one background program for the daily production meeting with one plant and MRP controller selection: overdue …
Related reports
Production Orders with Consumption but No Goods Receipt Report
A custom ALV report that lists production orders with posted component consumption but no or very little goods receipt, with consumed value, receipt …
Overdue Production Orders and Remaining Quantity Report
A custom ALV report that lists production orders past their basic finish date that are not yet fully received, with days late, remaining quantity and …
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.