C_MatlDefect
Defects by Material
C_MatlDefect is a Consumption CDS View that provides data about "Defects by Material" in SAP S/4HANA. It reads from 1 data source (I_DefectUnion) and exposes 42 fields with key field DefectInternalID. It has 3 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_DefectUnion | I_DefectUnion | from |
Associations (3)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_WorkCenterBySemanticKey | _WorkCenter | $projection.MainWorkCenterInternalID = _WorkCenter.WorkCenterInternalID |
| [1..1] | I_CalendarDate | _DefectsWeek | $projection.CreationDate = _DefectsWeek.CalendarDate |
| [0..1] | I_Notification | _Notification | $projection.Notification = _Notification.Notification |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | CMATLDEFECT | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Defects by Material | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.serviceQuality | #C | view |
Fields (42)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | DefectInternalID | I_DefectUnion | DefectInternalID | Internal Defect ID |
| Notification | I_DefectUnion | Notification | Notification | |
| NotificationItem | I_DefectUnion | NotificationItem | ||
| Material | I_DefectUnion | Material | Material | |
| Defect | I_DefectUnion | Defect | ||
| MaterialName | ||||
| NumberOfDefects | I_DefectUnion | NumberOfDefects | Defects | |
| DefectCode | I_DefectUnion | DefectCode | Damage Code | |
| DefectCodeGroup | I_DefectUnion | DefectCodeGroup | Code Group | |
| Plant | I_DefectUnion | Plant | Valuation Area | |
| InspectionLotOrigin | ||||
| CreationDate | I_DefectUnion | CreationDate | Time Stamp | |
| Supplier | ||||
| Customer | ||||
| DefectCategory | I_DefectUnion | DefectCategory | ||
| DefectClass | I_DefectUnion | DefectClass | Defect Class | |
| MainWorkCenterInternalID | I_DefectUnion | MainWorkCenterInternalID | Work Center | |
| WorkCenter | _WorkCenter | WorkCenter | Work Center | |
| InspectionLotType | ||||
| Batch | ||||
| BatchStorageLocation | ||||
| CalendarWeek | _DefectsWeek | CalendarWeek | Calendar Week | |
| CalendarYear | _DefectsWeek | CalendarYear | Year | |
| Manufacturer | ||||
| ManufacturerPartNmbr | ||||
| PurchasingOrganization | ||||
| PurchasingDocument | ||||
| ManufacturingOrder | ||||
| SalesOrder | ||||
| DeliveryDocument | ||||
| SalesOrganization | ||||
| MaterialByCustomer | ||||
| InspectionLotHasUsageDecision | ||||
| InspectionLot | InspectionLot | Inspection Lot | ||
| IsBusinessPurposeCompleted | _InspectionLot | IsBusinessPurposeCompleted | Purpose Completed | |
| MainWorkCenterPlant | I_DefectUnion | MainWorkCenterPlant | Plnt WorkCenter | |
| MainWorkCenter | I_DefectUnion | MainWorkCenter | Work Center | |
| WorkCenterTypeCode | I_DefectUnion | WorkCenterTypeCode | Object Type | |
| _WorkCenter | _WorkCenter | |||
| _DefectsWeek | _DefectsWeek | |||
| _Notification | _Notification | |||
| _InspectionLot | _InspectionLot |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view C_MatlDefect.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: CMATLDEFECT
CREATE VIEW C_MatlDefect AS
SELECT
I_DefectUnion.DefectInternalID AS DefectInternalID,
I_DefectUnion.Notification AS Notification,
I_DefectUnion.NotificationItem AS NotificationItem,
I_DefectUnion.Material AS Material,
I_DefectUnion.Defect AS Defect,
I_DefectUnion._InspectionLot._Material._Text[1:Language=$session.system_language].MaterialName AS MaterialName,
I_DefectUnion.NumberOfDefects AS NumberOfDefects,
I_DefectUnion.DefectCode AS DefectCode,
I_DefectUnion.DefectCodeGroup AS DefectCodeGroup,
I_DefectUnion.Plant AS Plant,
I_DefectUnion._InspectionLot.InspectionLotOrigin AS InspectionLotOrigin,
I_DefectUnion.CreationDate AS CreationDate,
I_DefectUnion._InspectionLot.Supplier AS Supplier,
I_DefectUnion._InspectionLot.Customer AS Customer,
I_DefectUnion.DefectCategory AS DefectCategory,
I_DefectUnion.DefectClass AS DefectClass,
I_DefectUnion.MainWorkCenterInternalID AS MainWorkCenterInternalID,
_WorkCenter.WorkCenter AS WorkCenter,
I_DefectUnion._InspectionLot.InspectionLotType AS InspectionLotType,
I_DefectUnion._InspectionLot.Batch AS Batch,
I_DefectUnion._InspectionLot.BatchStorageLocation AS BatchStorageLocation,
_DefectsWeek.CalendarWeek AS CalendarWeek,
_DefectsWeek.CalendarYear AS CalendarYear,
I_DefectUnion._InspectionLot.Manufacturer AS Manufacturer,
I_DefectUnion._InspectionLot.ManufacturerPartNmbr AS ManufacturerPartNmbr,
I_DefectUnion._InspectionLot.PurchasingOrganization AS PurchasingOrganization,
I_DefectUnion._InspectionLot.PurchasingDocument AS PurchasingDocument,
I_DefectUnion._InspectionLot.ManufacturingOrder AS ManufacturingOrder,
I_DefectUnion._InspectionLot.SalesOrder AS SalesOrder,
I_DefectUnion._InspectionLot.DeliveryDocument AS DeliveryDocument,
I_DefectUnion._InspectionLot.SalesOrganization AS SalesOrganization,
I_DefectUnion._InspectionLot.MaterialByCustomer AS MaterialByCustomer,
cast ( I_DefectUnion._InspectionLot.InspectionLotHasUsageDecision as xfeld) AS InspectionLotHasUsageDecision,
InspectionLot,
_InspectionLot.IsBusinessPurposeCompleted AS IsBusinessPurposeCompleted,
I_DefectUnion.MainWorkCenterPlant AS MainWorkCenterPlant,
I_DefectUnion.MainWorkCenter AS MainWorkCenter,
I_DefectUnion.WorkCenterTypeCode AS WorkCenterTypeCode
FROM I_DefectUnion
LEFT OUTER JOIN I_WorkCenterBySemanticKey AS _WorkCenter ON MainWorkCenterInternalID = _WorkCenter.WorkCenterInternalID -- association [0..1]
LEFT OUTER JOIN I_CalendarDate AS _DefectsWeek ON CreationDate = _DefectsWeek.CalendarDate -- association [1..1]
LEFT OUTER JOIN I_Notification AS _Notification ON Notification = _Notification.Notification -- association [0..1]
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA