{"audience":"Maintenance planners, work preparation teams and maintenance supervisors who turn many small malfunction reports into work at the end of a shift.","authorization_objects":[{"note":"Change maintenance notifications by notification type","object":"I_QMEL"},{"note":"Create maintenance orders by order type","object":"I_AUART"},{"note":"Authorization by planning plant","object":"I_IWERK"}],"components":[],"countries":[],"effort_days_max":7,"effort_days_min":5,"effort_size":"M","faq":[{"a":"Yes. If a general or equipment task list is assigned, the operations can come from the task list instead of the notification text; adding this option increases the effort range by one day.","q":"Can a task list be added to the order automatically?"},{"a":"This is not recommended. Urgent breakdowns are usually handled immediately with a separate order, so priority 1 is excluded in the default selection; it can be added on the selection screen if needed.","q":"Are breakdown notifications (priority 1) grouped too?"},{"a":"Yes. BAPI_ALM_ORDER_MAINTAIN is supported on S/4HANA. For a clean core approach, the same logic can also be built on the released maintenance order APIs.","q":"Does the program work on S/4HANA?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":"Test mode shows the groups and orders that would be created without saving."},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"background","label":"Runs as a background job","note":""},{"code":"email","label":"Send the result by email","note":"The list of new orders can be emailed to the planner group."}],"functions":[{"name":"BAPI_ALM_ORDER_MAINTAIN","role":"Creates the maintenance order with header, operations and object list, and releases it when requested"},{"name":"BAPI_ALM_NOTIF_GET_DETAIL","role":"Reads the current status and order link of the notification before processing"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves successful groups permanently"},{"name":"BAPI_TRANSACTION_ROLLBACK","role":"Rolls back in test mode and for failed groups"}],"gap":"Through IW22 or IW28 a separate order is created for each notification; in IW31 several notifications can be added to the object list by hand, but there is no mass, rule-based way to do it. Five small notifications created during a day for the same machine turn into five separate orders; planning, cost tracking and technician dispatch get scattered. The custom program groups the notifications by rule and creates one order through a BAPI.","id":"pm-orders-from-open-notifications","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"1. Open, not completed notifications without an order (QMEL-AUFNR blank) of the selected notification type, planning plant, planner group, priority and notification date are read from QMEL and QMIH.\n2. The functional location of the notification is found through QMIH-ILOAN with ILOA-TPLNR; the grouping key is equipment (QMIH-EQUNR) or functional location, as selected, with planner group and main work center added to the key.\n3. For each group BAPI_ALM_ORDER_MAINTAIN is called: HEADER CREATE with order type, planning plant, the object of the first notification and the highest priority; OPERATION CREATE per notification with the notification short text and main work center; OBJECTLIST CREATE links the other notifications to the order.\n4. With 'release' selected, the RELEASE method is added in the same call; in test mode the call is rolled back with BAPI_TRANSACTION_ROLLBACK, in a real run each group is committed.\n5. Notifications that are locked or have meanwhile been linked to an order by another user are skipped with an error message; the other groups continue.\n6. The result list shows the group, its notifications, the new order number, number of operations and the BAPI message.","module":"PM","object_type":"batch_job","output_columns":[{"calculated":true,"formula":"Equipment or functional location + planner group","label":"Group","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Equipment","source_field":"EQUNR","source_table":"QMIH"},{"calculated":false,"formula":"","label":"Functional location","source_field":"TPLNR","source_table":"ILOA"},{"calculated":true,"formula":"Number of QMEL records in the group","label":"Notifications","source_field":null,"source_table":null},{"calculated":true,"formula":"QMEL-QMNUM values in the group","label":"Notification numbers","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Highest priority","source_field":"PRIOK","source_table":"QMEL"},{"calculated":false,"formula":"","label":"Order","source_field":"AUFNR","source_table":"AUFK"},{"calculated":true,"formula":"Number of AFVC lines created","label":"Operations","source_field":null,"source_table":null},{"calculated":true,"formula":"Created, released, test passed or error","label":"Status","source_field":null,"source_table":null},{"calculated":true,"formula":"BAPI return message","label":"Message","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Planning plant","name":"S_IWERK","ref_field":"QMIH-IWERK","required":true},{"example":"M1, M2","kind":"select_option","label":"Notification type","name":"S_QMART","ref_field":"QMEL-QMART","required":true},{"example":"M01","kind":"select_option","label":"Planner group","name":"S_INGRP","ref_field":"QMIH-INGRP","required":false},{"example":"2, 3, 4","kind":"select_option","label":"Priority","name":"S_PRIOK","ref_field":"QMEL-PRIOK","required":false},{"example":"10.11.2026 – 17.11.2026","kind":"select_option","label":"Notification date","name":"S_QMDAT","ref_field":"QMEL-QMDAT","required":false},{"example":"PM01","kind":"parameter","label":"Order type to create","name":"P_AUART","ref_field":"AUFK-AUART","required":true},{"example":"X","kind":"radio","label":"Group by equipment","name":"R_EQUI","ref_field":"","required":false},{"example":"","kind":"radio","label":"Group by functional location","name":"R_FLOC","ref_field":"","required":false},{"example":"","kind":"checkbox","label":"Release the orders","name":"P_REL","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Test mode (grouping preview only)","name":"P_TEST","ref_field":"","required":false}],"part_of":["pm-notification-to-confirmation-pack"],"performance":"Restrict the notification read by QMEL-QMART and QMDAT. BAPI_ALM_ORDER_MAINTAIN is called once per group; for hundreds of groups, run the program as a background job at the end of the shift.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=pm-orders-from-open-notifications","related":["pm-breakdown-notification-upload","pm-open-notifications-without-order"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Lists notifications and converts them to orders one by one; there is no rule-based grouping.","tcode":"IW28"},{"note":"Several notifications can be added to the object list by hand; there is no mass processing.","tcode":"IW31"}],"summary":"A custom program that groups open maintenance notifications without an order by equipment or functional location and creates one maintenance order per group, linking the first notification to the order header and the others to the object list. It creates one operation per notification, optionally releases the order and lists the result per group.","tables":[{"access":"read_write","join_on":"","role":"Notification header: type, short text, priority; the order link is written by the BAPI","table":"QMEL","variant":"both"},{"access":"read","join_on":"QMIH-QMNUM = QMEL-QMNUM","role":"Equipment, planning plant, planner group, location","table":"QMIH","variant":"both"},{"access":"read","join_on":"ILOA-ILOAN = QMIH-ILOAN","role":"Functional location of the notification (grouping key)","table":"ILOA","variant":"both"},{"access":"write","join_on":"AUFK-AUFNR = yeni sipariş","role":"New maintenance order header","table":"AUFK","variant":"both"},{"access":"write","join_on":"AFIH-AUFNR = AUFK-AUFNR","role":"Maintenance order data: equipment, planning plant, priority","table":"AFIH","variant":"both"},{"access":"write","join_on":"AFVC-AUFPL = AFKO-AUFPL","role":"Operations created per notification","table":"AFVC","variant":"both"}],"title":"Mass Maintenance Order Creation from Open Notifications Program","url":"https://nekuhub.com/en/programs/mass-maintenance-order-creation-from-notifications-program/","vendor_id":"nekudos"}