I_DefectCauseCode

DDL: I_DEFECTCAUSECODE Type: view_entity BASIC Package: VDM_QM_NOTIFICATION

Defect Cause Code

I_DefectCauseCode is a Basic CDS View that provides data about "Defect Cause Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 4 fields with key fields DefectCauseCodeGroup, DefectCauseCode. It has 2 associations to related views. Part of development package VDM_QM_NOTIFICATION.

Data Sources (1)

SourceAliasJoin Type
qpcd qpcd from

Associations (2)

CardinalityTargetAliasCondition
[1..1] I_DefectCauseCodeGroup _DefectCauseCodeGroup $projection.DefectCauseCodeGroup = _DefectCauseCodeGroup.DefectCauseCodeGroup
[0..*] I_DefectCauseCodeText _Text $projection.DefectCauseCodeGroup = _Text.DefectCauseCodeGroup and $projection.DefectCauseCode = _Text.DefectCauseCode

Annotations (10)

NameValueLevelField
EndUserText.label Defect Cause Code view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
ObjectModel.representativeKey DefectCauseCode view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #CUSTOMIZING view
Analytics.technicalName IDEFCACODE view
Metadata.ignorePropagatedAnnotations true view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY DefectCauseCodeGroup
KEY DefectCauseCode
_DefectCauseCodeGroup _DefectCauseCodeGroup
_Text _Text
@EndUserText.label: 'Defect Cause Code'
@AccessControl.authorizationCheck: #CHECK
@VDM: {
    viewType:#BASIC,
    lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@ObjectModel: {
    representativeKey: 'DefectCauseCode',
    usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }
}
@Analytics.technicalName: 'IDEFCACODE'
@Metadata.ignorePropagatedAnnotations: true
define view entity I_DefectCauseCode as select from qpcd 

   association [1..1] to I_DefectCauseCodeGroup as _DefectCauseCodeGroup on  $projection.DefectCauseCodeGroup = _DefectCauseCodeGroup.DefectCauseCodeGroup
   
   association [0..*] to I_DefectCauseCodeText  as _Text                 on  $projection.DefectCauseCodeGroup = _Text.DefectCauseCodeGroup
                                                                        and $projection.DefectCauseCode       = _Text.DefectCauseCode                                                     
{
   @ObjectModel.foreignKey.association: '_DefectCauseCodeGroup'
   key cast( qpcd.codegruppe as vdm_qfecausegrp preserving type )  as DefectCauseCodeGroup,
   @ObjectModel.text.association: '_Text'
   key cast( qpcd.code       as vdm_qfecausecod preserving type )  as DefectCauseCode,
// key qpcd.version --> is always 1 so we could leave out 

   
   // DB field has three values, but field shall be indicator

   @Semantics.booleanIndicator: true
   case qpcd.inaktiv
     when ' ' then cast( ' ' as vdm_qm_codeisinactive preserving type )
     else cast( 'X' as vdm_qm_codeisinactive preserving type )
   end                                                             as CodeIsInactive,
     
   // Associations

   _DefectCauseCodeGroup,
   _Text
    
} where qpcd.katalogart = '5' // Causes

    and qpcd.version    = '000001'