{"audience":"Maintenance planners, maintenance controllers and cost accounting teams that manage month-end closing.","authorization_objects":[{"note":"Change orders (TECO) by maintenance planning plant","object":"I_IWERK"},{"note":"Maintenance order authorization by order type","object":"I_AUART"}],"components":[],"countries":[],"effort_days_max":6,"effort_days_min":4,"effort_size":"M","faq":[{"a":"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.","q":"Why does the completion date matter for orders from maintenance plans?"},{"a":"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.","q":"Are the linked notifications completed too?"},{"a":"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.","q":"Is cost settlement done as well?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"background","label":"Runs as a background job","note":"Scheduled weekly or as a nightly job before month end."},{"code":"email","label":"Send the result by email","note":"A summary of completed and skipped orders is sent to maintenance planning."}],"functions":[{"name":"BAPI_ALM_ORDER_MAINTAIN","role":"Technically completes the maintenance orders that pass the checks"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves the status change permanently"}],"gap":"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.","id":"pm-mass-teco-maintenance-orders","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"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.\n2. Confirmation check: the order must have the confirmed (I0009) status active; by selection, partially confirmed (I0010) orders can also be accepted.\n3. 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.\n4. 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.\n5. When the grace period since the last confirmation or last movement has not passed, the order is left for the next run.\n6. 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.","module":"PM","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Maintenance order","source_field":"AUFNR","source_table":"AUFK"},{"calculated":false,"formula":"","label":"Order type","source_field":"AUART","source_table":"AUFK"},{"calculated":false,"formula":"","label":"Short text","source_field":"KTEXT","source_table":"AUFK"},{"calculated":false,"formula":"","label":"Equipment","source_field":"EQUNR","source_table":"AFIH"},{"calculated":false,"formula":"","label":"Maintenance plan","source_field":"WARPL","source_table":"AFIH"},{"calculated":true,"formula":"Number of RESB items with KZEAR and XLOEK blank and BDMNG − ENMNG \u003e 0","label":"Open reservations","source_field":null,"source_table":null},{"calculated":true,"formula":"Number of linked items via EKKN with EKPO-ELIKZ and EKPO-LOEKZ blank","label":"Open purchase items","source_field":null,"source_table":null},{"calculated":true,"formula":"Technically completed, candidate (test) or skipped","label":"Result","source_field":null,"source_table":null},{"calculated":true,"formula":"Reason for skipping or BAPI return message","label":"Message","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Maintenance planning plant","name":"S_IWERK","ref_field":"AFIH-IWERK","required":true},{"example":"PM01","kind":"select_option","label":"Order type","name":"S_AUART","ref_field":"AUFK-AUART","required":false},{"example":"01.01.2025 – 31.10.2026","kind":"select_option","label":"Order creation date","name":"S_ERDAT","ref_field":"AUFK-ERDAT","required":false},{"example":"120045","kind":"select_option","label":"Maintenance plan","name":"S_WARPL","ref_field":"AFIH-WARPL","required":false},{"example":"14","kind":"parameter","label":"Grace period after last confirmation (days)","name":"P_GRACE","ref_field":"","required":true},{"example":"","kind":"checkbox","label":"Also accept partially confirmed orders","name":"P_PCNF","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test mode (candidate list only)","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"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.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=pm-mass-teco-maintenance-orders","related":["co-orders-settlement-check","pm-overdue-maintenance-orders-backlog"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Can select orders in mass and set TECO; the open reservation and purchase check is left to the user.","tcode":"IW38"},{"note":"Changes and completes a single maintenance order.","tcode":"IW32"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"Order type, creation date and object number","table":"AUFK","variant":"both"},{"access":"read","join_on":"AFIH-AUFNR = AUFK-AUFNR","role":"Maintenance planning plant, equipment and maintenance plan","table":"AFIH","variant":"both"},{"access":"read","join_on":"RESB-AUFNR = AUFK-AUFNR","role":"Open material reservation check","table":"RESB","variant":"both"},{"access":"read","join_on":"EKKN-AUFNR = AUFK-AUFNR","role":"Purchase order items assigned to the order","table":"EKKN","variant":"both"},{"access":"read","join_on":"EKPO-EBELN = EKKN-EBELN AND EKPO-EBELP = EKKN-EBELP","role":"Delivery completed and deletion status of the purchase order item","table":"EKPO","variant":"both"},{"access":"write","join_on":"JEST-OBJNR = AUFK-OBJNR","role":"System status; TECO is set through the BAPI","table":"JEST","variant":"both"}],"title":"Mass Technical Completion (TECO) of Maintenance Orders Without Open Items Program","url":"https://nekuhub.com/en/programs/mass-technical-completion-of-maintenance-orders-program/","vendor_id":"nekudos"}