I_DefectLocationCode is a Basic CDS View that provides data about "Defect Location Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 6 fields with key fields DefectLocationCatalog, DefectLocationCodeGroup, DefectLocationCode.
@AbapCatalog.sqlViewName: 'IDEFLOCCD'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #CHECK@ClientHandling.algorithm: #SESSION_VARIABLE@VDM: {
viewType:#BASIC,
lifecycle.contract.type: #PUBLIC_LOCAL_API
}@ObjectModel:{
usageType:{
dataClass: #CUSTOMIZING,
serviceQuality: #A,
sizeCategory: #S
},
representativeKey: 'DefectLocationCode'
}
@EndUserText.label: 'Defect Location Code'
@Metadata.ignorePropagatedAnnotations: truedefineview I_DefectLocationCode asselectfrom qpcd
association[1..1] to I_DefectLocationCatalog as _DefectLocationCatalog on $projection.DefectLocationCatalog = _DefectLocationCatalog.DefectLocationCatalog
association[1..1] to I_DefectLocationCodeGroup as _DefectLocationCodeGroup on $projection.DefectLocationCatalog = _DefectLocationCodeGroup.DefectLocationCatalog and
$projection.DefectLocationCodeGroup = _DefectLocationCodeGroup.DefectLocationCodeGroup
association[1..*] to I_DefectLocationCodeText as _DefectLocationCodeText on $projection.DefectLocationCatalog = _DefectLocationCodeText.DefectLocationCatalog and
$projection.DefectLocationCodeGroup = _DefectLocationCodeText.DefectLocationCodeGroup and
$projection.DefectLocationCode = _DefectLocationCodeText.DefectLocationCode
{
@ObjectModel.foreignKey.association: '_DefectLocationCatalog'
keycast( katalogart as vdm_qfeocat preserving type ) as DefectLocationCatalog,
@ObjectModel.foreignKey.association: '_DefectLocationCodeGroup'
keycast( codegruppe as vdm_qfeogrp preserving type ) as DefectLocationCodeGroup,
@ObjectModel.text.association: '_DefectLocationCodeText'
keycast( code as vdm_qfeocod preserving type ) as DefectLocationCode,
// DB field has three values, but field shall be indicator
@Semantics.booleanIndicator: truecase qpcd.inaktiv
when ' ' thencast( ' ' as vdm_qm_codeisinactive preserving type )
elsecast( 'X' as vdm_qm_codeisinactive preserving type )
endas CodeIsInactive,
_DefectLocationCatalog,
_DefectLocationCodeGroup,
_DefectLocationCodeText
} where
(
// katalogart = 'B' or //Object Parts
katalogart = 'E' //Defect Locations
)
and qpcd.version = '000001'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"QPCD"
],
"ASSOCIATED":
[
"I_DEFECTLOCATIONCATALOG",
"I_DEFECTLOCATIONCODEGROUP",
"I_DEFECTLOCATIONCODETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/