{"audience":"Production planners, cost accountants and the PP/CO teams that run month-end closing.","authorization_objects":[{"note":"Authorization to change orders (TECO) by plant and order type","object":"C_AFKO_AWK"},{"note":"Production order authorization by order type","object":"C_AFKO_AWA"}],"components":[],"countries":[],"effort_days_max":5,"effort_days_min":3,"effort_size":"M","faq":[{"a":"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.","q":"Can TECO be reversed?"},{"a":"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.","q":"Does the program close (CLSD) the orders?"},{"a":"Yes. BAPI_PRODORD_COMPLETE_TECH and the tables it reads work the same way on S/4HANA.","q":"Can it be used on S/4HANA?"}],"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 planning."}],"functions":[{"name":"BAPI_PRODORD_COMPLETE_TECH","role":"Technically completes the orders that pass the checks"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves the status change permanently"}],"gap":"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.","id":"pp-auto-teco-production-orders","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"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.\n2. 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.\n3. 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 \u003e 0, the order is skipped.\n4. COGI check: if AFFW has records for the order, it is skipped; otherwise the failed movement becomes hard to follow after TECO.\n5. 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.\n6. The result is written to the application log and a summary is emailed to planning.","module":"PP","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Production order","source_field":"AUFNR","source_table":"AFKO"},{"calculated":false,"formula":"","label":"Material","source_field":"MATNR","source_table":"AFPO"},{"calculated":false,"formula":"","label":"Order qty","source_field":"PSMNG","source_table":"AFPO"},{"calculated":false,"formula":"","label":"Received qty","source_field":"WEMNG","source_table":"AFPO"},{"calculated":true,"formula":"AFPO-WEMNG ÷ AFPO-PSMNG × 100","label":"Delivered %","source_field":null,"source_table":null},{"calculated":true,"formula":"Number of RESB items with BDMNG − ENMNG \u003e 0 and KZEAR blank","label":"Open reservations","source_field":null,"source_table":null},{"calculated":true,"formula":"Number of AFFW rows of the order","label":"COGI records","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Last goods receipt","source_field":"LTRMI","source_table":"AFPO"},{"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":"Plant","name":"S_WERKS","ref_field":"AUFK-WERKS","required":true},{"example":"PP01","kind":"select_option","label":"Order type","name":"S_AUART","ref_field":"AUFK-AUART","required":false},{"example":"001","kind":"select_option","label":"MRP controller","name":"S_DISPO","ref_field":"AFKO-DISPO","required":false},{"example":"01.01.2026 – 31.10.2026","kind":"select_option","label":"Basic finish date","name":"S_GLTRP","ref_field":"AFKO-GLTRP","required":false},{"example":"14","kind":"parameter","label":"Grace period after last goods receipt (days)","name":"P_GRACE","ref_field":"","required":true},{"example":"2","kind":"parameter","label":"Under-delivery tolerance (%)","name":"P_TOLPCT","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test mode (candidate list only)","name":"P_TEST","ref_field":"","required":false}],"part_of":["pp-production-control-pack"],"performance":"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.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=pp-auto-teco-production-orders","related":["pp-consumption-without-goods-receipt","pp-overdue-production-orders"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Sets TECO in bulk; no delivery tolerance, open reservation or COGI check.","tcode":"COHV"},{"note":"Sets TECO on one order; not practical for hundreds of old orders.","tcode":"CO02"}],"summary":"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.","tables":[{"access":"read","join_on":"","role":"Order type, plant and object number","table":"AUFK","variant":"both"},{"access":"read","join_on":"","role":"MRP controller and basic finish date","table":"AFKO","variant":"both"},{"access":"read","join_on":"","role":"Order quantity, quantity received and last goods receipt date","table":"AFPO","variant":"both"},{"access":"read","join_on":"","role":"Open component reservation check","table":"RESB","variant":"both"},{"access":"read","join_on":"","role":"Check for failed movements pending in COGI","table":"AFFW","variant":"both"},{"access":"write","join_on":"","role":"System status; TECO is set through the BAPI","table":"JEST","variant":"both"}],"title":"Automatic Technical Completion (TECO) of Production Orders Program","url":"https://nekuhub.com/en/programs/automatic-production-order-technical-completion-program/","vendor_id":"nekudos"}