Overview
The Calculate Supply Plan process analyzes demand, explodes Bills of Materials (BOMs), and generates the Work Orders, Purchase Orders, and Transfer Orders required to satisfy demand.
The process is executed by the CalculateSupplyPlan2 routine in the Supply Planning module and consists of several processing stages.
Prerequisites
Before running Supply Planning, verify the following for all items:
- Every item has an SKU.
- Every item has a specified Purchase Unit of Measure.
- Every item has a valid Base UOM Record Id.
If any of these requirements are missing, the Supply Plan calculation may fail or produce incomplete results.
Supply Plan Step-by-Step Process
Step 1 – Delete Previous Calculation Data
Routine: SupplyPlanBatchDelete
The system removes existing Supply Plan calculation records from previous runs to ensure the new calculation starts with a clean dataset.
Step 2 – Retrieve Demand and Supply
Routine: SupplyPlanRetrieveDemand
The system gathers all demand and supply sources used during planning, including:
- On-hand inventory
- Sales Orders
- Forecasts
- Projects
- Existing supply orders
- Other configured planning sources
The result of this step is a collection of planning records that will drive the remainder of the Supply Plan calculation.
Important: Items with a blank Replenishment System are skipped during this step. No planning records are created for these items, so they will not participate in Supply Planning or generate replenishment recommendations. Ensure that every SKU that you want to run Supply Planning has a valid Replenishment System configured before running the Supply Plan calculation.
Step 3 – Summarize Calculation Lines
Routine: SupplyPlanSummarizeCalLines
Planning records are summarized where possible to reduce the total number of calculation lines.
This improves processing performance while preserving the required planning quantities.
Step 4 – Create Initial Supply Orders
Routine: SupplyPlanCalcQueueable
The system determines how each demand should be replenished based on the item's Replenishment System.
Depending on the item's setup, it creates preliminary:
- Work Orders
- Purchase Orders
- Transfer Orders
The number of records processed in each batch is controlled by the SupplyPlanExplodeSize custom setting.
If you encounter Salesforce governor limit errors during the calculation, reduce the SupplyPlanExplodeSize value to process fewer records per batch.
For items replenished by Work Order, the system marks the calculation line as Pending Explosion, indicating that the item's Bill of Materials must still be exploded.
Step 5 – Explode Bills of Material
Routine: SupplyPlanCalExplode
The system processes every calculation line marked as Pending Explosion.
For each parent item, the Bill of Materials is exploded to generate demand for its components.
If a component is also replenished using a Work Order, that component is recursively exploded into its own components.
This process continues through every level of the Bill of Materials until there are no remaining manufactured components that require explosion.
The result is complete component demand for every purchased, transferred, and manufactured item required to satisfy the original demand.
Step 6 – Finalize Supply Orders
Routine: SupplyPlanCalFinal
After all component demand has been calculated, the system finalizes the Supply Plan by creating the required:
- Work Orders
- Purchase Orders
- Transfer Orders
These supply documents represent the complete manufacturing, purchasing, and inventory transfer requirements needed to satisfy the calculated demand.
Overall Process Flow
Calculate Supply Plan
│
▼
Delete Previous Calculation Data
│
▼
Retrieve Demand and Supply
│
▼
Summarize Calculation Lines
│
▼
Create Initial Supply Orders
│
▼
Mark Work Orders as Pending Explosion
│
▼
Explode Bills of Material
│
▼
Generate Component Demand
│
▼
Repeat Until No More Manufactured Components Require Explosion
│
▼
Create Final Work Orders, Purchase Orders, and Transfer Orders
Notes
- Bills of Material can be exploded through an unlimited number of levels.
- Only items configured with Work Order replenishment are exploded into components.
- Components replenished by Purchase Order or Transfer Order are not exploded further. Instead, the system creates the appropriate supply document.
- The SupplyPlanExplodeSize custom setting controls the number of records processed during the initial supply order creation stage. Reducing this value may help avoid Salesforce governor limit errors when processing large Supply Plans.
Comments
0 comments
Please sign in to leave a comment.