# Automatic Vendor Quality Notification Creation for Rejected Characteristics

> A custom background job that automatically opens a quality notification against the vendor for goods receipt lots with a rejected characteristic. The notification is created with the material, batch, purchase order and measured values; every rejected characteristic becomes a separate defect item.

- Type: Program, Custom development, Background program
- Module: QM
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/automatic-vendor-quality-notification-for-rejected-characteristics/


## Why is the standard not enough?

QM01 opens a notification manually. If defects are recorded during results recording, a notification can be created through the inspection type setting, but that expects the user to enter the defect separately; when results come from a laboratory interface or a mass upload, no notification is opened at all. An automatic job is needed so that every rejected result turns into a notification against the vendor and shows up on the vendor scorecard.

### Closest standard alternatives

- QM01: Opens a quality notification manually.
- QE51N: A notification can be created when defects are entered during results recording; no notification for results that come from an interface.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| QALS | Goods receipt inspection lot, vendor, batch and purchase order | Read | - | ECC + S/4 |
| QAMR | Rejected characteristic results | Read | QAMR-PRUEFLOS = QALS-PRUEFLOS | ECC + S/4 |
| QAMV | Characteristic description, target and limits | Read | QAMV-PRUEFLOS = QAMR-PRUEFLOS AND QAMV-VORGLFNR = QAMR-VORGLFNR AND QAMV-MERKNR = QAMR-MERKNR | ECC + S/4 |
| LFA1 | Vendor name | Read | LFA1-LIFNR = QALS-LIFNR | ECC + S/4 |
| QMEL | Existing notification check and the quality notification created | Read / write | QMEL-PRUEFLOS = QALS-PRUEFLOS | ECC + S/4 |
| QMFE | Defect item for every rejected characteristic | Write | - | ECC + S/4 |

## BAPIs and functions used

- BAPI_QUALNOT_CREATE: Creates the quality notification with header and defect items
- BAPI_QUALNOT_SAVE: Saves the notification created
- BAPI_TRANSACTION_COMMIT: Makes the save permanent

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_WERK | Plant | Range / multiple | QALS-WERK | Yes |
| S_ART | Inspection type | Range / multiple | QALS-ART | No |
| S_DATE | Result date range | Range / multiple | QAMR-PRUEFDATUV | Yes |
| S_LIFNR | Vendor | Range / multiple | QALS-LIFNR | No |
| P_QMART | Notification type | Single value | QMEL-QMART | Yes |
| P_FEGRP | Default defect code group | Single value | QMFE-FEGRP | No |
| P_FECOD | Default defect code | Single value | QMFE-FECOD | No |
| P_TEST | Test mode (list without creating notifications) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Inspection lot | QALS-PRUEFLOS |
| Vendor | QALS-LIFNR |
| Vendor name | LFA1-NAME1 |
| Material | QALS-MATNR |
| Rejected characteristic | QAMV-VERWMERKM |
| Measured mean | QAMR-MITTELWERT |
| Notification | QMEL-QMNUM |
| Status | Calculated: Created, test, skipped (notification exists) or error |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. Goods receipt lots (QALS) in the selected plant and inspection types whose result date is in the parameter range and that have at least one rejected characteristic (QAMR-MBEWERTG = R) are read.
2. Lots that already have a notification (QMEL-PRUEFLOS) are skipped, so a second notification is never opened for the same lot when the job runs again.
3. The notification header is prepared: notification type (parameter, e.g. Q2), material, vendor, plant, batch, inspection lot, purchase order and item; the short text is built from the description of the first rejected characteristic.
4. A defect item is added for every rejected characteristic: the defect code group and code come from the parameter or from a characteristic-to-code mapping table; target, limits and measured mean are written to the long text.
5. The notification is created with BAPI_QUALNOT_CREATE and saved with BAPI_QUALNOT_SAVE and BAPI_TRANSACTION_COMMIT. In test mode only the notifications to be opened are listed. Results and messages are written to the job log.

## Authorization objects

- Q_QMEL: Quality notification creation authorization by notification type
- Q_INSPTYPE: Inspection lot authorization by inspection type

## Frequently asked questions

### How many notifications are opened when several characteristics of a lot are rejected?

One notification is opened per lot and every rejected characteristic becomes a separate defect item on it. Separate notifications per characteristic are also possible if preferred.

### Is the notification sent to the vendor automatically?

The program opens the notification; sending it to the vendor is done with the standard notification output or email setup. A step that emails a summary to the vendor when the notification is saved can be added if needed.

### Can it be used on S/4HANA?

Yes. BAPI_QUALNOT_CREATE and BAPI_QUALNOT_SAVE are supported on S/4HANA as well; the QM tables read are the same.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=qm-auto-notification-rejected-characteristics
