@AbapCatalog.sqlViewName : 'CPPMPROBRFCOSP'
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label : 'Source of Cost Chart'
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #NOT_REQUIRED
}
@ObjectModel: {
representativeKey: 'ProjectUUID',
alternativeKey: [ { id : 'Project', element: [ 'ProjectUUID', 'YearMonth' ], uniqueness: #UNIQUE } ,
{ id : 'PST', element: [ 'ProjectSummaryTaskUUID', 'YearMonth' ], uniqueness: #UNIQUE } ],
usageType: {
sizeCategory: #XXL,
dataClass: #MIXED,
serviceQuality: #D
}
}
@UI.presentationVariant: [{
sortOrder:[{
by : 'YearMonth',
direction: #ASC }] ,
visualizations.type: #AS_CHART
}]
@Consumption.semanticObject : 'Project' // required at the moment because of https://support.wdf.sap.corp/sap/support/message/1770478670
// @Consumption.semanticObject : 'EnterpriseProject' do not use , see above
@UI.chart: [{
title: 'Project Costs',
description: 'Costs',
//qualifier: 'CostChart',
chartType: #LINE,
measures: [ 'PlanAmountInGlobalCurrency', 'ActualAmountInGlobalCurrency' ] ,
// dimensions: [ 'CalendarMonth','CalendarYear'],
dimensions: [ 'YearMonth', 'CalendarYear'],
dimensionAttributes: [
// { dimension: 'CalendarMonth', role: #CATEGORY },
{ dimension: 'YearMonth' , role: #CATEGORY },
{ dimension: 'CalendarYear', role: #CATEGORY }
],
measureAttributes: [
{ measure: 'PlanAmountInGlobalCurrency' , role: #AXIS_1, asDataPoint: false },
{ measure: 'ActualAmountInGlobalCurrency', role: #AXIS_1, asDataPoint: false }
],
actions:[
// { type: #FOR_INTENT_BASED_NAVIGATION, semanticObjectAction : 'displayFinancialReport', label: 'Project Cost Report', requiresContext: false }
{ type: #FOR_INTENT_BASED_NAVIGATION, semanticObjectAction : 'displayFinancialReport', label: 'Project Cost Report' }
]
}]
// this is a dummy view , the actual data and the actual permission check is done within ABAP
define view C_PPM_ProjectBriefCost
as select from I_PPM_Project as PPM
// inner join I_PPM_ProjectCostSumToDate as Interval on PPM.ProjectInternalID = Interval.ProjectInternalID
// join I_YearMonth as Period on Interval.StartDateYearMonth <= Period.YearMonth
// and Interval.EndDateYearMonth >= Period.YearMonth
join I_YearMonth as Period on Period.YearMonth = '201801'
association [1] to I_CalendarMonth as _CalendarMonth on $projection.CalendarMonth = _CalendarMonth.CalendarMonth
// additional associatioins to authorization views
association [0..1] to I_PPM_AuthznByUsrH as _AuthUserFin on _AuthUserFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID
and _AuthUserFin.UserID = $session.user
and _AuthUserFin.Activity = 'Financials'
association [0..*] to I_PPM_AuthznBySubstitH as _AuthSubstFin on _AuthSubstFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID
and _AuthSubstFin.UserID = $session.user
and _AuthSubstFin.Activity = 'Financials'
association [0..*] to I_PPM_AuthznByUserRoleH as _AuthRoleFin on _AuthRoleFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID
and _AuthRoleFin.UserID = $session.user
and _AuthRoleFin.Activity = 'Financials'
association [0..*] to I_PPM_AuthznByUsrGrpH as _AuthGroupFin on _AuthGroupFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID
and _AuthGroupFin.UserID = $session.user
and _AuthGroupFin.Activity = 'Financials'
{
@UI.hidden: true
key PPM.ProjectUUID,
@UI.hidden: true
key PPM.ProjectSummaryTaskUUID,
@UI.hidden: true
key PPM.ProjectInternalID,
@UI.textArrangement: #TEXT_ONLY
@ObjectModel.text.element: [ 'CalendarMonthName' ]
@EndUserText: {
label: 'Month',
quickInfo: 'Month'
}
key Period.YearMonth,
@UI.hidden: true
PPM.Project,
@Semantics.currencyCode: true
// Interval.GlobalCurrency,
@EndUserText.label : 'Global Currency'
cast ( 'EUR' as abap.cuky ) as GlobalCurrency,
// 'EUR' as GlobalCurrency,
@EndUserText: {
label: 'Year',
quickInfo: 'Year'
}
Period.CalendarYear,
@ObjectModel.foreignKey.association : '_CalendarMonth'
@ObjectModel.text.element: [ 'CalendarMonthName' ]
@EndUserText: {
label: 'Month',
quickInfo: 'Month'
}
Period.CalendarMonth,
@UI.hidden: true
_CalendarMonth._Text[1:Language = $session.system_language].CalendarMonthName as CalendarMonthName,
/* Measures */
@Semantics.amount.currencyCode : 'GlobalCurrency'
@DefaultAggregation: #SUM
@EndUserText.label : 'Actual'
@EndUserText.quickInfo : 'Cumulated Actual Cost in CO Area Crcy'
//cast ( 0 as abap.curr ( 25, 2 )) as ActualAmountInGlobalCurrency,
cast ( 0 as /s4ppm/ovr_act_cos_in_glo_curr) as ActualAmountInGlobalCurrency,
@Semantics.amount.currencyCode : 'GlobalCurrency'
@DefaultAggregation: #SUM
@EndUserText.label : 'Planned'
@EndUserText.quickInfo : 'Cumulated Plan Cost in CO Area Crcy'
cast ( 0 as /s4ppm/ovr_pln_cos_in_glo_curr) as PlanAmountInGlobalCurrency,
_CalendarMonth,
@UI.hidden:true
PPM._I_Project,
@UI.hidden:true
PPM._AuthUser,
@UI.hidden:true
PPM._AuthSubst,
@UI.hidden:true
PPM._AuthRole,
@UI.hidden:true
PPM._AuthGroup,
@UI.hidden:true
_AuthUserFin,
@UI.hidden:true
_AuthSubstFin,
@UI.hidden:true
_AuthRoleFin,
@UI.hidden:true
_AuthGroupFin
}
Depth:
1
2
3
4
5
All
Reload
C_PPM_ProjectBriefCost view