P_ProjectPredictSummryMain is a Consumption CDS View that provides data about "Project Prediction Summary Main" in SAP S/4HANA. It reads from 1 data source (I_ProjectCostLineItems) and exposes 5 fields with key fields Project, ProjectInternalID.
@AbapCatalog.sqlViewName: 'PPROJPREDSMMAIN'
@AbapCatalog.compiler.compareFilter: true@EndUserText.label: 'Project Prediction Summary Main'
@VDM.viewType: #CONSUMPTION@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM.private:true@ClientHandling.algorithm: #SESSION_VARIABLE@AbapCatalog.buffering.status: #NOT_ALLOWED@Metadata.ignorePropagatedAnnotations: true@AbapCatalog.preserveKey:truedefineview P_ProjectPredictSummryMain
withparameters
P_PlanningCategory : fcom_category
asselectfrom I_ProjectCostLineItems as _ProjectCostLineItmes
// association [0..1] to P_ProjPredictionDteCalcintmd as _ProjPredict on $projection.Project = _ProjPredict.Project
// and _ProjPredict.PlanningCategory = 'PREDICT01'
{
key Project,
key ProjectInternalID,
PlanningCategory,
GlobalCurrency,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@EndUserText.label: 'Assigned value in Global Currency'
@EndUserText.quickInfo: 'Assigned value in Global Currency'
@DefaultAggregation: #SUM
ActlCmtmtCumltvAmtInGlobCrcy,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@EndUserText.label: 'Actul Cost In CO Area Currency'
@EndUserText.quickInfo: 'Actual Cost in CO Area Currency'
@DefaultAggregation: #SUMcasewhen _ProjectCostLineItmes.PlanningCategory = 'ACT01'
then _ProjectCostLineItmes.AmountInGlobalCurrency
else 0
endas ActualAmountInGlobalCurrency,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@EndUserText.label: 'Commitment Cost In CO Area Currency'
@EndUserText.quickInfo: 'Commitment Cost in CO Area Currency'
@DefaultAggregation: #SUMcasewhen _ProjectCostLineItmes.PlanningCategory = 'CMTMT'
then _ProjectCostLineItmes.AmountInGlobalCurrency
else 0
endas CmtmtCostInGlobalCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@EndUserText.label: 'Plan Cost In CO Area Currency'
@EndUserText.quickInfo: 'Plan Cost in CO Area Currency'
casewhen _ProjectCostLineItmes.PlanningCategory = $parameters.P_PlanningCategory //'PLN'
then _ProjectCostLineItmes.AmountInGlobalCurrency
else 0
endas PlanAmountInGlobalCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@EndUserText.label: 'Predicted Cost In CO Area Currency'
@EndUserText.quickInfo: 'Predicted Cost in CO Area Currency'
casewhen _ProjectCostLineItmes.PlanningCategory = 'PREDICT01' //testing purpose i changed to cpp1
then _ProjectCostLineItmes.AmountInGlobalCurrency
else 0
endas PredictedAmtInGlobalCurrency,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
casewhen PlanningCategory = 'PREDICT02'
then AmountInGlobalCurrency
else 0
endas LowerPredictionAmtInGlobCrcy,
@DefaultAggregation: #SUM@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
casewhen PlanningCategory = 'PREDICT03'
then AmountInGlobalCurrency
else 0
endas UpperPredictionAmtInGlobCrcy
}