C_PPM_ProjectBriefCost

DDL: C_PPM_PROJECTBRIEFCOST SQL: CPPMPROBRFCOSP Type: view CONSUMPTION Package: ODATA_PPM_PRO_PROJECT_BRIEF

Source of Cost Chart

C_PPM_ProjectBriefCost is a Consumption CDS View that provides data about "Source of Cost Chart" in SAP S/4HANA. It reads from 1 data source (I_PPM_Project) and exposes 21 fields with key fields ProjectUUID, ProjectSummaryTaskUUID, ProjectInternalID, YearMonth. It has 5 associations to related views. Part of development package ODATA_PPM_PRO_PROJECT_BRIEF.

Data Sources (1)

SourceAliasJoin Type
I_PPM_Project PPM from

Associations (5)

CardinalityTargetAliasCondition
[1] I_CalendarMonth _CalendarMonth $projection.CalendarMonth = _CalendarMonth.CalendarMonth
[0..1] I_PPM_AuthznByUsrH _AuthUserFin _AuthUserFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID and _AuthUserFin.UserID = $session.user and _AuthUserFin.Activity = 'Financials'
[0..*] I_PPM_AuthznBySubstitH _AuthSubstFin _AuthSubstFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID and _AuthSubstFin.UserID = $session.user and _AuthSubstFin.Activity = 'Financials'
[0..*] I_PPM_AuthznByUserRoleH _AuthRoleFin _AuthRoleFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID and _AuthRoleFin.UserID = $session.user and _AuthRoleFin.Activity = 'Financials'
[0..*] I_PPM_AuthznByUsrGrpH _AuthGroupFin _AuthGroupFin.ReferencedObjectUUID = $projection.ProjectSummaryTaskUUID and _AuthGroupFin.UserID = $session.user and _AuthGroupFin.Activity = 'Financials'

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CPPMPROBRFCOSP view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Source of Cost Chart view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.representativeKey ProjectUUID view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
Consumption.semanticObject Project view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY ProjectUUID I_PPM_Project ProjectUUID
KEY ProjectSummaryTaskUUID I_PPM_Project ProjectSummaryTaskUUID
KEY ProjectInternalID I_PPM_Project ProjectInternalID
KEY YearMonth Period YearMonth
Project I_PPM_Project Project
GlobalCurrency Global Currency
CalendarYear Period CalendarYear
CalendarMonth Period CalendarMonth
CalendarMonthName
ActualAmountInGlobalCurrency Actual
PlanAmountInGlobalCurrency Planned
_CalendarMonth _CalendarMonth
_I_Project I_PPM_Project _I_Project
_AuthUser I_PPM_Project _AuthUser
_AuthSubst I_PPM_Project _AuthSubst
_AuthRole I_PPM_Project _AuthRole
_AuthGroup I_PPM_Project _AuthGroup
_AuthUserFin _AuthUserFin
_AuthSubstFin _AuthSubstFin
_AuthRoleFin _AuthRoleFin
_AuthGroupFin _AuthGroupFin
@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

}