# Mass Production Order Release with Component Availability Check Program

> A custom background program that automatically releases production orders whose scheduled start is approaching, when the share of components covered by stock exceeds a plant-specific threshold. Orders below the threshold are not released and are reported to planning with the number of missing components.

- Type: Program, Custom development, Background program
- Module: PP
- Estimated effort: M (4–6 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-production-order-release-with-component-check/


## Why is the standard not enough?

COHV releases the selected orders in mass and can run an availability check depending on the order type settings, but the check follows a general rule such as 'do not release if missing' or 'release anyway'. A plant-specific threshold (for example, release when 90 percent of the components are covered) or a critical component exception cannot be defined. Planners filter the list by hand every morning; as a result either orders with shortages reach the shop floor or ready orders stay on hold.

### Closest standard alternatives

- COHV: Releases orders in mass; there is no plant-specific coverage threshold or critical component exception.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| AUFK | Order type, plant and object number | Read | - | ECC + S/4 |
| AFKO | Scheduled start and MRP controller | Read | AFKO-AUFNR = AUFK-AUFNR | ECC + S/4 |
| RESB | Component requirements of the order | Read | RESB-AUFNR = AFKO-AUFNR | ECC + S/4 |
| MARD | Unrestricted-use stock of the components | Read | MARD-MATNR = RESB-MATNR AND MARD-WERKS = RESB-WERKS | ECC + S/4 |
| JEST | System status; release (I0002) is set through the BAPI | Write | JEST-OBJNR = AUFK-OBJNR | ECC + S/4 |

## BAPIs and functions used

- BAPI_PRODORD_RELEASE: Releases the orders that pass the threshold
- BAPI_TRANSACTION_COMMIT: Saves the status change permanently

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_WERKS | Plant | Range / multiple | AUFK-WERKS | Yes |
| S_AUART | Order type | Range / multiple | AUFK-AUART | No |
| S_DISPO | MRP controller | Range / multiple | AFKO-DISPO | No |
| P_HORIZ | Release horizon (days) | Single value | - | Yes |
| P_THRESH | Component coverage threshold (%) | Single value | - | Yes |
| S_CRIT | Critical components (never release when short) | Range / multiple | RESB-MATNR | No |
| P_TEST | Test mode (candidate list only) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Production order | AFKO-AUFNR |
| Material | AFKO-PLNBEZ |
| Scheduled start | AFKO-GSTRP |
| MRP controller | AFKO-DISPO |
| Components | Calculated: Number of evaluated RESB items |
| Short components | Calculated: Number of items not covered by the allocated stock |
| Coverage % | Calculated: (Components − short components) ÷ components × 100 |
| Result | Calculated: Released, candidate (test), below threshold or critical component short |
| Message | Calculated: BAPI return message or reason for skipping |

## How does the program work?

1. Orders whose scheduled start (GSTRP) falls within the release horizon from today are read from AUFK and AFKO for the plant, order type and MRP controller on the selection screen; only orders with just the created status (I0001) active in JEST and no deletion flag (I0076) become candidates.
2. The component requirements of the candidates are read from RESB; bulk (SCHGT) and phantom (DUMPS) items are left out.
3. Unrestricted stock is read from MARD-LABST and requirements are sorted by start date and allocated in turn, so the order that starts earlier gets the stock first.
4. Coverage = components covered by stock ÷ all components × 100. When coverage is below the threshold, or a component from the critical component list is missing, the order is skipped and the allocated stock is left for the next order.
5. Orders above the threshold are released in packages with BAPI_PRODORD_RELEASE and BAPI_TRANSACTION_COMMIT is called; return messages are logged per order.
6. In test mode no order is released; only the candidate list and the decisions are shown. Optionally the result list is emailed to the MRP controllers.

## Authorization objects

- C_AFKO_AWK: Authorization to release orders by plant and order type
- C_AFKO_DIS: Production order authorization by MRP controller

## Frequently asked questions

### Does it replace the standard availability check?

No. The program applies its own threshold before release; the standard availability check defined for the order type still runs during the BAPI call. The two checks complement each other.

### Can the threshold differ by plant?

Yes. The threshold can be read from the selection screen or from a small settings table by plant / order type. A separate background variant can also be defined for each plant.

### Are open purchase orders taken into account?

The base version only counts unrestricted stock on hand. If required, open purchase order schedule lines (EKET) due before the start date can be added as a coverage source.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=pp-mass-release-with-component-check
