> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/manufacturing-and-supply-chain-planning/explain-part-shortage-date.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Explain Part Shortage Date

For one MRP-planned part and one date, explains why projected on hand goes short by reading the MRP header, receipt/delivery timeline, open supply and demand lines in a window, and MRP action messages.

| Business area                           | Action type |
| --------------------------------------- | ----------- |
| Manufacturing and Supply Chain Planning | Read-only   |

## Overview

MRP flags a part as short when the MRP projected on hand falls below zero (or below safety stock) on a date. Planners then have to open MRP Part Information and MRP Open Supply and Demand Orders, scroll through events and lines, and work out which demand drove the drop and which supply came too late or too small.

The IFS Cloud integration reads MRP part information and open supply/demand orders to explain a part shortage on a given date.

## How it works

{% stepper %}
{% step %}
Call Get Mrp Part Plan Header. If not found, report "part not planned by MRP in this scenario" and stop. If stalePlan = true (MrpRunDate older than 7 days), warn that the plan is stale.
{% endstep %}

{% step %}
Call Get Projected Onhand Timeline from MrpRunDate to shortage date + 7 days. Find the first EventDate where MrpProjectedOnhand < 0 (shortage) or < SafetyStock from the header (safety breach). If none on or before the requested date, answer "No MRP shortage on \[date]" and show the lowest projected on hand.
{% endstep %}

{% step %}
Call List Supply Demand Lines In Window for \[first shortage date - 14 days, requested date + 7 days]. Demand lines: DemandQty > 0. Supply lines: SupplyQty > 0.
{% endstep %}

{% step %}
Call Get Part Action Messages and match messages to lines by OrderNo/LineNo/ReleaseNo.
{% endstep %}

{% step %}
Root-cause rules (apply in order, report all that apply): LATE\_SUPPLY: supply line with LateOrder or RequiredDate > MrpAppliedDate whose quantity would cover the gap if on time. DEMAND\_SPIKE: demand line with DemandQty >= 50% of the gap or OrderSpike = TRUE. NO\_SUPPLY: no supply line arrives before the next positive projected on hand. SAFETY\_ONLY: projected on hand >= 0 but < SafetyStock.
{% endstep %}

{% step %}
Rank demand drivers by DemandQty descending and supply blockers by days late descending.
{% endstep %}
{% endstepper %}

## Key capabilities

* Resolves the exact MRP part context (Contract, PartNo, ActivitySeq, MrpPlanningScenario) and refuses guessed keys.
* Finds the first date the MRP projected on hand goes negative or below safety stock, on or before the requested date.
* Quantifies the shortage gap against zero and against SafetyStock.
* Lists the demand lines (DemandQty > 0) that consume stock in the shortage window, with source (MrpSource) and parent part.
* Identifies late, early or removable supply (LateOrder, EarlyOrder, RemoveOrder, MrpAppliedDate vs RequiredDate).
* Correlates MRP action messages (MrpMessageCondition) with lines.
* Detects stale plans (old MrpRunDate) and warns that MRP must be rerun before trusting the explanation.
* Returns a ranked root-cause verdict and the next permissible planner action.

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection                           |
| --------- | ------------------------------------ |
| MRP       | MrpPartInformationHandling           |
| MRP       | MrpOpenSupplyAndDemandOrdersHandling |

## Version compatibility

| Projection                           | Supported IFS Cloud releases |
| ------------------------------------ | ---------------------------- |
| MrpPartInformationHandling           | 24R2, 25R1, 25R2, 26R1, 26R2 |
| MrpOpenSupplyAndDemandOrdersHandling | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Read-only: does not create, update, or delete IFS Cloud data.
* Requires projection-level security. Permission errors halt the run.
