I_DefectCode

DDL: I_DEFECTCODE Type: view_entity BASIC Package: VDM_QM_NOTIFICATION

Defect Code

I_DefectCode is a Basic CDS View (Dimension) that provides data about "Defect Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 7 fields with key fields DefectCodeGroup, DefectCode. It has 3 associations to related views. Part of development package VDM_QM_NOTIFICATION.

Data Sources (1)

SourceAliasJoin Type
qpcd qpcd from

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_DefectCodeGroup _DefectCodeGroup $projection.DefectCodeGroup = _DefectCodeGroup.DefectCodeGroup
[0..*] I_DefectCodeText _Text $projection.DefectCodeGroup = _Text.DefectCodeGroup and $projection.DefectCode = _Text.DefectCode
[0..1] I_DefectClass _DefectClass $projection.DefectClass = _DefectClass.DefectClass

Annotations (13)

NameValueLevelField
EndUserText.label Defect Code view
AccessControl.authorizationCheck #MANDATORY view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
Analytics.dataCategory #DIMENSION view
Analytics.technicalName IDEFECTCODE view
ObjectModel.modelingPattern #NONE view
ObjectModel.representativeKey DefectCode view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #CUSTOMIZING view
Metadata.ignorePropagatedAnnotations true view
Metadata.allowExtensions true view

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY DefectCodeGroup
KEY DefectCode
DefectClass qpcd fehlklasse
CodeGroupStatus _DefectCodeGroup CodeGroupStatus
_DefectCodeGroup _DefectCodeGroup
_Text _Text
_DefectClass _DefectClass
@EndUserText.label: 'Defect Code'
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.privilegedAssociations: [ '_Text', '_DefectCodeGroup' ]
@VDM: {
    viewType:#BASIC,
    lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@Analytics.dataCategory: #DIMENSION
@Analytics.technicalName: 'IDEFECTCODE'
@ObjectModel.supportedCapabilities:
    [ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET, #ANALYTICAL_DIMENSION ]
@ObjectModel.modelingPattern: #NONE
@ObjectModel: {
    representativeKey: 'DefectCode',
    usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }
}
@Metadata.ignorePropagatedAnnotations: true
@Metadata.allowExtensions:true
define view entity I_DefectCode as select from qpcd 

   association [1..1] to I_DefectCodeGroup as _DefectCodeGroup on  $projection.DefectCodeGroup = _DefectCodeGroup.DefectCodeGroup
   
   association [0..*] to I_DefectCodeText  as _Text on  $projection.DefectCodeGroup = _Text.DefectCodeGroup
                                                    and $projection.DefectCode      = _Text.DefectCode
                                                    
   association [0..1] to I_DefectClass     as _DefectClass on $projection.DefectClass = _DefectClass.DefectClass
                                                     
{
   @Consumption.valueHelpDefinition: [ 
     { entity:  { name:    'I_DefectCodeGroupStdVH',
                  element: 'DefectCodeGroup' }
     }]
   @ObjectModel.foreignKey.association: '_DefectCodeGroup'
   key cast( qpcd.codegruppe as vdm_qfegrp preserving type )  as DefectCodeGroup,
   @ObjectModel.text.association: '_Text'
   key cast( qpcd.code       as vdm_qfecod preserving type )  as DefectCode,
// 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,
   
   @ObjectModel.foreignKey.association: '_DefectClass'
   qpcd.fehlklasse                                            as DefectClass,
   
   // For authority check

   _DefectCodeGroup.CodeGroupStatus,
   
   // Associations

   _DefectCodeGroup,
   _Text,
   _DefectClass
    
} where qpcd.katalogart = '9' // Defects

    and qpcd.version    = '000001'