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
Notification I_DefectUnion Notification
NotificationItem I_DefectUnion NotificationItem
Material I_DefectUnion Material Material
Defect I_DefectUnion Defect
MaterialName
NumberOfDefects I_DefectUnion NumberOfDefects Defects
DefectCode I_DefectUnion DefectCode
DefectCodeGroup I_DefectUnion DefectCodeGroup
Plant I_DefectUnion Plant
InspectionLotOrigin
CreationDate I_DefectUnion CreationDate
Supplier
Customer
DefectCategory I_DefectUnion DefectCategory
DefectClass I_DefectUnion DefectClass
MainWorkCenterInternalID I_DefectUnion MainWorkCenterInternalID
WorkCenter _WorkCenter WorkCenter
InspectionLotType
Batch
BatchStorageLocation
CalendarWeek _DefectsWeek CalendarWeek
CalendarYear _DefectsWeek CalendarYear
Manufacturer
ManufacturerPartNmbr
PurchasingOrganization
PurchasingDocument
ManufacturingOrder
SalesOrder
DeliveryDocument
SalesOrganization
MaterialByCustomer
InspectionLotHasUsageDecision
InspectionLot InspectionLot
IsBusinessPurposeCompleted _InspectionLot IsBusinessPurposeCompleted
MainWorkCenterPlant I_DefectUnion MainWorkCenterPlant
MainWorkCenter I_DefectUnion MainWorkCenter
WorkCenterTypeCode I_DefectUnion WorkCenterTypeCode
_WorkCenter _WorkCenter
_DefectsWeek _DefectsWeek
_Notification _Notification
_InspectionLot _InspectionLot
@AbapCatalog.sqlViewName: 'CMATLDEFECT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Defects by Material'
@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType: {
    dataClass: #TRANSACTIONAL,
    sizeCategory: #L,
    serviceQuality: #C
}

-- DEPRECATED - This view is deprecated and is no longer used.

define view C_MatlDefect
  as select from I_DefectUnion
  
  /*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
  association [0..1] to I_WorkCenterBySemanticKey as _WorkCenter  on  $projection.MainWorkCenterInternalID = _WorkCenter.WorkCenterInternalID

  //Week & Year format

  association [1..1] to I_CalendarDate            as _DefectsWeek on  $projection.CreationDate = _DefectsWeek.CalendarDate
  
  association [0..1] to I_Notification            as _Notification on $projection.Notification = _Notification.Notification
{

      @DefaultAggregation: #NONE
      @ObjectModel.readOnly: true
  key I_DefectUnion.DefectInternalID,
  
      I_DefectUnion.Notification,
      I_DefectUnion.NotificationItem,

      @ObjectModel: {  readOnly: true, text.element:  [ 'MaterialName' ] }
      @EndUserText.label: 'Material'
      I_DefectUnion.Material,

      @DefaultAggregation: #NONE
      @ObjectModel.readOnly: true
      I_DefectUnion.Defect,

      @Semantics.text: true
      @ObjectModel.readOnly: true
      I_DefectUnion._InspectionLot._Material._Text[1:Language=$session.system_language].MaterialName,


      @DefaultAggregation: #SUM
      @ObjectModel.readOnly: true
      @EndUserText.label: 'Defects'
      I_DefectUnion.NumberOfDefects,

      //Fields for filter

      @UI.hidden: true
      I_DefectUnion.DefectCode,

      @UI.hidden: true
      I_DefectUnion.DefectCodeGroup,

      @UI.hidden: true
      I_DefectUnion.Plant,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.InspectionLotOrigin,

      @UI.hidden: true
      I_DefectUnion.CreationDate,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.Supplier,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.Customer,

      @UI.hidden: true
      I_DefectUnion.DefectCategory,

      @UI.hidden: true
      I_DefectUnion.DefectClass,

      @UI.hidden: true
      I_DefectUnion.MainWorkCenterInternalID,

      @UI.hidden: true
      _WorkCenter.WorkCenter,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.InspectionLotType,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.Batch,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.BatchStorageLocation,

      @UI.hidden: true
      _DefectsWeek.CalendarWeek,

      @UI.hidden: true
      _DefectsWeek.CalendarYear,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.Manufacturer,
      @UI.hidden: true
      I_DefectUnion._InspectionLot.ManufacturerPartNmbr,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.PurchasingOrganization,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.PurchasingDocument,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.ManufacturingOrder,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.SalesOrder,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.DeliveryDocument,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.SalesOrganization,

      @UI.hidden: true
      I_DefectUnion._InspectionLot.MaterialByCustomer,

      @UI.hidden: true
      cast ( I_DefectUnion._InspectionLot.InspectionLotHasUsageDecision as xfeld) as InspectionLotHasUsageDecision,
      
      @Consumption.hidden: true
      InspectionLot,
      
      @Consumption.hidden: true
      _InspectionLot.IsBusinessPurposeCompleted,     

//    Fields related to authorization checks

      @Consumption.hidden: true
      I_DefectUnion.MainWorkCenterPlant,
      @Consumption.hidden: true
      I_DefectUnion.MainWorkCenter,
      @Consumption.hidden: true
      I_DefectUnion.WorkCenterTypeCode,

      //Associations

      @Consumption.filter.hidden: true
      _WorkCenter,
      @Consumption.filter.hidden: true
      _DefectsWeek,
      @Consumption.filter.hidden: true
       _Notification, //do not publish this association via the OData service, it is just needed for auth. check!

      @Consumption.filter.hidden: true
      @Consumption.hidden: true
      _InspectionLot
      
} where I_DefectUnion.Material <> '' and I_DefectUnion.Material is not null
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_DEFECTUNION",
"I_INSPECTIONLOT",
"I_MATERIAL",
"I_MATERIALTEXT",
"I_WORKCENTERBYSEMANTICKEY"
],
"ASSOCIATED":
[
"I_CALENDARDATE",
"I_INSPECTIONLOT",
"I_NOTIFICATION",
"I_WORKCENTERBYSEMANTICKEY"
],
"BASE":
[
"I_DEFECTUNION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/