@AbapCatalog.sqlViewName: 'PENTPRJCOST'
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #CHECK
@VDM.private:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
define view P_EnterpriseProjectCosts
as select from P_EnterpriseProjectCostsUnion as ProjCstLineItm
association [0..1] to I_FiscalPeriodForVariant as _FiscalPeriod on _FiscalPeriod.FiscalYear = $projection.LedgerFiscalYear
and _FiscalPeriod.FiscalPeriod = $projection.FiscalPeriod
and _FiscalPeriod.FiscalYearVariant = $projection.FiscalYearVariant
association [0..1] to I_EnterpriseProjectElement as _PPMTask on _PPMTask.WBSElementInternalID = $projection.WBSElementInternalID
{
key ProjCstLineItm.SourceLedger,
key ProjCstLineItm.Ledger,
key ProjCstLineItm.CompanyCode,
key ProjCstLineItm.FiscalYear,
key ProjCstLineItm.AccountingDocument,
key ProjCstLineItm.FinancialPlanningReqTransSqnc,
key ProjCstLineItm.FinancialPlanningDataPacket,
key ProjCstLineItm.ActualPlanJournalEntryItem,
ProjCstLineItm.LedgerFiscalYear,
ProjCstLineItm.LedgerGLLineItem,
ProjCstLineItm.FinancialPlanningEntryItem,
ProjCstLineItm.GLAccount,
ProjCstLineItm.ChartOfAccounts,
ProjCstLineItm.AccountingDocCreatedByUser,
ProjCstLineItm.BusinessArea,
ProjCstLineItm.CostCenter,
//Sending Partner fields
ProjCstLineItm.PartnerOrder,
ProjCstLineItm.PartnerOrderCategory,
ProjCstLineItm.PartnerWBSElement,
ProjCstLineItm.PartnerProject,
ProjCstLineItm.BusinessTransactionType,
ProjCstLineItm.DebitCreditCode,
ProjCstLineItm.ControllingDebitCreditCode,
ProjCstLineItm.ProfitCenter,
ProjCstLineItm.WBSElementProfitCenter,
ProjCstLineItm.WBSDescription,
ProjCstLineItm.ProjectObjectNode,
ProjCstLineItm.ProjectType,
ProjCstLineItm.SemanticTag,
ProjCstLineItm.ProjectSummaryTaskUUID,
ProjCstLineItm.ProjectUUID,
ProjCstLineItm.ControllingArea,
ProjCstLineItm.ProcessingStatus,
ProjCstLineItm.Project,
ProjCstLineItm.ProjectInternalID,
ProjCstLineItm.WBSElement,
ProjCstLineItm.ResponsibleCostCenter,
ProjCstLineItm.ProjectDescription,
ProjCstLineItm.ProjectProfileCode,
ProjCstLineItm.ProjectObject,
ProjCstLineItm.AvailabilityControlProfile,
ProjCstLineItm.AvailabilityControlIsActive,
ProjCstLineItm.AvailyCtrlTimeRangeType,
ProjCstLineItm.BudgetCurrencyRole,
ProjCstLineItm.WBSElementInternalID, //CE1908
_PPMTask.ProjectElementUUID as TaskUUID, //CE1908
//'' as TaskUUID,
ProjCstLineItm.CreationDate,
ProjCstLineItm.FunctionalArea,
ProjCstLineItm.CostCtrActivityType,
@Semantics.currencyCode: true
ProjCstLineItm.ControllingObjectCurrency,
@DefaultAggregation: #SUM
@Semantics.amount.currencyCode: 'ControllingObjectCurrency'
ProjCstLineItm.AmountInObjectCurrency,
@Semantics.currencyCode:true
ProjCstLineItm.TransactionCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ProjCstLineItm.AmountInTransactionCurrency,
@Semantics.currencyCode:true
ProjCstLineItm.CompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
ProjCstLineItm.AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
ProjCstLineItm.GlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.AmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.ActualAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjCstLineItm.PlndCostAmtInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.PlanAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.PlanAmountInGlobalCurrency as BaselineAmtInGlobalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.CmtmtCostInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjCstLineItm.CmtmtCostInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjCstLineItm.ActlCostInProjCrcy,
// @DefaultAggregation: #SUM
// @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
// ProjCstLineItm.ActlCmtmtCumltvAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjCstLineItm.AssgdValForBudgetInProjCrcy,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
case
when PlanningCategory = 'PREDICT01' and AmountInGlobalCurrency > 0
then AmountInGlobalCurrency
else 0
end as PredictedAmtInGlobalCurrency,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
case
when PlanningCategory = 'PREDICT02' and AmountInGlobalCurrency > 0
then AmountInGlobalCurrency
else 0
end as LowerPredictionAmtInGlobCrcy,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
case
when PlanningCategory = 'PREDICT03'
then AmountInGlobalCurrency
else 0
end as UpperPredictionAmtInGlobCrcy,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
case
when PlanningCategory = 'CMTMT' or PlanningCategory = 'ACT01'
then AmountInGlobalCurrency
else 0
end as ActlCmtmtCumltvAmtInGlobCrcy,
ProjCstLineItm.ProjectCategory,
ProjCstLineItm.PlannedStartDate,
ProjCstLineItm.PlannedEndDate,
ProjCstLineItm.PlanningCategory,
ProjCstLineItm.PostingDate,
ProjCstLineItm.FiscalPeriod,
ProjCstLineItm.FiscalYearPeriod,
ProjCstLineItm.FiscalYearVariant,
ProjCstLineItm.IsSettled,
ProjCstLineItm.SourceReferenceDocumentType,
ProjCstLineItm.SourceLogicalSystem,
ProjCstLineItm.SourceReferenceDocumentCntxt,
ProjCstLineItm.SourceReferenceDocument,
ProjCstLineItm.SourceReferenceDocumentItem,
ProjCstLineItm.SourceReferenceDocSubitem,
ProjCstLineItm.IsCommitment,
_FiscalPeriod
//_maintorder
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ENTERPRISEPROJECTELEMENT",
"P_ENTERPRISEPROJECTCOSTSUNION"
],
"ASSOCIATED":
[
"I_ENTERPRISEPROJECTELEMENT",
"I_FISCALPERIODFORVARIANT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/