PP Program Custom development Background program

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

  • COHV Mass Processing of Production Orders. Sets TECO in bulk; no delivery tolerance, open reservation or COGI check.
  • CO02 Change Production Order. Sets TECO on one order; not practical for hundreds of old orders.

Tables used

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

TableRoleAccessSystem
AUFKOrder Master DataOrder type, plant and object numberReadECC + S/4
AFKOOrder Header Data for PP OrdersMRP controller and basic finish dateReadECC + S/4
AFPOOrder ItemOrder quantity, quantity received and last goods receipt dateReadECC + S/4
RESBReservation/Dependent RequirementsOpen component reservation checkReadECC + S/4
AFFWGoods Movements with Errors from ConfirmationsCheck for failed movements pending in COGIReadECC + S/4
JESTIndividual Object StatusSystem status; TECO is set through the BAPIWriteECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
S_WERKSPlantRange / multipleAUFK-WERKSYes1000
S_AUARTOrder typeRange / multipleAUFK-AUARTNoPP01
S_DISPOMRP controllerRange / multipleAFKO-DISPONo001
S_GLTRPBasic finish dateRange / multipleAFKO-GLTRPNo01.01.2026 – 31.10.2026
P_GRACEGrace period after last goods receipt (days)Single value—Yes14
P_TOLPCTUnder-delivery tolerance (%)Single value—No2
P_TESTTest mode (candidate list only)Checkbox—NoX

Result list columns

#ColumnSource
1Production orderAFKO-AUFNR
2MaterialAFPO-MATNR
3Order qtyAFPO-PSMNG
4Received qtyAFPO-WEMNG
5Delivered %Calculated AFPO-WEMNG ÷ AFPO-PSMNG × 100
6Open reservationsCalculated Number of RESB items with BDMNG − ENMNG > 0 and KZEAR blank
7COGI recordsCalculated Number of AFFW rows of the order
8Last goods receiptAFPO-LTRMI
9ResultCalculated Technically completed, candidate (test) or skipped
10MessageCalculated Reason for skipping or BAPI return message

Sample result list

Production orderMaterialOrder qtyReceived qtyDelivered %Open reservationsCOGI recordsLast goods receiptResultMessage
1000352FG-50031,0001,0001000010/20/2026Technically completedOrder technically completed
1000360FG-6100400396990010/22/2026Technically completedWithin tolerance (1% under-delivered)
1000371SF-22101501501002010/25/2026Skipped2 open reservation items
1000378FG-50038008001000110/28/2026Skipped1 failed goods movement pending in COGI
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. 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.
  3. 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.
  4. COGI check: if AFFW has records for the order, it is skipped; otherwise the failed movement becomes hard to follow after TECO.
  5. 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.
  6. 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

PP Package Custom

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 …

5 components · v1.0

Related reports

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: Automatic Technical Completion (TECO) of Production Orders Program