P_PPM_PrjActCstLineItemsSemTag

DDL: P_PPM_PRJACTCSTLINEITEMSSEMTAG Type: view COMPOSITE

P_PPM_PrjActCstLineItemsSemTag is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_GLAccountLineItemRawData, P_PROJECTSEMTAGACC, I_WBSElementBasicData) and exposes 18 fields with key fields Ledger, CompanyCode, SemanticTag, ProjectInternalID, ControllingArea. It has 3 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_GLAccountLineItemRawData ProjCstLineItm from
P_PROJECTSEMTAGACC SemanticTag inner
I_WBSElementBasicData Task inner

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea
[0..1] I_Ledger _Ledger $projection.Ledger = _Ledger.Ledger
[1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PPMPRJBYACTCSTS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.dataMaintenance #RESTRICTED view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.representativeKey ProjectInternalID view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY Ledger I_GLAccountLineItemRawData SourceLedger
KEY CompanyCode I_GLAccountLineItemRawData CompanyCode
KEY SemanticTag P_PROJECTSEMTAGACC SemanticTag
KEY ProjectInternalID I_GLAccountLineItemRawData ProjectInternalID
KEY ControllingArea I_GLAccountLineItemRawData ControllingArea
KEY BusinessArea I_GLAccountLineItemRawData BusinessArea
KEY ProfitCenter I_GLAccountLineItemRawData ProfitCenter
KEY YearMonth _CalendarDate YearMonth
KEY FunctionalArea I_GLAccountLineItemRawData FunctionalArea
KEY Plant I_GLAccountLineItemRawData Plant
KEY ResponsibleCostCenter I_WBSElementBasicData ResponsibleCostCenter
KEY ProjectType I_WBSElementBasicData ProjectType
GlobalCurrency I_GLAccountLineItemRawData GlobalCurrency
AmountInGlobalCurrency
_CompanyCode _CompanyCode
_ControllingArea _ControllingArea
_Ledger _Ledger
_FunctionalArea I_GLAccountLineItemRawData _FunctionalArea
//@EndUserText.label: 'Planned Project Costs per month by SemTag'


@AbapCatalog: {
    sqlViewName: 'PPMPRJBYACTCSTS',
    compiler.compareFilter: true,
    dataMaintenance: #RESTRICTED
}

@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED

@ClientHandling.algorithm: #SESSION_VARIABLE

//@Consumption.semanticObject: 'EnterpriseProject'


@VDM: {
  private: true,
  viewType: #COMPOSITE
}


@ObjectModel: {
//   semanticKey:       [ 'Project' ],

   representativeKey: 'ProjectInternalID',
   supportedCapabilities: [ #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET ],   
   usageType: {
     serviceQuality:  #D,
     dataClass:       #MIXED,
     sizeCategory:    #XL
   }
}
define view P_PPM_PrjActCstLineItemsSemTag
  as select from I_GLAccountLineItemRawData as ProjCstLineItm
// change based on cleanup of I_GLAccountLineItem 30.11.2022  

//    inner join   I_LedgerSourceLedger         as SourceLedger on   ProjCstLineItm.SourceLedger = SourceLedger.SourceLedger

    inner join   I_WBSElementBasicData        as Task         on   ProjCstLineItm.ProjectInternalID    = Task.ProjectInternalID
                                                               and ProjCstLineItm.WBSElementInternalID = Task.WBSElementInternalID
    inner join   P_PROJECTSEMTAGACC           as SemanticTag  on  SemanticTag.ControllingArea    = ProjCstLineItm.ControllingArea
                                                               and SemanticTag.HierarchyNodeVal   = ProjCstLineItm.GLAccount
                                                               and SemanticTag.HierarchyNodeClass = ProjCstLineItm.ChartOfAccounts                                                             

  association [0..1] to I_ControllingArea              as _ControllingArea               on  $projection.ControllingArea = _ControllingArea.ControllingArea
  association [0..1] to I_Ledger                       as _Ledger                        on  $projection.Ledger = _Ledger.Ledger
  association [1]    to I_CompanyCode                  as _CompanyCode                   on  $projection.CompanyCode = _CompanyCode.CompanyCode


{
  @ObjectModel.foreignKey.association: '_Ledger'  
  key  ProjCstLineItm.SourceLedger                                  as Ledger, // change based on cleanup of I_GLAccountLineItem 30.11.2022

  @ObjectModel.foreignKey.association: '_CompanyCode'
  key  ProjCstLineItm.CompanyCode,
  key  SemanticTag.SemanticTag, 
  key  ProjCstLineItm.ProjectInternalID,
  @ObjectModel.foreignKey.association: '_ControllingArea'
  key  ProjCstLineItm.ControllingArea,                
  key  ProjCstLineItm.BusinessArea,
  key  ProjCstLineItm.ProfitCenter,                   
  key  _CalendarDate.YearMonth                                     as YearMonth,
  key  ProjCstLineItm.FunctionalArea,
  key  ProjCstLineItm.Plant,
  key  Task.ResponsibleCostCenter,
  key  Task.ProjectType,
  
       @Semantics.currencyCode:true
       ProjCstLineItm.GlobalCurrency,
       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
       cast( sum( ProjCstLineItm.AmountInGlobalCurrency ) as /s4ppm/ovr_act_cos_in_glo_curr ) as AmountInGlobalCurrency,
       
  _CompanyCode,
  _ControllingArea,
  _Ledger,
  ProjCstLineItm._FunctionalArea

}
where ProjCstLineItm.ProjectInternalID = Task.ProjectInternalID
  and ProjCstLineItm.CompanyCode       = Task.CompanyCode
  and _Ledger.IsLeadingLedger = 'X'
  and ProjCstLineItm.IsCommitment != 'X'
/* Adjustment to have the same cost displayed by P_ProjectCostLineItems with filter IsSettled = 'X'      
   I.e. shows all costs "To Project" and exclude costs "From Project" like Settlement Cost.   
   This adjustment leads to the absence of Settlement Costs in the display. */ 
    and not (      ProjCstLineItm.ControllingDebitCreditCode = 'A' 
              or (       ProjCstLineItm.ControllingDebitCreditCode = 'S' 
                   and ( ProjCstLineItm.BusinessTransactionType = 'KOAO' or ProjCstLineItm.BusinessTransactionType = 'KOAE' ) 
                   and (     PartnerProject = ' '                    and PartnerOrder = ' '           and PartnerSalesDocument = ' ' and PartnerProjectNetwork = ' '   
                             and PartnerProjectNetworkActivity = ' ' and PartnerBusinessProcess = ' ' and PartnerCostObject = ' '
                          or PartnerProject = Project )
                 )
             )        
    and ProjCstLineItm.GlobalCurrency    <> '' 
//  and ProjCstLineItm.ProjectInternalID = Project.ProjectInternalID

group by ProjCstLineItm.SourceLedger, ProjCstLineItm.CompanyCode, SemanticTag.SemanticTag, ProjCstLineItm.ProjectInternalID, ProjCstLineItm.ControllingArea, ProjCstLineItm.BusinessArea, 
          ProjCstLineItm.ProfitCenter, ProjCstLineItm._CalendarDate.YearMonth, ProjCstLineItm.GlobalCurrency, ProjCstLineItm.FunctionalArea, ProjCstLineItm.Plant, Task.ResponsibleCostCenter, Task.ProjectType

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"I_GLACCOUNTLINEITEMRAWDATA",
"I_LEDGER",
"I_WBSELEMENTBASICDATA",
"P_PROJECTSEMTAGACC"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_FUNCTIONALAREA",
"I_LEDGER"
],
"BASE":
[
"I_GLACCOUNTLINEITEMRAWDATA"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/