C_DefectsByCode

DDL: C_DEFECTSBYCODE SQL: CDEFECTSBYCODE Type: view CONSUMPTION Package: ODATA_QM_DEFECT

Defects by Defect Code

C_DefectsByCode is a Consumption CDS View that provides data about "Defects by Defect Code" in SAP S/4HANA. It reads from 1 data source (I_DefectUnion) and exposes 46 fields with key field DefectInternalID. It has 3 associations to related views. Part of development package ODATA_QM_DEFECT.

Data Sources (1)

SourceAliasJoin Type
I_DefectUnion I_DefectUnion from

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_WorkCenterBySemanticKey _WorkCenter $projection.MainWorkCenterInternalID = _WorkCenter.WorkCenterInternalID and $projection.MainWorkCenterPlant = _WorkCenter.Plant
[1..1] I_CalendarDate _DefectsWeek $projection.CreationDate = _DefectsWeek.CalendarDate
[0..1] I_Notification _Notification $projection.Notification = _Notification.Notification

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName CDEFECTSBYCODE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Defects by Defect Code view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #C view

Fields (46)

KeyFieldSource TableSource FieldDescription
KEY DefectInternalID I_DefectUnion DefectInternalID Internal Defect ID
Notification I_DefectUnion Notification Notification
NotificationItem I_DefectUnion NotificationItem
Defect I_DefectUnion Defect
DefectCodeText
DefectCode I_DefectUnion DefectCode Defect Code
DefectCodeGroupText
DefectCodeGroup I_DefectUnion DefectCodeGroup Code Group
DefectCodeGroupAndCode
NumberOfDefects I_DefectUnion NumberOfDefects Defects
Material I_DefectUnion Material Vehicle Model
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
MainWorkCenterPlant I_DefectUnion MainWorkCenterPlant Plnt WorkCenter
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
WorkCenterTypeCode I_DefectUnion WorkCenterTypeCode Object Type
MainWorkCenter I_DefectUnion MainWorkCenter Work Center
_WorkCenter _WorkCenter
_DefectsWeek _DefectsWeek
_Notification _Notification
_InspectionLot _InspectionLot
_DefectCode _DefectCode
_DefectCodeGroup _DefectCodeGroup

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_DefectsByCode.
-- 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: CDEFECTSBYCODE

CREATE VIEW C_DefectsByCode AS
SELECT
  I_DefectUnion.DefectInternalID AS DefectInternalID,
  I_DefectUnion.Notification AS Notification,
  I_DefectUnion.NotificationItem AS NotificationItem,
  I_DefectUnion.Defect AS Defect,
  I_DefectUnion._DefectCode._Text[1:Language=$session.system_language].DefectCodeText AS DefectCodeText,
  I_DefectUnion.DefectCode AS DefectCode,
  I_DefectUnion._DefectCodeGroup._Text[1:Language=$session.system_language].DefectCodeGroupText AS DefectCodeGroupText,
  I_DefectUnion.DefectCodeGroup AS DefectCodeGroup,
  cast( concat_with_space(I_DefectUnion.DefectCodeGroup, I_DefectUnion.DefectCode, 1) as qdefect_code_group_and_code preserving type ) AS DefectCodeGroupAndCode,
  I_DefectUnion.NumberOfDefects AS NumberOfDefects,
  I_DefectUnion.Material AS Material,
  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,
  I_DefectUnion.MainWorkCenterPlant AS MainWorkCenterPlant,
  _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.WorkCenterTypeCode AS WorkCenterTypeCode,
  I_DefectUnion.MainWorkCenter AS MainWorkCenter
FROM I_DefectUnion
LEFT OUTER JOIN I_WorkCenterBySemanticKey AS _WorkCenter ON MainWorkCenterInternalID = _WorkCenter.WorkCenterInternalID AND MainWorkCenterPlant = _WorkCenter.Plant  -- association [1..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]
;