R_DefectTP

DDL: R_DEFECTTP Type: view_entity TRANSACTIONAL

Defect

R_DefectTP is a Transactional CDS View that provides data about "Defect" in SAP S/4HANA. It reads from 1 data source (I_Defect) and exposes 107 fields with key field DefectInternalID. It has 18 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_Defect _Defect from

Associations (18)

CardinalityTargetAliasCondition
[0..*] R_DefectLongTextTP _DefectDetailedDescription $projection.DefectInternalID = _DefectDetailedDescription.DefectInternalID and _DefectDetailedDescription.LongTextID = 'LTXT'
[0..1] I_DefectCodeGroup _DefectCodeGroup $projection.DefectCodeGroup = _DefectCodeGroup.DefectCodeGroup
[0..1] I_DefectCode _DefectCode $projection.DefectCodeGroup = _DefectCode.DefectCodeGroup and $projection.DefectCode = _DefectCode.DefectCode
[0..1] I_Inspectioncatalog _DefectCauseCodeCatalog $projection.DefectCauseCodeCatalog = _DefectCauseCodeCatalog.InspectionCatalog
[0..1] I_DefectCauseCodeGroup _DefectCauseCodeGroup $projection.DefectCauseCodeGroup = _DefectCauseCodeGroup.DefectCauseCodeGroup
[0..1] I_DefectCauseCode _DefectCauseCode $projection.DefectCauseCodeGroup = _DefectCauseCode.DefectCauseCodeGroup and $projection.DefectCauseCode = _DefectCauseCode.DefectCauseCode
[0..1] I_Inspectioncatalog _DefectObjectCodeCatalog $projection.DefectObjectCodeCatalog = _DefectObjectCodeCatalog.InspectionCatalog
[0..1] I_InspectionCodeGroup _DefectObjectPartCodeGroup $projection.DefectObjectCodeCatalog = _DefectObjectPartCodeGroup.InspectionCatalog and $projection.DefectObjectCodeGroup = _DefectObjectPartCodeGroup.InspectionCodeGroup
[0..1] I_InspectionCode _DefectObjectCode $projection.DefectObjectCodeCatalog = _DefectObjectCode.InspectionCatalog and $projection.DefectObjectCodeGroup = _DefectObjectCode.InspectionCodeGroup and $projection.DefectObjectCode = _DefectObjectCode.InspectionCode
[0..1] I_DefectLocationCatalog _DefectLocationCatalog $projection.DefectLocationCatalog = _DefectLocationCatalog.DefectLocationCatalog
[0..1] I_DefectLocationCodeGroup _DefectLocationCodeGroup $projection.DefectLocationCatalog = _DefectLocationCodeGroup.DefectLocationCatalog and $projection.DefectLocationCodeGroup = _DefectLocationCodeGroup.DefectLocationCodeGroup
[0..1] I_DefectLocationCode _DefectLocationCode $projection.DefectLocationCatalog = _DefectLocationCode.DefectLocationCatalog and $projection.DefectLocationCodeGroup = _DefectLocationCode.DefectLocationCodeGroup and $projection.DefectLocationCode = _DefectLocationCode.DefectLocationCode
[0..1] I_DefectStatus _DefectStatus $projection.DefectLifecycleStatus = _DefectStatus.DefectLifecycleStatus
[0..1] I_ProblemAnalysisStatus _ProblemAnalysisStatus $projection.ProblemAnalysisStatus = _ProblemAnalysisStatus.ProblemAnalysisStatus
[0..1] I_OrderOperationBasic _ProductionOrderOperation $projection.OrderInternalID = _ProductionOrderOperation.OrderInternalID and $projection.InspPlanOperationInternalID = _ProductionOrderOperation.OrderOperationInternalID
[1..1] E_NotificationItem _Extension $projection.DefectInternalID = _Extension.Notification and _Extension.NotificationItem = '0000'
[0..*] R_DefectLongTextTP _DefectLongText
[0..*] R_DefectAffectedObjectTP _DefectAffectedObject

Annotations (9)

NameValueLevelField
AccessControl.authorizationCheck #MANDATORY view
EndUserText.label Defect view
VDM.viewType #TRANSACTIONAL view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
ObjectModel.sapObjectNodeType.name Defect view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.representativeKey DefectInternalID view

Fields (107)

KeyFieldSource TableSource FieldDescription
KEY DefectInternalID I_Defect DefectInternalID
Defect I_Defect Defect
DefectCategory I_Defect DefectCategory
CreatedByUser I_Defect CreatedByUser
CreationDate I_Defect CreationDate
LastChangedByUser I_Defect LastChangedByUser
LastChangeDate I_Defect LastChangeDate
DefectText I_Defect DefectText Description
DefectCodeCatalog I_Defect DefectCodeCatalog
DefectCodeGroup I_Defect DefectCodeGroup
DefectCode I_Defect DefectCode
DefectCodeVersion I_Defect DefectCodeVersion
DefectObjectCodeCatalog I_Defect DefectObjectCodeCatalog
DefectLocationCatalog I_Defect DefectObjectCodeCatalog
DefectObjectCodeGroup I_Defect DefectObjectCodeGroup
DefectLocationCodeGroup I_Defect DefectObjectCodeGroup
DefectObjectCode I_Defect DefectObjectCode
DefectLocationCode I_Defect DefectObjectCode
DefectObjectCodeVersion I_Defect DefectObjectCodeVersion
DefectLocationCodeVersion I_Defect DefectObjectCodeVersion
DefectCauseCodeCatalog I_Defect DefectCauseCodeCatalog
DefectCauseCodeGroup I_Defect DefectCauseCodeGroup
DefectCauseCode I_Defect DefectCauseCode
DefectCauseCodeVersion I_Defect DefectCauseCodeVersion
DefectiveQuantity I_Defect DefectiveQuantity
DefectiveQuantityUnit I_Defect DefectiveQuantityUnit
DefectIsCreatedAutomatically I_Defect DefectIsCreatedAutomatically
ProductionOrderOperationActy I_Defect ProductionOrderOperationActy
ProductionOrderOpActyVers I_Defect ProductionOrderOpActyVers
Batch I_Defect Batch
DefectiveSingleUnit I_Defect DefectiveSingleUnit
ProductionOrder I_Defect ProductionOrder
OrderInternalID I_Defect OrderInternalID
ProductionOrderOperation _ProductionOrderOperation Operation_2
ProductionOrderSequence _ProductionOrderOperation Sequence
CreationTime I_Defect CreationTime
LastChangeTime I_Defect LastChangeTime
DefectClass I_Defect DefectClass
NumberOfDefects I_Defect NumberOfDefects
InspPlanOperationInternalID I_Defect InspPlanOperationInternalID
InspectionCharacteristic I_Defect InspectionCharacteristic
InspectionSubsetInternalID I_Defect InspectionSubsetInternalID
MaterialSample I_Defect MaterialSample
WorkCenterTypeCode I_Defect WorkCenterTypeCode
MainWorkCenterInternalID I_Defect MainWorkCenterInternalID
MainWorkCenterPlant I_Defect MainWorkCenterPlant
MainWorkCenter I_Defect MainWorkCenter
Equipment I_Defect Equipment
FunctionalLocation I_Defect FunctionalLocation
IsDeleted I_Defect IsDeleted
DefectOrigin I_Defect DefectOrigin
Material I_Defect Material
Plant I_Defect Plant
StorageLocation I_Defect StorageLocation
InspectionLot I_Defect InspectionLot
CatalogProfile I_Defect CatalogProfile
ChangedDateTime I_Defect ChangedDateTime
DefectLifecycleStatus I_Defect DefectLifecycleStatus
DefectArchivingStatus I_Defect DefectArchivingStatus
ProblemAnalysisStatus I_Defect ProblemAnalysisStatus
QualityIssueReference I_Defect QualityIssueReference
MasterLanguage
DefectUUID I_Defect DefectUUID
ProductionSupplyArea I_Defect ProductionSupplyArea
EWMWarehouse I_Defect EWMWarehouse
SourceStorageType I_Defect SourceStorageType
SourceStorageBin I_Defect SourceStorageBin
WarehouseLogicalSystem I_Defect WarehouseLogicalSystem
DefectCausedBy I_Defect DefectCausedBy
CostCenter I_Defect CostCenter
BOMItemInstanceUUID I_Defect BOMItemInstanceUUID
ProducedMaterial I_Defect ProducedMaterial
ProducedSerialNumber I_Defect ProducedSerialNumber
_CatalogProfile I_Defect _CatalogProfile
_DefectCategory I_Defect _DefectCategory
_DefectCode _DefectCode
_DefectCodeCatalog I_Defect _DefectCodeCatalog
_DefectCodeGroup _DefectCodeGroup
_InspectionLot I_Defect _InspectionLot
_DefectiveQuantityUnit I_Defect _DefectiveQuantityUnit
_DefectObjectCodeCatalog _DefectObjectCodeCatalog
_DefectLocationCatalog _DefectLocationCatalog
_DefectObjectPartCodeGroup _DefectObjectPartCodeGroup
_DefectLocationCodeGroup _DefectLocationCodeGroup
_DefectObjectCode _DefectObjectCode
_DefectLocationCode _DefectLocationCode
_DefectStatus _DefectStatus
_DefectArchivingStatus _DefectArchivingStatus
_ProblemAnalysisStatus _ProblemAnalysisStatus
_Product _Product
_ProducedMaterial _ProducedMaterial
_Plant _Plant
_StorageLocation _StorageLocation
_DefectClass _DefectClass
_CreatedByUserContactCard _CreatedByUserContactCard
_LastChangedByUserContactCard _LastChangedByUserContactCard
_DefectCauseCodeCatalog _DefectCauseCodeCatalog
_DefectCauseCodeGroup _DefectCauseCodeGroup
_DefectCauseCode _DefectCauseCode
_ProductionSupplyArea _ProductionSupplyArea
_EWM_WarehouseNumber_2 _EWM_WarehouseNumber_2
_EWM_SourceStorageType _EWM_SourceStorageType
_EWM_SourceStorageBin _EWM_SourceStorageBin
_DefectCausedBy _DefectCausedBy
_DefectLongText _DefectLongText
_DefectAffectedObject _DefectAffectedObject
_DefectDetailedDescription _DefectDetailedDescription
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'Defect'
@VDM: {
  viewType: #TRANSACTIONAL,
  lifecycle.contract.type: #SAP_INTERNAL_API
}
@ObjectModel.sapObjectNodeType: { name: 'Defect' }
@ObjectModel: {
  usageType: {
    dataClass: #TRANSACTIONAL,
    sizeCategory: #L,
    serviceQuality: #B
  },
  representativeKey: 'DefectInternalID',
  semanticKey: ['Defect']
}

define root view entity R_DefectTP as select from I_Defect as _Defect

    //Compositions to child nodes

    composition [0..*] of R_DefectLongTextTP        as _DefectLongText                                                                             
    composition [0..*] of R_DefectAffectedObjectTP  as _DefectAffectedObject
    
    //Specialization for child nodes

    association [0..*] to R_DefectLongTextTP        as _DefectDetailedDescription  on  $projection.DefectInternalID = _DefectDetailedDescription.DefectInternalID
                                                                                   and _DefectDetailedDescription.LongTextID = 'LTXT'

//    association [0..1] to tqdefectconfig as _DefectConfiguration on _Defect.DefectInternalID = _DefectConfiguration.defectinternalid

    
    association [0..1] to I_DefectCodeGroup     as _DefectCodeGroup             on  $projection.DefectCodeGroup   = _DefectCodeGroup.DefectCodeGroup
    association [0..1] to I_DefectCode          as _DefectCode                  on  $projection.DefectCodeGroup   = _DefectCode.DefectCodeGroup
                                                                                and $projection.DefectCode        = _DefectCode.DefectCode  

    association [0..1] to I_Inspectioncatalog    as _DefectCauseCodeCatalog    on $projection.DefectCauseCodeCatalog  = _DefectCauseCodeCatalog.InspectionCatalog
    association [0..1] to I_DefectCauseCodeGroup as _DefectCauseCodeGroup      on $projection.DefectCauseCodeGroup    = _DefectCauseCodeGroup.DefectCauseCodeGroup
    association [0..1] to I_DefectCauseCode      as _DefectCauseCode           on $projection.DefectCauseCodeGroup    = _DefectCauseCode.DefectCauseCodeGroup
                                                                              and $projection.DefectCauseCode         = _DefectCauseCode.DefectCauseCode
                                                                               
    association [0..1] to I_Inspectioncatalog   as _DefectObjectCodeCatalog     on  $projection.DefectObjectCodeCatalog      = _DefectObjectCodeCatalog.InspectionCatalog
    association [0..1] to I_InspectionCodeGroup as _DefectObjectPartCodeGroup   on  $projection.DefectObjectCodeCatalog      = _DefectObjectPartCodeGroup.InspectionCatalog
                                                                               and $projection.DefectObjectCodeGroup    = _DefectObjectPartCodeGroup.InspectionCodeGroup
    association [0..1] to I_InspectionCode      as _DefectObjectCode            on  $projection.DefectObjectCodeCatalog      = _DefectObjectCode.InspectionCatalog
                                                                               and $projection.DefectObjectCodeGroup    = _DefectObjectCode.InspectionCodeGroup
                                                                               and $projection.DefectObjectCode             = _DefectObjectCode.InspectionCode
    association [0..1] to I_DefectLocationCatalog as _DefectLocationCatalog      on  $projection.DefectLocationCatalog = _DefectLocationCatalog.DefectLocationCatalog
    association [0..1] to I_DefectLocationCodeGroup as _DefectLocationCodeGroup  on  $projection.DefectLocationCatalog   = _DefectLocationCodeGroup.DefectLocationCatalog
                                                                                 and $projection.DefectLocationCodeGroup = _DefectLocationCodeGroup.DefectLocationCodeGroup
    association [0..1] to I_DefectLocationCode as _DefectLocationCode            on  $projection.DefectLocationCatalog   = _DefectLocationCode.DefectLocationCatalog
                                                                                 and $projection.DefectLocationCodeGroup = _DefectLocationCode.DefectLocationCodeGroup
                                                                                 and $projection.DefectLocationCode      = _DefectLocationCode.DefectLocationCode
   
    association [0..1] to I_DefectStatus            as _DefectStatus           on $projection.DefectLifecycleStatus = _DefectStatus.DefectLifecycleStatus
    association [0..1] to I_ProblemAnalysisStatus   as _ProblemAnalysisStatus  on $projection.ProblemAnalysisStatus = _ProblemAnalysisStatus.ProblemAnalysisStatus               

    // Production Order and Order Operation ("Production" means all data record with 'ManufacturingOrderCategory' = '10' from this data source)

    association [0..1] to I_OrderOperationBasic     as _ProductionOrderOperation on  $projection.OrderInternalID = _ProductionOrderOperation.OrderInternalID
                                                                                 and $projection.InspPlanOperationInternalID = _ProductionOrderOperation.OrderOperationInternalID 
//    // Manufacturing Order Operation

//    association [0..1] to I_ManufacturingOrderOperation    as _MfgOrderOperation on  $projection.OrderInternalID = _MfgOrderOperation.MfgOrderInternalID

//                                                                                 and $projection.InspPlanOperationInternalID = _MfgOrderOperation.OrderOperationInternalID


    //Extension

    association [1..1] to E_NotificationItem        as _Extension              on  $projection.DefectInternalID = _Extension.Notification and
                                                                                   _Extension.NotificationItem = '0000'

{
      key _Defect.DefectInternalID,
   
       @ObjectModel.sapObjectNodeTypeReference: 'Defect'
       _Defect.Defect,
       _Defect.DefectCategory,  
       _Defect.CreatedByUser, 
       _Defect.CreationDate,
       _Defect.LastChangedByUser,
       _Defect.LastChangeDate,
       @EndUserText.label: 'Description'  // <-- TODO: define data element for cast (also in I_Defect_TP?!)

       _Defect.DefectText,  
       _Defect.DefectCodeCatalog, 
       @ObjectModel.foreignKey.association: '_DefectCodeGroup'
       _Defect.DefectCodeGroup, 
       @ObjectModel.foreignKey.association: '_DefectCode'
       _Defect.DefectCode, 
       _Defect.DefectCodeVersion,
       @ObjectModel.foreignKey.association: '_DefectObjectCodeCatalog'
       @VDM.lifecycle: { status: #DEPRECATED, successor: 'DefectLocationCatalog' }
       _Defect.DefectObjectCodeCatalog,
       @ObjectModel.foreignKey.association: '_DefectLocationCatalog'
       _Defect.DefectObjectCodeCatalog as DefectLocationCatalog,
       @ObjectModel.foreignKey.association: '_DefectObjectPartCodeGroup'
       @VDM.lifecycle: { status: #DEPRECATED, successor: 'DefectLocationCodeGroup' }
       _Defect.DefectObjectCodeGroup,
       @ObjectModel.foreignKey.association: '_DefectLocationCodeGroup'
       _Defect.DefectObjectCodeGroup   as DefectLocationCodeGroup,
       @ObjectModel.foreignKey.association: '_DefectObjectCode'
       @VDM.lifecycle: { status: #DEPRECATED, successor: 'DefectLocationCode' }
       _Defect.DefectObjectCode,
       @ObjectModel.foreignKey.association: '_DefectLocationCode'
       _Defect.DefectObjectCode        as DefectLocationCode,
       @VDM.lifecycle: { status: #DEPRECATED, successor: 'DefectLocationCodeVersion' }
       _Defect.DefectObjectCodeVersion,
       _Defect.DefectObjectCodeVersion as DefectLocationCodeVersion,
       
       @ObjectModel.foreignKey.association: '_DefectCauseCodeCatalog'
       _Defect.DefectCauseCodeCatalog,
       @ObjectModel.foreignKey.association: '_DefectCauseCodeGroup'
       _Defect.DefectCauseCodeGroup,
       @ObjectModel.foreignKey.association: '_DefectCauseCode'
       _Defect.DefectCauseCode,    
       _Defect.DefectCauseCodeVersion, 
       _Defect.DefectiveQuantity,
       _Defect.DefectiveQuantityUnit,
       _Defect.DefectIsCreatedAutomatically, 
       _Defect.ProductionOrderOperationActy, 
       _Defect.ProductionOrderOpActyVers,
       _Defect.Batch,
       _Defect.DefectiveSingleUnit,
       _Defect.ProductionOrder,
       _Defect.OrderInternalID,
       // Values of Operation_2 and Operation are equal in underlying view

       _ProductionOrderOperation.Operation_2 as ProductionOrderOperation, // External operation number

       _ProductionOrderOperation.Sequence as ProductionOrderSequence, // Sequence of operation

       
       @Semantics.time: true
       _Defect.CreationTime, 
       @Semantics.time: true
       _Defect.LastChangeTime, 
       _Defect.DefectClass, 
       _Defect.NumberOfDefects, 
       _Defect.InspPlanOperationInternalID,  
       _Defect.InspectionCharacteristic,  
       _Defect.InspectionSubsetInternalID,  
       _Defect.MaterialSample, 

//     Work center data

       _Defect.WorkCenterTypeCode,  
       _Defect.MainWorkCenterInternalID,  
       _Defect.MainWorkCenterPlant,
       _Defect.MainWorkCenter,           //External id, required for auth. check


       _Defect.Equipment, 
       _Defect.FunctionalLocation, 
       _Defect.IsDeleted, 
       _Defect.DefectOrigin,        
       _Defect.Material,        
       _Defect.Plant,        
       _Defect.StorageLocation,
       _Defect.InspectionLot,  
       _Defect.CatalogProfile,  
       _Defect.ChangedDateTime,
       
       @ObjectModel.foreignKey.association: '_DefectStatus'
       _Defect.DefectLifecycleStatus,
       @ObjectModel.foreignKey.association: '_DefectArchivingStatus'
       _Defect.DefectArchivingStatus,
       @ObjectModel.foreignKey.association: '_ProblemAnalysisStatus'
       _Defect.ProblemAnalysisStatus,
       _Defect.QualityIssueReference,
       cast( _Defect.MasterLanguage as vdm_j_masterlanguage  )         as MasterLanguage,
       _Defect.DefectUUID,
       _Defect.ProductionSupplyArea,
       @ObjectModel.foreignKey.association: '_EWM_WarehouseNumber_2'
       _Defect.EWMWarehouse,
       @ObjectModel.foreignKey.association: '_EWM_SourceStorageType'
       _Defect.SourceStorageType,
       @ObjectModel.foreignKey.association: '_EWM_SourceStorageBin'
       _Defect.SourceStorageBin,
       _Defect.WarehouseLogicalSystem,
    
//       _DefectConfiguration.defectconfigurationvalue as DefectConfigurationValue,

       
       _Defect.DefectCausedBy,
       _Defect.CostCenter,
       _Defect.BOMItemInstanceUUID,
       _Defect.ProducedMaterial,
       _Defect.ProducedSerialNumber,
       
       /* Associations */
       _Defect._CatalogProfile, 
       _Defect._DefectCategory, 
       _DefectCode, 
       _Defect._DefectCodeCatalog, 
       _DefectCodeGroup, 
       _Defect._InspectionLot,
//       @VDM.lifecycle: { status: #DEPRECATED, successor: '_DefectiveQuantityUnit' }

//       _Defect._DefectiveQtyUnitOfMeasure,

       _Defect._DefectiveQuantityUnit,
//       _Defect._Notification,  // Do not use, because Defect has no foreignKey relation to I_Notification! 

       @VDM.lifecycle: { status: #DEPRECATED, successor: '_DefectLocationCatalog' }
       _DefectObjectCodeCatalog, 
       _DefectLocationCatalog,
       @VDM.lifecycle: { status: #DEPRECATED, successor: '_DefectLocationCodeGroup' }
       _DefectObjectPartCodeGroup,
       _DefectLocationCodeGroup, 
       @VDM.lifecycle: { status: #DEPRECATED, successor: '_DefectLocationCode' }
       _DefectObjectCode,
       _DefectLocationCode,
       _DefectStatus,
       _DefectArchivingStatus,
       _ProblemAnalysisStatus,
       _Product,
       _ProducedMaterial,
       _Plant,
       _StorageLocation,
       _DefectClass, 
       _CreatedByUserContactCard,
       _LastChangedByUserContactCard, 
       _DefectCauseCodeCatalog,
       _DefectCauseCodeGroup,
       _DefectCauseCode,
       _ProductionSupplyArea,
       _EWM_WarehouseNumber_2,
       _EWM_SourceStorageType,
       _EWM_SourceStorageBin,
       _DefectCausedBy,
              
       /* Compositions */
       _DefectLongText,
       _DefectAffectedObject,
       
       /* Specializations */
       _DefectDetailedDescription
          
}