I_MaintNotifCauseCode is a Basic CDS View that provides data about "Inspection Code" in SAP S/4HANA. It reads from 1 data source (qpcd) and exposes 9 fields with key fields InspectionCatalog, InspectionCodeGroup, InspectionCode. It has 4 associations to related views.
@AbapCatalog.sqlViewName: 'IPMCAUSECODE'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@ClientHandling.algorithm: #SESSION_VARIABLE@AccessControl.authorizationCheck: #CHECK@EndUserText.label: 'Inspection Code'
@VDM: {
viewType:#BASIC
}@ObjectModel.supportedCapabilities:
[ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET ]@ObjectModel.usageType: { serviceQuality: #A, sizeCategory: #M, dataClass: #CUSTOMIZING }@Metadata.ignorePropagatedAnnotations: truedefineview I_MaintNotifCauseCode asselectfrom qpcd
association [1..1] to I_Inspectioncatalog as _InspectionCatalog
on $projection.InspectionCatalog = _InspectionCatalog.InspectionCatalog
association [1..1] to I_MaintNotifCauseCodeGroup as _InspectionCodeGroup
on $projection.InspectionCatalog = _InspectionCodeGroup.InspectionCatalog
and $projection.InspectionCodeGroup = _InspectionCodeGroup.InspectionCodeGroup
association [1..*] to I_MaintNotifCodeGrpStsTxt as _StatusDesc
on $projection.MaintNotifCauseGrpStatus = _StatusDesc.MaintNotifCodeGrpStatus
association [1..*] to I_InspectionCodeText as _Text
on $projection.InspectionCatalog = _Text.InspectionCatalog
and $projection.InspectionCodeGroup = _Text.InspectionCodeGroup
and $projection.InspectionCode = _Text.InspectionCode
{
@ObjectModel.foreignKey.association: '_InspectionCatalog'
key qpcd.katalogart as InspectionCatalog,
@Consumption.valueHelpDefinition: [
{ entity: { name: 'I_InspectionCodeGroupStdVH',
element: 'InspectionCodeGroup' },
additionalBinding: [{ localElement: 'InspectionCatalog',
element: 'InspectionCatalog' }]
}]
@ObjectModel.foreignKey.association: '_InspectionCodeGroup'
key codegruppe as InspectionCodeGroup,
// key qpcd.version --> is always 1 so we could leave out
@ObjectModel.text.association: '_Text'
key code as InspectionCode,
_InspectionCodeGroup.CodeGroupStatus as MaintNotifCauseGrpStatus ,
// DB field has three values, but field shall be indicator
// @Semantics.booleanIndicator: true // It is boolean, but we cannot tag it, due to static code check
case qpcd.inaktiv
when ' ' thencast( ' ' as vdm_qm_codeisinactive preserving type )
elsecast( 'X' as vdm_qm_codeisinactive preserving type )
endas CodeIsInactive,
// qpcd.gueltigab as MaintCatalogValidFromDate,
// qpcd.ersteller as MaintCatalogCodeCreatedBy,
// qpcd.e_datum as MaintCatalogCodeCreatedOn,
// qpcd.aenderer as MaintCatalogCodeChangedBy,
// qpcd.a_datum as MaintCatalogCodeChangedOn,
// qpcd.inaktiv as MaintCatalogCodeStatus,
// @Semantics.booleanIndicator: true// qpcd.verwendung as MaintCatalogCodeIsUsed,
_InspectionCodeGroup.CodeGroupStatus,
//Associations
_InspectionCatalog,
_InspectionCodeGroup,
_StatusDesc,
_Text
}
where katalogart = '5'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTNOTIFCAUSECODEGROUP",
"QPCD"
],
"ASSOCIATED":
[
"I_INSPECTIONCATALOG",
"I_INSPECTIONCODETEXT",
"I_MAINTNOTIFCAUSECODEGROUP",
"I_MAINTNOTIFCODEGRPSTSTXT"
],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/