P_ChmlCmpstnStatusCriticality is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncInfo, I_ChmlComposition) and exposes 9 fields with key field ChmlCmplncInfoUUID.
@AbapCatalog.sqlViewName: 'PCCSTSCRITLTY'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@AccessControl.authorizationCheck: #NOT_REQUIRED@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #COMPOSITE@VDM.private: true@ObjectModel:
{
resultSet.sizeCategory: #XS,
--Performance Annotations
usageType:
{
dataClass: #META,
sizeCategory: #M,
serviceQuality: #B
}
}
defineview P_ChmlCmpstnStatusCriticality
as
--Missing: At least one composition in progress, but no released one for that composition type
selectfrom I_ChmlCmplncInfo as ChmlCmplncInfo
innerjoin I_ChmlComposition as CmpsInProgress on CmpsInProgress.ChmlCmplncInfoUUID = ChmlCmplncInfo.ChmlCmplncInfoUUID
and CmpsInProgress.ChmlCompositionStatus = 'IP'
leftouter to many join I_ChmlComposition as CmpsReleased on CmpsReleased.ChmlCmplncInfoUUID = CmpsInProgress.ChmlCmplncInfoUUID
and CmpsReleased.ChmlCompositionType = CmpsInProgress.ChmlCompositionType
and CmpsReleased.ChmlCompositionStatus = 'RE'
{
key ChmlCmplncInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
CmpsInProgress.ChmlCompositionType,
1 as ChmlCompositionStsCriticality
}
where
CmpsReleased.ChmlCmplncInfoUUID isnullunionall
--Missing: No composition at allselectfrom I_ChmlCmplncInfo as ChmlCmplncInfo
leftouter to many join I_ChmlComposition as Cmps on ChmlCmplncInfo.ChmlCmplncInfoUUID = Cmps.ChmlCmplncInfoUUID
and(
Cmps.ChmlCompositionStatus = 'IP'
or Cmps.ChmlCompositionStatus = 'RE'
)
{
key ChmlCmplncInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
max( Cmps.ChmlCompositionType ) as ChmlCompositionType,
1 as ChmlCompositionStsCriticality
}
where
Cmps.ChmlCmplncInfoUUID isnullgroupby
ChmlCmplncInfo.ChmlCmplncInfoUUID
unionall
--In Progress: At least one in progress
selectfrom I_ChmlCmplncInfo as ChmlCmplncInfo
join I_ChmlComposition as CmpsInProgress on ChmlCmplncInfo.ChmlCmplncInfoUUID = CmpsInProgress.ChmlCmplncInfoUUID
and CmpsInProgress.ChmlCompositionStatus = 'IP'
{
key ChmlCmplncInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
CmpsInProgress.ChmlCompositionType,
2 as ChmlCompositionStsCriticality
}
unionall
-- Released: Released versions for which no in progress version exists
selectfrom I_ChmlCmplncInfo as ChmlCmplncInfo
join I_ChmlComposition as CmpsReleased on ChmlCmplncInfo.ChmlCmplncInfoUUID = CmpsReleased.ChmlCmplncInfoUUID
and CmpsReleased.ChmlCompositionStatus = 'RE'
leftouter to many join I_ChmlComposition as CmpsInProgress on CmpsReleased.ChmlCmplncInfoUUID = CmpsInProgress.ChmlCmplncInfoUUID
and CmpsReleased.ChmlCompositionType = CmpsInProgress.ChmlCompositionType
and CmpsInProgress.ChmlCompositionStatus = 'IP'
{
key ChmlCmplncInfo.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
CmpsReleased.ChmlCompositionType,
3 as ChmlCompositionStsCriticality
}
where
CmpsInProgress.ChmlCmplncInfoUUID isnull/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"I_CHMLCOMPOSITION"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/