P_ProfitCenterGroupNode

DDL: P_PROFITCENTERGROUPNODE SQL: PWUPCGRPNODE Type: view COMPOSITE

P_ProfitCenterGroupNode is a Composite CDS View in SAP S/4HANA. It reads from 2 data sources (I_Setnode, P_ProfitCenterGroupLeaf) and exposes 24 fields with key fields SetClass, SetSubClass, SetID, SetLineNumber, SetSubClass. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_Setnode I_Setnode from
P_ProfitCenterGroupLeaf PCGLeaf union_all

Parameters (2)

NameTypeDefault
P_ControllingArea kokrs
P_ProfitCenter prctr

Associations (2)

CardinalityTargetAliasCondition
[0..*] P_ProfitCenterGroupNode _parent $projection.ChildSetClass = _parent.SetClass and $projection.ChildSetSubClass = _parent.SetSubClass and $projection.ChildSetID = _parent.SetID
[0..*] P_ProfitCenterGroupNode _Parent $projection.ChildSetClass = _Parent.SetClass and $projection.ChildSetSubClass = _Parent.SetSubClass and $projection.ChildSetID = _Parent.SetID

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PWUPCGRPNODE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #COMPOSITE view

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY SetClass I_Setnode SetClass
KEY SetSubClass I_Setnode SetSubClass
KEY SetID I_Setnode SetID
KEY SetLineNumber I_Setnode SetLineNumber
ChildSetClass ChildSetClass
ChildSetSubClass ChildSetSubClass
ChildSetID ChildSetID
SetNodeIsLeaf SetNodeIsLeaf
SetRangeFromValue SetRangeFromValue
SetRangeToValue SetRangeToValue
_parent _parent
SetClass
KEY SetSubClass P_ProfitCenterGroupLeaf SetSubClass
KEY SetID P_ProfitCenterGroupLeaf SetID
KEY SetLineNumber P_ProfitCenterGroupLeaf SetLineNumber
KEY LeafSetLineNumber P_ProfitCenterGroupLeaf SetLineNumber
ChildSetClass P_ProfitCenterGroupLeaf SetClass
ChildSetSubClass P_ProfitCenterGroupLeaf SetSubClass
ChildSetID P_ProfitCenterGroupLeaf SetID
SetNodeIsLeaf SetNodeIsLeaf
SetRangeFromValue SetRangeFromValue
SetRangeToValue SetRangeToValue
_Parent _Parent
_Set P_ProfitCenterGroupLeaf _Set
@AbapCatalog.sqlViewName: 'PWUPCGRPNODE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: {
  private: true,
  viewType: #COMPOSITE
}
define view P_ProfitCenterGroupNode
  with parameters
    P_ControllingArea : kokrs,
    P_ProfitCenter : prctr
  as select from I_Setnode
    left outer to one join P_ProfitCenterGroupLeaf as pcgleaf
      on I_Setnode.ChildSetClass       = pcgleaf.SetClass
        and I_Setnode.ChildSetSubClass = pcgleaf.SetSubClass
        and I_Setnode.ChildSetID       = pcgleaf.SetID
        and pcgleaf.SetRangeFromValue <= :P_ProfitCenter
        and pcgleaf.SetRangeToValue   >= :P_ProfitCenter
    association [0..*] to P_ProfitCenterGroupNode as _parent
      on $projection.ChildSetClass       = _parent.SetClass
        and $projection.ChildSetSubClass = _parent.SetSubClass
        and $projection.ChildSetID       = _parent.SetID
{
  //i_setnode

  key I_Setnode.SetClass,
  key I_Setnode.SetSubClass,
  key I_Setnode.SetID,
  key I_Setnode.SetLineNumber,
  key pcgleaf.SetLineNumber as leafsetlinenumber,
  
  ChildSetClass,
  ChildSetSubClass,
  ChildSetID,
  SetNodeIsLeaf,
  SetRangeFromValue,
  SetRangeToValue,

  /* associations */
  _parent,

  //i_setnode

  i_setnode._Set
}
where I_Setnode.SetClass = '0106'
  and ( I_Setnode.SetSubClass = $parameters.P_ControllingArea
    or I_Setnode.ChildSetSubClass = $parameters.P_ControllingArea )
    
// add leaves those stand as root themselves, therefore they are not a part of the setnode table

union all
  select from P_ProfitCenterGroupLeaf as PCGLeaf
    left outer to one join I_Setnode
      on PCGLeaf.SetClass = I_Setnode.ChildSetClass
        and PCGLeaf.SetSubClass = I_Setnode.ChildSetSubClass
        and PCGLeaf.SetID = I_Setnode.ChildSetID
    association [0..*] to P_ProfitCenterGroupNode as _Parent
      on $projection.ChildSetClass       = _Parent.SetClass
        and $projection.ChildSetSubClass = _Parent.SetSubClass
        and $projection.ChildSetID       = _Parent.SetID
{
  //I_Setnode

  key PCGLeaf.SetClass,
  key PCGLeaf.SetSubClass,
  key PCGLeaf.SetID,
  key PCGLeaf.SetLineNumber,
  key PCGLeaf.SetLineNumber as LeafSetLineNumber,
  
  PCGLeaf.SetClass as ChildSetClass,
  PCGLeaf.SetSubClass as ChildSetSubClass,
  PCGLeaf.SetID as ChildSetID,
  SetNodeIsLeaf,
  SetRangeFromValue,
  SetRangeToValue,

  /* Associations */
  _Parent,

  //I_Setnode

  PCGLeaf._Set
}
where I_Setnode.ChildSetClass is null
  and PCGLeaf.SetClass = '0106'
  and PCGLeaf.SetSubClass = $parameters.P_ControllingArea
  and PCGLeaf.SetRangeFromValue <= :P_ProfitCenter
  and PCGLeaf.SetRangeToValue   >= :P_ProfitCenter
  
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SETNODE",
"P_PROFITCENTERGROUPLEAF"
],
"ASSOCIATED":
[
"I_SETHEADER"
],
"BASE":
[
"I_SETNODE"
],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/