{"audience":"Buyers, production planning, quality control and warehouse teams.","authorization_objects":[{"note":"Inspection lot display authorization by inspection type","object":"Q_INSPTYPE"},{"note":"Authorization to schedule the background job","object":"S_BTCH_JOB"},{"note":"Authorization to send email","object":"S_OC_SEND"}],"components":[],"countries":[],"effort_days_max":6,"effort_days_min":4,"effort_size":"M","faq":[{"a":"Yes: a function with the same logic can be attached to the usage decision follow-up action. The background job approach does not slow down the decision screen, an email problem does not block saving the decision and the resend check lives in one place. Either option is chosen as needed.","q":"Can the email be sent at the moment of the decision?"},{"a":"Yes. Characteristic results (QAMR) can be added to the email as a table or as a PDF attachment, and a rejection report to share with the vendor can be produced as well. This adds 1–2 days to the estimate.","q":"Can inspection results be attached to the email?"},{"a":"Yes. QALS, QAVE and T024 are the same in S/4HANA. If clean core is preferred, inspection lot data is read from I_InspectionLot; the BCS classes can be used for sending email.","q":"Does it work on S/4HANA?"}],"features":[{"code":"background","label":"Runs as a background job","note":"The job is scheduled to run every 15 minutes."},{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"email","label":"Send the result by email","note":""}],"functions":[{"name":"SO_DOCUMENT_SEND_API1","role":"Sends the alert email"}],"gap":"When a usage decision is made in QA11 or QA32, the standard system informs nobody automatically; follow-up actions of the usage decision do not send email without a custom function and do not determine the recipient by purchasing group. QA33 lists decisions afterwards but needs someone to look. The custom job determines the recipient by origin, prevents a second email for the same lot and logs the result.","id":"qm-usage-decision-alerts","industries":[],"input_columns":[],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"1. The job runs every 15 minutes; the date and time of the last successful run are stored in TVARVC and updated at the end of the job.\n2. Usage decisions made after this time are read from QAVE; the decision code and valuation (VBEWERTUNG: A accept, R reject) are taken and the code text comes from QPCT.\n3. The inspection lot is read from QALS: origin (01 goods receipt, 04 production, 08 stock transfer etc.), material, batch, vendor, order and lot quantity. The quantity moved to blocked stock or returned is calculated from the usage decision stock postings (QAMB and the linked material document items).\n4. Recipient: for goods receipt lots the email address of the order's purchasing group (T024-SMTP_ADDR), for production lots the production supervisor, for other origins the distribution list from the parameter.\n5. The email with lot and decision data is sent with SO_DOCUMENT_SEND_API1; a second email for the same inspection lot is not sent. Acceptances can be sent once a day as a summary table.\n6. At the end of the run, sent, recipient-not-found and failed records are listed in the log.","module":"QM","object_type":"batch_job","output_columns":[{"calculated":false,"formula":"","label":"Inspection lot","source_field":"PRUEFLOS","source_table":"QALS"},{"calculated":false,"formula":"","label":"Origin","source_field":"HERKUNFT","source_table":"QALS"},{"calculated":false,"formula":"","label":"Material","source_field":"MATNR","source_table":"QALS"},{"calculated":false,"formula":"","label":"Batch","source_field":"CHARG","source_table":"QALS"},{"calculated":false,"formula":"","label":"Vendor","source_field":"LIFNR","source_table":"QALS"},{"calculated":false,"formula":"","label":"Purchase order","source_field":"EBELN","source_table":"QALS"},{"calculated":false,"formula":"","label":"Decision code","source_field":"VCODE","source_table":"QAVE"},{"calculated":false,"formula":"","label":"Valuation","source_field":"VBEWERTUNG","source_table":"QAVE"},{"calculated":true,"formula":"Quantity moved to blocked stock or returned (QAMB → MSEG)","label":"Rejected quantity","source_field":null,"source_table":null},{"calculated":true,"formula":"Purchasing group, production supervisor or distribution list","label":"Recipient","source_field":null,"source_table":null},{"calculated":true,"formula":"Sent, added to summary, no recipient or error","label":"Status","source_field":null,"source_table":null}],"parameters":[{"example":"1000","kind":"select_option","label":"Plant","name":"S_WERK","ref_field":"QALS-WERK","required":true},{"example":"01, 04","kind":"select_option","label":"Inspection type","name":"S_ART","ref_field":"QALS-ART","required":false},{"example":"01, 04, 08","kind":"select_option","label":"Lot origin","name":"S_HERK","ref_field":"QALS-HERKUNFT","required":false},{"example":"X","kind":"checkbox","label":"Send only rejections immediately","name":"P_REJ","ref_field":"","required":false},{"example":"X","kind":"checkbox","label":"Send acceptances as a daily summary","name":"P_SUMM","ref_field":"","required":false},{"example":"KALITE_BILDIRIM","kind":"parameter","label":"Default distribution list","name":"P_DLIST","ref_field":"","required":false},{"example":"","kind":"checkbox","label":"Test mode (list without sending)","name":"P_TEST","ref_field":"","required":false}],"part_of":[],"performance":"Restrict QAVE by decision date and time; since each run only reads the decisions of the last 15 minutes, the job finishes in a few seconds. Read QALS, EKKO and T024 in bulk with the keys from the decision list.","process":"P2P","quote_url":"https://nekuhub.com/en/request-a-quote/?report=qm-usage-decision-alerts","related":["qm-auto-notification-rejected-characteristics","qm-inspection-lots-pending-ud-aging","qm-rejected-ud-blocked-stock"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Lists usage decisions and inspection lots; sends no notification to anyone.","tcode":"QA33"},{"note":"The usage decision is made here; email requires a custom function in the follow-up action.","tcode":"QA11"}],"summary":"A custom program run by a background job at short intervals that reads the usage decisions made since the last run and, for rejections, sends an email with material, batch, vendor, purchase order, rejected quantity and decision code to the purchasing group, the production supervisor or a quality distribution list depending on the origin of the inspection lot. Acceptances can be sent as a daily summary.","tables":[{"access":"read","join_on":"","role":"Usage decisions: code, valuation, date and time (driving table)","table":"QAVE","variant":"both"},{"access":"read","join_on":"QALS-PRUEFLOS = QAVE-PRUEFLOS","role":"Inspection lot: origin, material, batch, vendor, order","table":"QALS","variant":"both"},{"access":"read","join_on":"QPCT-CODEGRUPPE = QAVE-VCODEGRP AND QPCT-CODE = QAVE-VCODE","role":"Text of the usage decision code","table":"QPCT","variant":"both"},{"access":"read","join_on":"QAMB-PRUEFLOS = QALS-PRUEFLOS","role":"Link from usage decision stock postings to material documents","table":"QAMB","variant":"both"},{"access":"read","join_on":"MSEG-MBLNR = QAMB-MBLNR AND MSEG-MJAHR = QAMB-MJAHR AND MSEG-ZEILE = QAMB-ZEILE","role":"Quantity moved to blocked stock or returned","table":"MSEG","variant":"both"},{"access":"read","join_on":"EKKO-EBELN = QALS-EBELN","role":"Purchasing group of the order","table":"EKKO","variant":"both"},{"access":"read","join_on":"T024-EKGRP = EKKO-EKGRP","role":"Email address of the purchasing group","table":"T024","variant":"both"},{"access":"read_write","join_on":"TVARVC-NAME = P_VARNM","role":"Timestamp of the last successful run","table":"TVARVC","variant":"both"}],"title":"Automatic Email Alerts to Purchasing and Production for Usage Decisions and Quality Rejections","url":"https://nekuhub.com/en/programs/usage-decision-and-quality-rejection-email-alerts/","vendor_id":"nekudos"}