I_DefectCube

DDL: I_DEFECTCUBE Type: view COMPOSITE

Defect Analytics Cube View

I_DefectCube is a Composite CDS View (Cube) that provides data about "Defect Analytics Cube View" in SAP S/4HANA. It reads from 3 data sources (I_DefectUnion, I_InspectionLot, I_InspectionOperation) and exposes 43 fields with key field DefectInternalID. It has 3 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_DefectUnion I_DefectUnion from
I_InspectionLot I_InspectionLot left_outer
I_InspectionOperation I_InspectionOperation left_outer

Parameters (2)

NameTypeDefault
P_StartDate mm_a_delivery_date
P_EndDate mm_a_delivery_date

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_InspectionCharacteristic _InspectionCharacteristic $projection.InspectionLot = _InspectionCharacteristic.InspectionLot and $projection.InspPlanOperationInternalID = _InspectionCharacteristic.InspPlanOperationInternalID and $projection.InspectionCharacteristic = _InspectionCharacteristic.InspectionCharacteristic
[0..1] I_WorkCenterBySemanticKey _WorkCenterBySemanticKey $projection.MainWorkCenterInternalID = _WorkCenterBySemanticKey.WorkCenterInternalID and $projection.MainWorkCenterPlant = _WorkCenterBySemanticKey.Plant
[1..*] I_InspSpecificationVersionText _InspSpecificationVersionText $projection.inspectionspecificationplant = _InspSpecificationVersionText.InspectionSpecificationPlant and $projection.inspectionspecification = _InspSpecificationVersionText.InspectionSpecification and $projection.inspectionspecificationversion = _InspSpecificationVersionText.InspectionSpecificationVersion

Annotations (15)

NameValueLevelField
AbapCatalog.buffering.status #NOT_ALLOWED view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.sqlViewName IDEFECTCUBE view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #REQUIRED view
Analytics.dataCategory #CUBE view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Defect Analytics Cube View view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #S view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.viewType #COMPOSITE view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY DefectInternalID DefectInternalID
InspectionLot I_DefectUnion InspectionLot
InspPlanOperationInternalID I_DefectUnion InspPlanOperationInternalID
InspectionCharacteristic InspectionCharacteristic
DefectCategory DefectCategory
CreationDate CreationDate
CreationTime CreationTime
DefectCode DefectCode
DefectCodeGroup DefectCodeGroup
WorkCenterTypeCode WorkCenterTypeCode
MainWorkCenterInternalID MainWorkCenterInternalID
MainWorkCenterPlant MainWorkCenterPlant
InspectionSpecificationText _InspectionCharacteristic InspectionSpecificationText
WorkCenter _WorkCenterBySemanticKey WorkCenter
WorkCenterText
InspectionSpecificationPlant _InspectionCharacteristic InspectionSpecificationPlant
InspectionSpecification _InspectionCharacteristic InspectionSpecification
InspectionSpecificationVersion _InspectionCharacteristic InspectionSpecificationVersion
BillOfOperationsType I_InspectionLot BillOfOperationsType
BillOfOperationsGroup I_InspectionLot BillOfOperationsGroup
BOOOperationInternalID I_InspectionOperation BOOOperationInternalID
Plant I_DefectUnion Plant
Supplier
Material I_DefectUnion Material
Customer
DefectLifecycleStatus I_DefectUnion DefectLifecycleStatus
MasterInspCharcsKey
NumberOfDefects
InspectionLotOrigin InspectionLotOrigin
InspectionLotType InspectionLotType
Notification Notification
NotificationItem NotificationItem
MatlQualityAuthorizationGroup MatlQualityAuthorizationGroup
IsBusinessPurposeCompleted IsBusinessPurposeCompleted
MainWorkCenter MainWorkCenter
_InspectionCharacteristic _InspectionCharacteristic
_DefectCode _DefectCode
_DefectCodeGroup _DefectCodeGroup
_DefectCategory _DefectCategory
_WorkCenterBySemanticKey _WorkCenterBySemanticKey
_Notification _Notification
_InspSpecificationVersionText _InspSpecificationVersionText
_InspectionLot I_DefectUnion _InspectionLot
@AbapCatalog : {
  buffering.status: #NOT_ALLOWED,
  compiler.compareFilter: true,
  sqlViewName: 'IDEFECTCUBE'
}
@AccessControl: {
  authorizationCheck: #CHECK,
  personalData.blocking: #REQUIRED
}
@Analytics: {
  dataCategory: #CUBE
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Defect Analytics Cube View'
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions:true
@ObjectModel: {
  usageType: {
    serviceQuality: #C,
    sizeCategory  : #S,
    dataClass     : #TRANSACTIONAL
  }
}
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
define view I_DefectCube
  with parameters
    P_StartDate : mm_a_delivery_date,
    P_EndDate   : mm_a_delivery_date
  as select from    I_DefectUnion
  // geting supplier and customer details for non notification defects

    left outer join I_InspectionLot       on I_DefectUnion.InspectionLot = I_InspectionLot.InspectionLot

    left outer join I_InspectionOperation on  I_DefectUnion.InspectionLot               = I_InspectionOperation.InspectionLot
                                          and I_DefectUnion.InspPlanOperationInternalID = I_InspectionOperation.InspPlanOperationInternalID
  //for geting master inspection characteristics and inspection characteristics

  association [0..1] to I_InspectionCharacteristic     as _InspectionCharacteristic     on  $projection.InspectionLot               = _InspectionCharacteristic.InspectionLot
                                                                                        and $projection.InspPlanOperationInternalID = _InspectionCharacteristic.InspPlanOperationInternalID
                                                                                        and $projection.InspectionCharacteristic    = _InspectionCharacteristic.InspectionCharacteristic
  //  association [1..1] to I_InspectionOperation      as _IOperation               on  $projection.InspectionLot               = _IOperation.InspectionLot

  //                                                                                and $projection.InspPlanOperationInternalID = _IOperation.InspPlanOperationInternalID

  association [0..1] to I_WorkCenterBySemanticKey      as _WorkCenterBySemanticKey      on  $projection.MainWorkCenterInternalID = _WorkCenterBySemanticKey.WorkCenterInternalID
                                                                                        and $projection.MainWorkCenterPlant      = _WorkCenterBySemanticKey.Plant
  association [1..*] to I_InspSpecificationVersionText as _InspSpecificationVersionText on  $projection.inspectionspecificationplant   = _InspSpecificationVersionText.InspectionSpecificationPlant
                                                                                        and $projection.inspectionspecification        = _InspSpecificationVersionText.InspectionSpecification
                                                                                        and $projection.inspectionspecificationversion = _InspSpecificationVersionText.InspectionSpecificationVersion



{
  key DefectInternalID,
      I_DefectUnion.InspectionLot,
      I_DefectUnion.InspPlanOperationInternalID,
      InspectionCharacteristic,

      DefectCategory,
      CreationDate,
      CreationTime,
      DefectCode,
      DefectCodeGroup,
      WorkCenterTypeCode,
      MainWorkCenterInternalID,
      MainWorkCenterPlant,
      _InspectionCharacteristic.InspectionSpecificationText,
      _WorkCenterBySemanticKey.WorkCenter,
      _WorkCenterBySemanticKey._WorkCenterTextBySemanticKey[1:Language=$session.system_language].WorkCenterText,
      _InspectionCharacteristic.InspectionSpecificationPlant,
      _InspectionCharacteristic.InspectionSpecification,
      _InspectionCharacteristic.InspectionSpecificationVersion,
      I_InspectionLot.BillOfOperationsType,
      I_InspectionLot.BillOfOperationsGroup,
      I_InspectionOperation.BOOOperationInternalID,
      I_DefectUnion.Plant,
      I_DefectUnion._InspectionLot.Supplier,
      I_DefectUnion.Material,
      I_DefectUnion._InspectionLot.Customer,
      I_DefectUnion.DefectLifecycleStatus,

      //      case

      //          when(DefectCategory <> '' or (DefectCategory = '' and I_DefectUnion.Plant = '') )

      //              then

      //                   I_InspectionLot.Plant

      //          when(DefectCategory = '' and I_DefectUnion.Plant <> '')

      //              then

      //                    I_DefectUnion.Plant

      //          end                                                                                                                                                                                                                                                                                                                                                                                                          as               Plant,

      //

      //      case

      //          when(DefectCategory <> '' or (DefectCategory = '' and I_DefectUnion.Supplier = '') )

      //              then

      //                   I_InspectionLot.Supplier

      //          when(DefectCategory = '' and I_DefectUnion.Supplier <> '')

      //              then

      //                   I_DefectUnion.Supplier

      //          end                                                                                                                                                                                                                                                                                                                                                                                                          as               Supplier,

      //

      //      case

      //          when(DefectCategory <> '' or (DefectCategory = '' and I_DefectUnion.Material = '') )

      //              then

      //                  I_InspectionLot.Material

      //          when(DefectCategory = '' and I_DefectUnion.Material <> '')

      //              then

      //                  I_DefectUnion.Material

      //          end                                                                                                                                                                                                                                                                                                                                                                                                          as               Material,

      //

      //      case

      //          when(DefectCategory <> '' or (DefectCategory = '' and I_DefectUnion.Customer = '') )

      //              then

      //                 I_InspectionLot.Customer

      //          when(DefectCategory = '' and I_DefectUnion.Customer <> '')

      //              then

      //                 I_DefectUnion.Customer

      //          end                                                                                                                                                                                                                                                                                                                                                                                                          as               Customer,


      //Inspection Characteristics

      //Combination of Task List Type, Task List Group, Group Counter, Operation & Characteristic

      cast( concat(concat(concat(concat(concat( concat ( concat (concat( I_InspectionOperation.BillOfOperationsType, '-'), ltrim( I_InspectionOperation.BillOfOperationsGroup , '0')  ), '-'), I_InspectionOperation.BillOfOperationsVariant), '-'), I_InspectionOperation.InspectionOperation), '-'), I_DefectUnion.InspectionCharacteristic)
        as qm_inspresaggr_charkey )                                                                                                                                                                                                   as InspResultHistoryCharc,

      //Master Inspection Characterisitic

      //Combination of Master Inspection Characteristic, Plant & Version

      concat( concat ( concat (concat( _InspectionCharacteristic.InspectionSpecification, '-'), _InspectionCharacteristic.InspectionSpecificationPlant), '-'), ltrim(_InspectionCharacteristic.InspectionSpecificationVersion, '0') ) as MasterInspCharcsKey,

      cast( 1 as vdm_numberofdefects )                                                                                                                                                                                                as NumberOfDefects,

      case
          when(DefectCategory = '')
              then
                  cast( 1 as vdm_defectrecdwthnotifcnt )
          else
                  cast( 0 as vdm_defectrecdwthnotifcnt )
          end                                                                                                                                                                                                                         as NumberOfDefectsWithNotif,

      case
          when(DefectCategory <> '')
              then
                  cast( 1 as vdm_defectrecdwthoutnotifcnt )
          else
                  cast( 0 as vdm_defectrecdwthoutnotifcnt )
          end                                                                                                                                                                                                                         as NumberOfDefectsWithoutNotif,

      // fields for filter when navigating from QMIS-characteristics

      InspectionLotOrigin,
      InspectionLotType,

      //fields for DCL

      Notification,
      NotificationItem,
      MatlQualityAuthorizationGroup,
      IsBusinessPurposeCompleted,
      MainWorkCenter,

      // Associations

      _InspectionCharacteristic,
      _DefectCode,
      _DefectCodeGroup,
      _DefectCategory,
      // _DefectCategoryText,

      //assosciation for DCL's

      _WorkCenterBySemanticKey,
      _Notification,
      _InspSpecificationVersionText,
      I_DefectUnion._InspectionLot
}
where
      CreationDate >= $parameters.P_StartDate
  and CreationDate <= $parameters.P_EndDate