I_DefectCode

DDL: I_DEFECTCODE SQL: IDEFECTCODE Type: view BASIC

Defect Code

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

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
AbapCatalog.sqlViewName IDEFECTCODE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Defect Code view
AccessControl.authorizationCheck #CHECK view
VDM.viewType #BASIC view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
ObjectModel.representativeKey DefectCode view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #CUSTOMIZING view
Metadata.ignorePropagatedAnnotations true view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY DefectCodeGroup
KEY DefectCode
DefectClass qpcd fehlklasse
_DefectCodeGroup _DefectCodeGroup
_Text _Text
_DefectClass _DefectClass
@AbapCatalog.sqlViewName: 'IDEFECTCODE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Defect Code'
@AccessControl.authorizationCheck: #CHECK
@VDM: {
    viewType:#BASIC,
    lifecycle.contract.type: #PUBLIC_LOCAL_API
}
@ObjectModel.supportedCapabilities:
    [ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET ]
@ObjectModel: {
    representativeKey: 'DefectCode',
    usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }
}
@Metadata.ignorePropagatedAnnotations: true
define view 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,
   
   // Associations

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

    and qpcd.version    = '000001'