PM Program Custom development Background program

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

  • IW38 Change PM Orders (List). Can select orders in mass and set TECO; the open reservation and purchase check is left to the user.
  • IW32 Change Maintenance Order. Changes and completes a single maintenance order.

Tables used

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

TableRoleAccessSystem
AUFKOrder Master DataOrder type, creation date and object numberReadECC + S/4
AFIHMaintenance Order HeaderMaintenance planning plant, equipment and maintenance planReadECC + S/4
RESBReservation/Dependent RequirementsOpen material reservation checkReadECC + S/4
EKKNAccount Assignment in Purchasing DocumentPurchase order items assigned to the orderReadECC + S/4
EKPOPurchasing Document ItemDelivery completed and deletion status of the purchase order itemReadECC + S/4
JESTIndividual Object StatusSystem status; TECO is set through the BAPIWriteECC + 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

ParameterDescriptionTypeReference fieldRequiredExample
S_IWERKMaintenance planning plantRange / multipleAFIH-IWERKYes1000
S_AUARTOrder typeRange / multipleAUFK-AUARTNoPM01
S_ERDATOrder creation dateRange / multipleAUFK-ERDATNo01.01.2025 – 31.10.2026
S_WARPLMaintenance planRange / multipleAFIH-WARPLNo120045
P_GRACEGrace period after last confirmation (days)Single value—Yes14
P_PCNFAlso accept partially confirmed ordersCheckbox—No—
P_TESTTest mode (candidate list only)Checkbox—NoX

Result list columns

#ColumnSource
1Maintenance orderAUFK-AUFNR
2Order typeAUFK-AUART
3Short textAUFK-KTEXT
4EquipmentAFIH-EQUNR
5Maintenance planAFIH-WARPL
6Open reservationsCalculated Number of RESB items with KZEAR and XLOEK blank and BDMNG − ENMNG > 0
7Open purchase itemsCalculated Number of linked items via EKKN with EKPO-ELIKZ and EKPO-LOEKZ blank
8ResultCalculated Technically completed, candidate (test) or skipped
9MessageCalculated Reason for skipping or BAPI return message

Sample result list

Maintenance orderOrder typeShort textEquipmentMaintenance planOpen reservationsOpen purchase itemsResultMessage
4000098PM01Panel maintenance line 21000463000Technically completedOrder technically completed
4000105PM02Monthly lubrication K-121000451212004500Technically completedCompleted with reference date 2026-10-29
4000123PM01Compressor K-12 overhaul1000451201Skipped4500013120/00010 delivery not completed
4000131PM01Overhead crane periodic check1000480120Skipped2 open reservations
A view built with fictional sample data; not real system data.

How does the program work?

  1. 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.
  2. Confirmation check: the order must have the confirmed (I0009) status active; by selection, partially confirmed (I0010) orders can also be accepted.
  3. 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.
  4. 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.
  5. When the grace period since the last confirmation or last movement has not passed, the order is left for the next run.
  6. 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

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: Mass Technical Completion (TECO) of Maintenance Orders Without Open Items Program