offdataai
SAP · data model template

SAP Quality Management (QM) data model

Third-normal-form mirror of the SAP QM inspection and notification tables as they land from the source ERP. Each SAP table becomes its own entity with a warehouse surrogate key plus the genuine SAP business key(s), and child characteristic/result/sample/item/task/activity tables reference their lot or notification header and the QM master tables via foreign keys. The lot → characteristic → result hierarchy (QALS/QAMV/QAMR) and the usage decision (QAVE) preserve full inspection traceability for ISO-9001 and FDA 21 CFR 820 / GxP audits. Person, vendor and customer names are PII-masked.

Normalized replica of SAP ECC/S4HANA Quality Management source tables for a warehouse staging/replication layer: inspection lot (QALS) → inspection characteristic (QAMV/QAPP) → single result (QAMR), with samples (QASE/QASR) and the one-per-lot usage decision (QAVE); and quality notifications (QMEL) with their items (QMFE), tasks (QMSM) and activities (QMMA) — keyed by the real SAP business keys (prueflos, vorglfnr, merknr, qmnum, fenum, manum) and anchored to material (MARA/MAKT), plant (T001W), vendor (LFA1), customer (KNA1), inspection type (T351), the catalog code group (QPGR/QPCD) and the master inspection characteristic (QPMK). It is a normalized (3NF) relational model that mirrors the source system, suited to operational databases and to landing source data faithfully.

3NFSAPISO-9001GxPFDA-21-CFR-820
16
tables
136
columns
18
relationships
5
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: PostgreSQL). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

master_datainspectionnotifications

Design decisions

  • Lot → characteristic → result hierarchy mirrors SAP QM

    SAP QM records an inspection as the lot QALS, the assigned inspection characteristics QAMV (per operation QAPP), and the individual recorded results QAMR; replicating that three-level hierarchy 1:1 keeps the staging layer lossless and reconcilable against the source QALS/QAMV/QAMR tables.

  • Usage decision modeled as a separate one-per-lot entity

    SAP stores the usage decision in QAVE — exactly one accept/reject (vcode, vbewertung) decision per inspection lot, made after results are recorded; keeping it as its own entity rather than folding it onto QALS preserves the who/when (decided_by, vdatum) audit fact that quality release requires.

  • Catalog code group as a shared coding master

    Defects, causes and activities in SAP QM are all coded against catalog/code-group/code entries (QPGR/QPCD); modeling that as one shared lookup with composite business keys (catalog_type, code_group, code) lets every notification item, task and activity reference a single authoritative coding master instead of free text.

  • Notification item / task / activity normalization

    A quality notification QMEL fans out into defect items QMFE, tasks QMSM and activities QMMA, each a separate SAP subtable with its own item/task counter; splitting them into their own entities avoids repeating the qmnum header on every line and matches how SAP records the corrective-action lifecycle.

  • QM linked to material, vendor and customer for supplier quality and traceability

    Anchoring inspection lots and notifications to material (MARA), vendor (LFA1) and customer (KNA1) supports supplier-quality scoring and complaint handling, and the lot→characteristic→result chain plus the QAVE usage decision delivers the end-to-end traceability ISO-9001 and FDA 21 CFR 820 / GxP audits require.

Tables in the SAP Quality Management (QM) model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Tables (9)

inspection_lot

Grain: one row per inspection lot (prueflos)

SAP QALS — inspection lot record.

ColumnTypeKeys
inspection_lot_keybigintPK
material_keybigint
plant_keybigint
inspection_type_keybigint
vendor_keybigint
prueflosvarcharBK
matnrvarchar
werksvarchar
artvarchar
herkunftvarchar
losmengedecimal
mengeneinheitvarchar
gesstatvarchar
chargvarchar
aufnrvarchar
ebelnvarchar
entstehdatdate
paendtermdate
inspection_start_datedate
inspection_end_datedate

inspection_characteristic

Grain: one row per inspection characteristic (prueflos, vorglfnr, merknr)

SAP QAMV/QAPP — inspection characteristic and operation.

ColumnTypeKeys
inspection_characteristic_keybigintPK
inspection_lot_keybigint
master_characteristic_keybigint
prueflosvarcharBK
vorglfnrvarcharBK
merknrvarcharBK
verwmerkmvarchar
kurztextvarchar
sollwertdecimal
toleranzundecimal
toleranzobdecimal
masseinhvarchar
steuerkzvarchar
is_quantitativeboolean

inspection_result

Grain: one row per single inspection result (prueflos, vorglfnr, merknr, result counter)

SAP QAMR — single inspection result for a characteristic.

ColumnTypeKeys
inspection_result_keybigintPK
inspection_characteristic_keybigint
prueflosvarcharBK
vorglfnrvarcharBK
merknrvarcharBK
result_countervarcharBK
mittelwertdecimal
mbewertgvarchar
nmengedecimal
mengeneinheitvarchar
original_inputvarchar

sample

Grain: one row per inspection sample (prueflos, probenr)

SAP QASE/QASR — inspection sample and sample result.

ColumnTypeKeys
sample_keybigintPK
inspection_lot_keybigint
prueflosvarcharBK
probenrvarcharBK
sample_sizedecimal
sample_result_valuationvarchar

usage_decision

Grain: one row per inspection lot usage decision (prueflos)

SAP QAVE — usage decision (one per inspection lot).

ColumnTypeKeys
usage_decision_keybigintPK
inspection_lot_keybigint
prueflosvarcharBK
vcodevarchar
vdatumdate
vzeitvarchar
vbewertungvarchar
objnrvarchar
decided_byvarcharPII
lvsperrevarchar

quality_notification

Grain: one row per quality notification (qmnum)

SAP QMEL — quality notification header.

ColumnTypeKeys
quality_notification_keybigintPK
material_keybigint
plant_keybigint
vendor_keybigint
customer_keybigint
inspection_lot_keybigint
qmnumvarcharBK
qmartvarchar
qmtxtvarchar
objnrvarchar
erdatdate
qmdatdate
priokvarchar
reported_byvarcharPII
ausvndate

notification_item

Grain: one row per notification item (qmnum, fenum)

SAP QMFE — quality notification item (defect).

ColumnTypeKeys
notification_item_keybigintPK
quality_notification_keybigint
catalog_code_group_keybigint
qmnumvarcharBK
fenumvarcharBK
fetxtvarchar
fekatvarchar
fegrpvarchar
fecodvarchar
anzfehlerdecimal

notification_task

Grain: one row per notification task (qmnum, manum)

SAP QMSM — quality notification task.

ColumnTypeKeys
notification_task_keybigintPK
quality_notification_keybigint
qmnumvarcharBK
manumvarcharBK
mtextvarchar
msausvarchar
task_codevarchar
pstartdate
pendedate
completed_byvarcharPII

notification_activity

Grain: one row per notification activity (qmnum, manum)

SAP QMMA — quality notification activity.

ColumnTypeKeys
notification_activity_keybigintPK
quality_notification_keybigint
qmnumvarcharBK
manumvarcharBK
matxtvarchar
activity_codevarchar
corrective_measurevarchar

Lookup tables (7)

material

Grain: one row per material master general record

SAP MARA/MAKT — material master (general), referenced as a lookup here.

ColumnTypeKeys
material_keybigintPK
matnrvarcharBK
maktxvarchar
mtartvarchar
matklvarchar
meinsvarchar

plant

Grain: one row per plant / inspection location

SAP T001W — plant/branch check table.

ColumnTypeKeys
plant_keybigintPK
werksvarcharBK
name1varchar
land1varchar

vendor

Grain: one row per vendor master general record

SAP LFA1 — vendor master (general), referenced as a lookup here.

ColumnTypeKeys
vendor_keybigintPK
lifnrvarcharBK
name1varcharPII
land1varchar

customer

Grain: one row per customer master general record

SAP KNA1 — customer master (general), referenced as a lookup here.

ColumnTypeKeys
customer_keybigintPK
kunnrvarcharBK
name1varcharPII
land1varchar

inspection_type

Grain: one row per inspection type

SAP T351 — inspection type check table.

ColumnTypeKeys
inspection_type_keybigintPK
artvarcharBK
descriptionvarchar
usagevarchar

catalog_code_group

Grain: one row per catalog/code-group/code (katalogart, codegruppe, code)

SAP QPGR/QPCD — catalog code group / code master (defect, cause and activity coding).

ColumnTypeKeys
catalog_code_group_keybigintPK
catalog_typevarcharBK
code_groupvarcharBK
codevarcharBK
descriptionvarchar

master_characteristic

Grain: one row per master inspection characteristic (mkmnr, werks)

SAP QPMK/QPMT — master inspection characteristic (MIC) master.

ColumnTypeKeys
master_characteristic_keybigintPK
mkmnrvarcharBK
werksvarcharBK
kurztextvarchar
steuerkzvarchar
masseinhvarchar

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • inspection_lot.material_key → material (many-to-one)
  • inspection_lot.plant_key → plant (many-to-one)
  • inspection_lot.inspection_type_key → inspection_type (many-to-one)
  • inspection_lot.vendor_key → vendor (many-to-one)
  • inspection_characteristic.inspection_lot_key → inspection_lot (many-to-one)
  • inspection_characteristic.master_characteristic_key → master_characteristic (many-to-one)
  • inspection_result.inspection_characteristic_key → inspection_characteristic (many-to-one)
  • sample.inspection_lot_key → inspection_lot (many-to-one)
  • usage_decision.inspection_lot_key → inspection_lot (many-to-one)
  • quality_notification.material_key → material (many-to-one)
  • quality_notification.plant_key → plant (many-to-one)
  • quality_notification.vendor_key → vendor (many-to-one)
  • quality_notification.customer_key → customer (many-to-one)
  • quality_notification.inspection_lot_key → inspection_lot (many-to-one)
  • notification_item.quality_notification_key → quality_notification (many-to-one)
  • notification_item.catalog_code_group_key → catalog_code_group (many-to-one)
  • notification_task.quality_notification_key → quality_notification (many-to-one)
  • notification_activity.quality_notification_key → quality_notification (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time