Mass Technical Completion (TECO) of Maintenance Orders Without Open Items Program
Short answer: A custom background program that automatically technically completes maintenance orders that are fully confirmed and have no open material reservations or open purchase order items, after a grace period. Orders that fail a check are listed with the reason.
- Estimated effort
- M · 4–6 working days
- System
- ECC and S/4HANA
- Tables
- 6
- Scope
- Global
- Built by
- NeKuDos Teknoloji
- Last updated
Why is the standard not enough?
Orders can be selected in mass from the IW38 list and set to TECO, but checking for open reservations, purchase order items not yet received or unconfirmed operations before the selection is left to the user. Orders from maintenance plans ask for a completion date and need separate handling in a mass run. As a result hundreds of old orders stay open, costs land in the wrong period and the next calls of maintenance plans are delayed.
Who uses it? Maintenance planners, maintenance controllers and cost accounting teams that manage 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, creation date and object number | Read | ECC + S/4 |
| AFIHMaintenance Order Header | Maintenance planning plant, equipment and maintenance plan | Read | ECC + S/4 |
| RESBReservation/Dependent Requirements | Open material reservation check | Read | ECC + S/4 |
| EKKNAccount Assignment in Purchasing Document | Purchase order items assigned to the order | Read | ECC + S/4 |
| EKPOPurchasing Document Item | Delivery completed and deletion status of the purchase order item | Read | ECC + S/4 |
| JESTIndividual Object Status | System status; TECO is set through the BAPI | Write | ECC + S/4 |
BAPIs and functions used
- BAPI_ALM_ORDER_MAINTAINMaintain Maintenance/Service Order. Technically completes the maintenance 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_IWERK | Maintenance planning plant | Range / multiple | AFIH-IWERK | Yes | 1000 |
| S_AUART | Order type | Range / multiple | AUFK-AUART | No | PM01 |
| S_ERDAT | Order creation date | Range / multiple | AUFK-ERDAT | No | 01.01.2025 – 31.10.2026 |
| S_WARPL | Maintenance plan | Range / multiple | AFIH-WARPL | No | 120045 |
| P_GRACE | Grace period after last confirmation (days) | Single value | — | Yes | 14 |
| P_PCNF | Also accept partially confirmed orders | Checkbox | — | No | — |
| P_TEST | Test mode (candidate list only) | Checkbox | — | No | X |
Result list columns
| # | Column | Source |
|---|---|---|
| 1 | Maintenance order | AUFK-AUFNR |
| 2 | Order type | AUFK-AUART |
| 3 | Short text | AUFK-KTEXT |
| 4 | Equipment | AFIH-EQUNR |
| 5 | Maintenance plan | AFIH-WARPL |
| 6 | Open reservations | Calculated Number of RESB items with KZEAR and XLOEK blank and BDMNG − ENMNG > 0 |
| 7 | Open purchase items | Calculated Number of linked items via EKKN with EKPO-ELIKZ and EKPO-LOEKZ blank |
| 8 | Result | Calculated Technically completed, candidate (test) or skipped |
| 9 | Message | Calculated Reason for skipping or BAPI return message |
Sample result list
| Maintenance order | Order type | Short text | Equipment | Maintenance plan | Open reservations | Open purchase items | Result | Message |
|---|---|---|---|---|---|---|---|---|
| 4000098 | PM01 | Panel maintenance line 2 | 10004630 | 0 | 0 | Technically completed | Order technically completed | |
| 4000105 | PM02 | Monthly lubrication K-12 | 10004512 | 120045 | 0 | 0 | Technically completed | Completed with reference date 2026-10-29 |
| 4000123 | PM01 | Compressor K-12 overhaul | 10004512 | 0 | 1 | Skipped | 4500013120/00010 delivery not completed | |
| 4000131 | PM01 | Overhead crane periodic check | 10004801 | 2 | 0 | Skipped | 2 open reservations |
How does the program work?
- Maintenance orders are read from AUFK and AFIH for the maintenance planning plant, order type and creation date on the selection screen; those with released (I0002) active and neither TECO (I0045) nor the deletion flag (I0076) active in JEST become candidates.
- Confirmation check: the order must have the confirmed (I0009) status active; by selection, partially confirmed (I0010) orders can also be accepted.
- If RESB has a reservation without final issue (KZEAR blank), not deleted (XLOEK blank) and with an open quantity (BDMNG − ENMNG) above zero, the order is skipped.
- Purchase order items linked to the order are found through EKKN; when an item in EKPO is neither delivery completed (ELIKZ) nor deleted, the order is skipped.
- When the grace period since the last confirmation or last movement has not passed, the order is left for the next run.
- Orders that pass the checks are completed with BAPI_ALM_ORDER_MAINTAIN using the TECHNICALCOMPLETE and SAVE methods; for orders from maintenance plans the last confirmation date is passed as the reference date, then BAPI_TRANSACTION_COMMIT is called. In test mode only the candidate list and the skip reasons are shown.
Performance notes
Narrow the candidates by status and date; read RESB and EKKN once with the order list. Completing orders one by one through the BAPI isolates errors. The program is scheduled weekly or as a nightly job before month end.
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 maintenance planning.
Authorization objects
- I_IWERKChange orders (TECO) by maintenance planning plant
- I_AUARTMaintenance order authorization by order type
Frequently asked questions
Why does the completion date matter for orders from maintenance plans?
For plans scheduled by completion date or performance, the next call is calculated from the completion date of the previous order. The program therefore passes the last confirmation date, not today, as the reference date, so the plan schedule does not shift.
Are the linked notifications completed too?
Optionally, the notification linked to the order can be completed in the same run with BAPI_ALM_NOTIF_CLOSE. This option is added to the selection screen and adds about one day to the base effort range.
Is cost settlement done as well?
No. TECO stops new planning and material movements on the order; settlement and closing are done separately in the month-end process. Orders with a balance after TECO can be followed with the settlement check report on the controlling side.
Related reports
Orders Without Settlement Rule or With Unsettled Balance Report
A custom ALV report that lists orders that received costs but have no settlement rule, and internal and production orders that still carry a balance …
Overdue Maintenance Orders and Backlog by Work Center Report
A custom ALV report that lists open maintenance orders past their basic finish date with days late and remaining work hours, and calculates how many …
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.