Process Mining for Supply Chains
Lesson opener
In one line: Process mining turns ERP event logs into visible process flows that expose where supply chain time actually goes.
Why it matters: A weekly review meeting shows an average order-to-ship time. An event log shows that 22% of purchase orders touch a manual price-tolerance override, and those orders take three times as long as the happy path. Averages hide the variants that drive performance.
Before this lesson: Supply chain performance and KPIs, ERP for supply chains
What you will be able to do
- Define a mineable case for each of the three core supply chain processes.
- Extract an event log from an ERP system by naming the table, the case identifier, the activity, and the timestamp.
- Read a variant list and distinguish frequency-dominant variants from duration-dominant variants.
- Decompose cycle time into queue time, service time, and transport time for a P2P or O2C process.
- Identify the bottleneck stage and state what makes it different from a merely slow activity.
- Design a conformance check against a SCOR reference path and name at least four meaningful supply chain deviations.
Prerequisites
Process mapping through Continuous improvement projects provide the foundation. Process mining fundamentals introduces the event log structure, discovery mode, and conformance mode that this lesson applies to supply chain data — refer back to it whenever you need to review the three mandatory fields or the difference between discovery and conformance. ERP for supply chains provides context for the SAP and Oracle table names used here. This lesson does not require a licensed mining tool; the focus is on log design and question framing.
Why dashboards are not enough
A supply chain dashboard reports:
- Average purchase-order lead time: 8.3 days
- Average order-to-ship cycle: 4.1 days
- On-time-in-full rate: 83%
None of those numbers reveals which step failed, which vendor's orders loop through a manual approval, or whether the 8.3-day average is pulled up by a handful of orders stuck for six weeks. A dashboard aggregates. A process map rebuilt from the event log shows individual paths.
Supply chain work has three process boundaries that lend themselves to mining:
| Process | Start event | End event | Business question answered |
|---|---|---|---|
| Procure-to-Pay (P2P) | Purchase requisition created | Invoice cleared / payment posted | Why do some orders take 30 days when the SLA is 10? |
| Order-to-Cash (O2C) | Sales order created | Payment received | Which order type has the most credit blocks? |
| Plan-to-Produce (P2P-mfg) | Planned order created | Goods issue to finished goods | Where in production does WIP wait longest? |
Each is a separate mining project with a different case identifier, different activities, and a different business owner.
Defining the case: the supply chain decision
Process mining fundamentals requires one sentence that defines a case. In supply chain work, that sentence is easy to get wrong.
P2P case options
| Option | Case sentence | When to choose |
|---|---|---|
| Purchase order header | One purchase order from creation to last invoice clearance | Cross-vendor comparison on total order lead time |
| Purchase order line | One material-vendor-quantity combination | Item-level cycle time; mix of fast and slow lines on one order |
| Purchase requisition | One internal request from creation to PO creation | Internal approval speed; no vendor data needed |
Recommendation: Start with the purchase order line when comparing vendors or materials. The header conflates a fast consumable cleared yesterday with a raw-material line still open, and the fast lines dominate the average.
O2C case options
| Option | Case sentence | When to choose |
|---|---|---|
| Sales order header | One customer order from entry to final payment | Overall customer experience |
| Delivery | One shipment of one or more order lines | Warehouse and logistics performance |
| Invoice | One billing document from creation to payment | Finance and credit performance |
A delivery as the case answers different questions than a sales order as the case. Mixing case types in one event log produces a picture that cannot be interpreted.
Extracting the log from ERP
ERP for supply chains described the SAP module structure. The tables below contain the status and posting history that becomes the event log. Confirm table access with the basis team before starting any extract; row-level security, data retention policy, and archive status vary by system and client.
SAP S/4HANA — P2P event sources
| Table | Description | Key fields |
|---|---|---|
| EKKO / EKPO | PO header and line master data | EBELN (PO number), EBELP (line item), LIFNR (vendor), MATNR (material) |
| EKBE | PO history — goods receipts, invoice receipts, reversals | EBELN, EBELP, VGABE (transaction type), BUDAT (posting date) |
| RBKP / RSEG | Invoice header and line data | BELNR (invoice document), BLDAT (invoice date), BUKRS (company code) |
Constructing the P2P log:
-- Illustrative only; column names and schema depend on the SAP release and client configuration
SELECT
EKKO.EBELN || '-' || EKPO.EBELP AS case_id,
CASE EKBE.VGABE
WHEN '1' THEN 'Goods receipt'
WHEN '2' THEN 'Invoice receipt'
WHEN '3' THEN 'Credit memo'
WHEN '6' THEN 'Delivery cost invoice'
WHEN '9' THEN 'Goods receipt reversal'
ELSE 'Other: ' || EKBE.VGABE
END AS activity,
EKBE.BUDAT AS event_date,
EKKO.LIFNR AS vendor,
EKPO.MATNR AS material,
EKPO.WERKS AS plant
FROM EKBE
JOIN EKKO ON EKBE.EBELN = EKKO.EBELN
JOIN EKPO ON EKBE.EBELN = EKPO.EBELN AND EKBE.EBELP = EKPO.EBELP
WHERE EKKO.BSTYP = 'F'
AND EKBE.BUDAT BETWEEN :start_date AND :end_date
ORDER BY case_id, event_dateAdd the PO creation date from EKKO.AEDAT as a synthetic opening activity so every case has a start event. Without it, cases with early reversals appear shorter than they are, because the first movement type becomes the implicit start.
Oracle Fusion / Cloud ERP — P2P event sources
Oracle stores procurement history in PO_HEADERS_ALL, PO_LINES_ALL, and PO_LINE_LOCATIONS_ALL, with receipt transactions in RCV_TRANSACTIONS and invoice distributions in AP_INVOICE_DISTRIBUTIONS_ALL. The join logic follows the same pattern: use the PO header and line identifiers as the case key and the transaction date as the timestamp. Ask the DBA whether activity is better sourced from the transaction type column or from a workflow history table such as WF_ITEM_ACTIVITY_STATUSES.
Cycle time decomposition
Once the log is built, Bottleneck analysis asks where time goes. In supply chain process mining, cycle time decomposes into three components:
| Component | Definition | Supply chain examples |
|---|---|---|
| Queue time | Time waiting for a resource or a decision | Manager approval queue, three-way-match exception backlog, customs hold |
| Service time | Time actively being processed | Goods inspection, invoice data entry, order picking |
| Transport time | Time physically moving between locations | Vendor transit, last-mile delivery, inter-plant transfer |
Queue time is almost always the largest component and the most controllable without capital investment. Service time improvements often need headcount or automation investment. Transport time improvements need network redesign or carrier changes. Queue time improvements often require only a process rule or a visibility alert.
SCOR cycle-time reference metrics
The SCOR (Supply Chain Operations Reference) model defines metrics that correspond to these stages:
| SCOR metric | Definition | Typical range (industrial goods) |
|---|---|---|
| RL.2.1 — Delivery performance to commit date | % of orders delivered on or before commitment | 90–95% |
| RS.2.1 — Order fulfillment cycle time | Calendar days from order receipt to delivery | 2–7 days (MTS), 5–30 days (MTO) |
| AM.2.1 — Cash-to-cash cycle time | DIO + DSO − DPO, in days | 30–70 days (manufacturing) |
| CO.2.1 — Total supply chain cost | % of revenue | 5–15% (industrial) |
Use these as context and conversation starters, not as pass/fail thresholds. A benchmark built on electronics contract manufacturing does not apply to a steel distributor.
Bottleneck detection in a supply chain log
A bottleneck in process mining is the activity with the highest total queue time contribution across all cases in a period — not the slowest individual case or the most-complained-about step. Bottleneck analysis explains the general method; supply chain logs add specific patterns to watch for.
Common P2P bottleneck patterns
| Bottleneck | Symptom in the log | Likely root cause |
|---|---|---|
| Three-way match exception | Long gap between invoice receipt and invoice clearance | Price or quantity variance above tolerance triggers manual review queue |
| Goods receipt delay | Large gap between expected and actual goods receipt event | Vendor late delivery, receiving dock backlog, or inspection queue |
| Approval loop | Sequence: PO created → PO rejected → PO amended → PO created (again) | Price above delegated authority; approval matrix bypassed during demand peaks |
| Duplicate invoice | Multiple invoice receipts on the same PO line | Vendor re-sends; system does not auto-deduplicate; manual matching fails |
Common O2C bottleneck patterns
| Bottleneck | Symptom in the log | Likely root cause |
|---|---|---|
| Credit block | Sales order → credit hold → credit release (days later) → delivery | Customer at credit limit; automatic block not monitored with daily triage |
| Picking backlog | Transfer order created → first picking scan (hours to days later) | Warehouse capacity constraint, incorrect bin location in system |
| Delivery block | Delivery document created → block released → goods issue | Price not confirmed at order time, incomplete customer data |
Conformance checking for supply chains
Conformance checking compares actual variants against a reference path. Process mining fundamentals requires that the reference path be agreed with the process owner before the check begins. In supply chain work, the reference is typically:
- The happy-path sequence documented in the ERP implementation blueprint
- A SCOR Level 3 process model
- The standard operating procedure for the process
SCOR Level 3 P2P reference path for stocked materials
P3.1 Identify Sources of Supply
→ P3.2 Select Supplier and Negotiate
→ S1.1 Schedule Product Deliveries
→ S1.2 Receive Product
→ S1.3 Verify Product
→ S1.4 Transfer Product
→ S1.5 Authorize Supplier PaymentMap each SCOR step to the ERP activity that represents it. "Receive Product" maps to the goods receipt event. "Authorize Supplier Payment" maps to invoice clearance. Any case that skips a step, adds an unplanned step, or revisits a step is a conformance deviation.
Four meaningful supply chain conformance deviations
- Payment before goods receipt. Invoice clearance appears before any goods receipt event. Payment was authorized without physical confirmation of delivery. Percentage of lines affected is the key metric.
- Multiple approval cycles. PO creation appears more than once for the same case, indicating the order was rejected and recreated. Each cycle restarts the clock.
- Reverse goods receipt after clearance. A goods-receipt reversal appears after invoice clearance, meaning Finance confirmed the invoice but the goods were subsequently returned. This creates an unresolved financial liability.
- Vendor bypass. The purchase requisition reaches PO creation without a sourcing or vendor-selection step. The vendor was hard-coded, bypassing the competitive sourcing step in the reference path.
Each deviation is a question, not a verdict. Some deviations are policy-allowed — emergency purchases legitimately skip competitive sourcing. The mining tool surfaces the pattern; the process owner decides which occurrences require action.
Teacher walkthrough: P2P at a component manufacturer
Setting: A manufacturer of industrial seals extracts 14,000 P2P event log rows covering 1,200 PO lines from January to March. The process analyst begins with discovery.
Step 1 — Read the top five variants:
| Variant | Activity sequence | % of cases | Avg cycle time |
|---|---|---|---|
| V1 | PO created → GR → Invoice receipt → Invoice cleared | 61% | 6.2 days |
| V2 | PO created → GR → Invoice receipt → Exception review → Invoice cleared | 18% | 19.4 days |
| V3 | PO created → GR → GR reversal → GR (second) → Invoice receipt → Invoice cleared | 9% | 24.7 days |
| V4 | PO created → Invoice receipt → Invoice cleared (no GR) | 7% | 3.1 days |
| V5 | PO created → Amendment → PO created → GR → Invoice receipt → Invoice cleared | 5% | 28.9 days |
Step 2 — Ask the frequency and duration questions separately:
- V1 is the happy path. 61% coverage is healthy.
- V2 is 18% of volume and inflates cycle time from 6.2 to 19.4 days. The exception-review queue is the bottleneck for more than a third of the total delay.
- V4 — payment with no goods receipt — is 7% of lines and the fastest variant. It is a conformance issue, not a performance problem. Whether it is acceptable depends on whether those lines are all service POs.
- V5 — PO amendment — is only 5% but averages 29 days. Each amendment restarts the approval clock.
Step 3 — Decompose V2:
Break the gap between invoice receipt and invoice cleared by day. 80% of the gap is a queue: invoices sit unassigned in the Accounts Payable shared inbox for an average of 11 days before anyone opens them. Service time once the review begins is 2 days. This is a queue problem, not a complexity problem. Adding more reviewers would help less than a daily triage rule that assigns invoices within four business hours of receipt.
Step 4 — Present findings with a named owner for each:
- V4 conformance issue → Finance controller. Decision needed: which line types are policy-allowed to clear without GR?
- V2 exception-review queue → AP team lead. SLA needed: invoices assigned within 4 hours, resolved within 3 business days.
- V5 amendment frequency → Procurement manager. Root cause question: which buyer-vendor combinations generate the most amendments, and why?
Failure example: mining the wrong case
Symptom: A team mines the P2P process and reports an average cycle time of 3.1 days, far better than the 8-day SLA. The procurement director is sceptical.
Diagnosis: The team used the purchase order header as the case identifier. The company raises multi-line POs where lines 2–5 are consumables (pens, packaging tape) cleared in 1–2 days. Those fast lines dominate the record count and pull the average down. The raw-material lines that drive production scheduling are buried.
Correction: Redefine the case as the PO line and filter to material category RM (raw material). The corrected analysis shows an average of 9.4 days, with 23% of raw-material lines exceeding 15 days. The 3.1-day average was real but irrelevant to the planning team's pain.
Prevention: Before extracting the log, write the case sentence from the SIPOC: "one raw-material quantity ordered from one supplier." Test the sentence against five rows from the extract before loading the full data set.
Pause and think
A conformance check shows that 7% of PO lines skip the goods receipt step and go straight to invoice clearance. The AP lead says "those are service POs — we always pay on invoice for maintenance contracts." What do you need to confirm before marking all those cases as policy-compliant?
(Answer: Confirm that all 7% are service-category POs, not goods POs. Add a material type or purchasing document category filter to the log and separate service lines from goods lines. If any goods PO lines appear in the no-GR group, that is a genuine finding independent of the service-contract policy.)
Guided practice: design a mining brief for Northline
Northline Industrial Components uses SAP S/4HANA. Procurement raises 400–600 POs per month. The procurement manager says average lead time is within target, but the planning team reports that raw-material shortages are causing unplanned production stoppages.
Design a P2P mining brief covering:
- One sentence defining the case.
- The SAP tables that supply case identifier, activity, and timestamp.
- The happy-path activity sequence you expect, in SCOR terms.
- Three conformance deviations most likely to explain production stoppages.
- The bottleneck pattern you will investigate first, and the reason.
Acceptance criteria:
- The case sentence isolates one material delivery, not the whole vendor relationship.
- The table names come from the extract section of this lesson.
- The happy path matches the SCOR Level 3 stocked-material sequence.
- At least one deviation involves the goods receipt step, since production stoppages require physical goods.
- The bottleneck is a queue-time pattern because internal queues are actionable in the short term without capital investment.
Common mistakes
- Mining the PO header when lines on the same order have very different cycle times.
- Using a comment field or free-text description as the activity name — produces thousands of unique activities and an unreadable variant list.
- Running conformance before discovery — the reference path may not match what the system actually allows.
- Treating every missing goods receipt as a deviation without checking whether the lines are service POs.
- Ignoring timezone differences between plants and the central ERP server when comparing timestamps across sites.
- Reporting only the most-frequent variants and missing the slow long-tail variants that are causing the business pain.
Quick check
- What is the correct case identifier for a P2P mining project focused on raw-material vendor lead time?
- Which SAP table stores goods receipt and invoice receipt movements for a purchase order?
- A variant covers 4% of cases but has an average cycle time eight times the happy path. Should it be investigated before or after the 35%-frequency second variant?
- Name one supply chain conformance deviation that can be policy-allowed.
- What is the difference between a bottleneck and a slow activity?
Answers:
- The purchase order line (EBELN + EBELP), because it isolates one material-vendor-quantity combination and prevents fast consumable lines from diluting the raw-material average.
- EKBE — the PO history table — which stores transaction types including goods receipt (VGABE = 1) and invoice receipt (VGABE = 2).
- The 4%-frequency outlier should be investigated first. Its contribution to total cumulative delay can exceed the more-frequent variant, and it may indicate a systemic failure with a specific vendor tier or material category.
- Payment without goods receipt (no-GR path) is policy-allowed for service POs under maintenance contracts.
- A bottleneck is the activity whose total queue time across all cases in a period is highest, constraining overall process throughput. A slow activity takes long per case but may affect few cases and contribute less to total delay than the bottleneck.
Lesson summary
Supply chain process mining applies the three-field event log to ERP data. The key decision is the case definition — a PO line, an order header, or a delivery — and that decision must match the business question. Build the log from ERP history tables (EKBE for SAP P2P), add a synthetic start event, and run discovery before conformance. Cycle time decomposes into queue, service, and transport; queue time is usually the largest and most actionable component. Conformance checking requires an agreed reference — SCOR Level 3 or the implementation blueprint — and must distinguish policy-compliant deviations from genuine process failures.
Bridge to the next lesson
The bottleneck analysis and conformance findings identify where the supply chain loses time under normal conditions. The next lesson asks what happens when the supply chain faces an event it cannot control — a supplier failure, a port closure, a demand shock — and how to design a chain that absorbs disruption rather than fails under it.