C_MatlDefect

DDL: C_MATLDEFECT SQL: CMATLDEFECT Type: view CONSUMPTION

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)

SourceAliasJoin Type
I_DefectUnion I_DefectUnion from

Associations (3)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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]
;