# How to Link a CAPA to ERP Lots and Serial Numbers for Containment and Effectiveness

> Source: https://netray.co/erp-help/qms-capa-linked-to-erp-lots-serials-traceability
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

A CAPA is only as good as its containment scope, and the scope comes from ERP genealogy: forward trace from the suspect raw material lot or process to every job, serial and shipment that consumed it, and backward trace from the failed serial to its components. Store the CAPA number against those ERP records, then use ERP rejection and return data to verify effectiveness.

## Kind

how-to

## System

mfg-systems

## Erp

QMS to ERP integration

## Module

CAPA / Lot and Serial Genealogy

## Query

how to link CAPA to ERP lot numbers and serial traceability

## Alternate Queries

- CAPA affected lots ERP genealogy report
- containment scope from ERP lot traceability
- CAPA effectiveness check using ERP data
- which shipped orders contain this lot

## Applies To

Any manufacturing ERP with lot and serial control (SyteLine, SAP, NetSuite, Epicor, Infor LN and M3, Oracle EBS) and any QMS; AS9100 clause 10.2, ISO 9001 clause 10.2, FDA 21 CFR 820 style corrective action expectations

## Steps

### Scoping and tracking a CAPA with ERP data

**Items:**

- Capture the trigger as ERP identifiers: part, lot, serial range, job or work order, PO receipt, work center and date range, not a narrative description.
- Run a backward trace from the failure: serial or lot to the job, then to component lots and the receipts they came from.
- Run a forward trace from the suspect lot, tool, operation or date range: to every job and serial that consumed or passed through it, then to shipments and customers.
- Split the result into stock still on site (quarantine via NCR), WIP (hold the jobs), and shipped (customer notification decision).
- Store the CAPA number against the affected lots and jobs in the ERP, or store the ERP list in the CAPA record, so the link works in both directions.
- Define effectiveness criteria in ERP measurable terms before closing: reject rate for the operation, returns for the part, repeat NCR count for the cause code.
- After the agreed period, rerun the same query and attach the result to the CAPA as the effectiveness evidence.

## Sections

### Traceability depth decides containment quality

**Body:**

Forward and backward tracing both depend on what the ERP captured at the time. If receiving did not record the supplier lot, if issues to the job were posted against a part number with no lot, or if lot-controlled items were consumed by backflush with default lots, the trace stops at the part number and your containment scope becomes the whole stock history. That is the real argument for lot control on critical items and for capturing the supplier lot and heat or batch number at receipt.

Check what your ERP actually holds before the first CAPA needs it. Pick a shipped serial and try to produce its job, operations, component lots and supplier receipts in under an hour. If you cannot, that gap is a finding to fix, and it is more valuable than any single CAPA.

### What the trace query looks like

**Body:**

ERPs store genealogy in transaction history tables: material issues to jobs, lot-to-lot relationships, serial history, and shipment lines. The names differ by system, so use your ERP's documented genealogy report or API where one exists, and a query over the issue and shipment transaction tables where it does not. The shape of the query is the same everywhere: start from the suspect lot, find issue transactions, resolve to jobs, resolve jobs to produced lots and serials, resolve those to shipment lines.

**Code:**

-- Generic forward trace shape (table and column names vary by ERP)
SELECT j.job_no, p.lot_or_serial, s.ship_doc, s.customer, s.ship_date
FROM   material_issue mi
JOIN   job j            ON j.job_no = mi.job_no
JOIN   job_output p     ON p.job_no = j.job_no
LEFT JOIN shipment_line s ON s.lot_or_serial = p.lot_or_serial
WHERE  mi.component_lot = :suspect_lot
ORDER  BY s.ship_date;

### Containment decisions on the result

**Body:**

Each row of the trace needs a decision. On-site stock goes to quarantine through the NCR process. Jobs in progress are put on hold at the next operation. Shipped quantity needs a risk assessment: does the nonconformance affect form, fit, function, safety or a contractual requirement, and do you have an obligation to notify the customer or authority? Aerospace and defense contracts often require notification of escapes, so record who decided and when.

Keep the decision per lot, not per CAPA. A single CAPA commonly covers three lots with three different outcomes: one scrapped, one reworked and re-inspected, one shipped and accepted by the customer under a concession. The record must be able to show that.

### Effectiveness checks that mean something

**Body:**

Closing a CAPA because the corrective action was implemented is not the same as it being effective. Effectiveness means the problem did not recur, and the ERP can show that: first-pass yield for the operation, scrap by reason code for the part, vendor returns by cause, customer returns and warranty claims by part and serial range.

Write the check as a saved query at CAPA creation and put a calendar date on it. A common window is one to three production cycles or a fixed number of lots, depending on volume, and low-volume parts may need a lot-count criterion rather than a time one.

## Pitfalls

- Defining the CAPA scope as a part number because lots were never captured, forcing a recall of everything.
- Backflushing lot-controlled components with default or dummy lots, which destroys genealogy.
- Stopping the trace at the first shipment and never checking whether the shipped part was used as a component by the customer or a downstream job.
- Using implementation of the action as the effectiveness evidence.
- Recording containment as one blanket decision instead of per lot and per shipment.

## Ai Angle

Genealogy tracing is a good fit for a grounded assistant because the question is precise and the answer is a query result. Asked which jobs and shipments consumed a given lot, an ERP-grounded assistant can build and show the trace query, return the job and shipment list, and draft the effectiveness query for the CAPA file. It reads under the user's ERP role, and containment actions, such as holding jobs, remain human decisions.

## Faq

### Can I do a CAPA without lot-level traceability?

**Answer:** You can, but the containment scope will be broader and less defensible, because you cannot prove which units were unaffected. For critical items, especially safety or flight related ones, lot or serial control is effectively required. For low-risk commodity parts, a date range scope may be acceptable if you document the rationale.

### Where should the CAPA record live?

**Answer:** Usually in the QMS, since it carries the root cause, actions, approvals and effectiveness review. The ERP should hold references to the CAPA number on affected lots and jobs, and the CAPA should hold the ERP identifiers it covers, so a search from either side finds the other.

### How long should an effectiveness check run?

**Answer:** Long enough for the failure to recur if the fix did not work. For high volume parts that may be a few weeks or a few hundred units. For low-volume or long-cycle products it is better to specify a number of lots or builds. Your quality procedure should state the rule, and the reviewer should be someone other than the action owner.

## Search terms

CAPA ERP integration, lot traceability CAPA, forward trace backward trace ERP, containment scope lot genealogy, CAPA effectiveness check, AS9100 corrective action, serial number genealogy ERP, recall scope ERP, corrective action preventive action ERP data

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
