I_CostCenterHierarchyNode

DDL: I_COSTCENTERHIERARCHYNODE SQL: IFICOSTCENTERHN Type: view

I_CostCenterHierarchyNode is a CDS View in SAP S/4HANA. It reads from 1 data source (hrrp_node_n) and exposes 18 fields with key fields ControllingArea, CostCenterHierarchy, HierarchyNode, ValidityEndDate. It has 5 associations to related views.

Data Sources (1)

SourceAliasJoin Type
hrrp_node_n hrrp_node_n from

Associations (5)

CardinalityTargetAliasCondition
[0..1] I_ControllingArea _ControllingAreaText $projection.ControllingArea = _ControllingAreaText.ControllingArea
[0..*] I_CostCenterHierarchyNodeT _Text $projection.CostCenterHierarchy = _Text.CostCenterHierarchy and $projection.HierarchyNode = _Text.HierarchyNode and $projection.ControllingArea = _Text.ControllingArea and $projection.CostCenter = ''
[0..*] I_CostCenter _CostCenter $projection.CostCenter = _CostCenter.CostCenter and $projection.ControllingArea = _CostCenter.ControllingArea
[1..1] I_CostCenterHierarchy _Hierarchy $projection.CostCenterHierarchy = _Hierarchy.CostCenterHierarchy and $projection.ControllingArea = _Hierarchy.ControllingArea and $projection.ValidityEndDate = _Hierarchy.ValidityEndDate
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY ControllingArea
KEY CostCenterHierarchy
KEY HierarchyNode hrrp_node_n hrynode
KEY ValidityEndDate
ParentNode hrrp_node_n parnode
HierarchyVersion
ValidityStartDate
CostCenter
SequenceNumber
HierarchyNodeSequence hrrp_node_n hryseqnbr
HierarchyNodeLevel hrrp_node_n hrylevel
NodeType hrrp_node_n nodetype
HierarchyNodeVal hrrp_node_n nodevalue
_Text _Text
_CostCenter _CostCenter
_Hierarchy _Hierarchy
_ControllingArea _ControllingArea
_ControllingAreaText _ControllingAreaText
// Comments:

//

// Key fields: please see comment in view I_CostCenterHierarchy

// Hierarchy type: determined by view I_CostCenterHierarchy, no need to define a filter in this view

//

@EndUserText.label: 'Cost Center Hierarchy Node'
@ObjectModel.representativeKey: 'HierarchyNode'
@VDM.viewType: #BASIC
@AbapCatalog.sqlViewName: 'IFICOSTCENTERHN'
@Hierarchy.parentChild:
{ recurse:          {   parent: 'ParentNode',   child:  'HierarchyNode'   },
  siblingsOrder:    {   by: 'HierarchyNodeSequence',    direction: 'ASC'   },
  directory:        '_Hierarchy'
  }
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.modelingPattern: #ANALYTICAL_DIMENSION
@ObjectModel.supportedCapabilities: [ #CDS_MODELING_DATA_SOURCE, #CDS_MODELING_ASSOCIATION_TARGET, #ANALYTICAL_DIMENSION, #EXTRACTION_DATA_SOURCE]

@ObjectModel: {usageType: {
  dataClass: #MASTER,
  serviceQuality: #A,
  sizeCategory: #XL},
  dataCategory: #HIERARCHY
}

@Analytics.dataExtraction: {enabled:true}

@AccessControl.privilegedAssociations: ['_ControllingAreaText']

define view I_CostCenterHierarchyNode
  as select from hrrp_node_n

  association [0..1] to I_ControllingArea          as _ControllingAreaText on  $projection.ControllingArea = _ControllingAreaText.ControllingArea
  association [0..*] to I_CostCenterHierarchyNodeT as _Text                on  $projection.CostCenterHierarchy = _Text.CostCenterHierarchy
                                                                           and $projection.HierarchyNode       = _Text.HierarchyNode
                                                                           and $projection.ControllingArea     = _Text.ControllingArea
                                                                           and $projection.CostCenter          = '' // just to show that this association is only to be followed if costcenter is blank


  association [0..*] to I_CostCenter               as _CostCenter          on  $projection.CostCenter      = _CostCenter.CostCenter
                                                                           and $projection.ControllingArea = _CostCenter.ControllingArea

  association [1..1] to I_CostCenterHierarchy      as _Hierarchy           on  $projection.CostCenterHierarchy = _Hierarchy.CostCenterHierarchy
                                                                           and $projection.ControllingArea     = _Hierarchy.ControllingArea
                                                                           and $projection.ValidityEndDate     = _Hierarchy.ValidityEndDate

  association [0..1] to I_ControllingArea          as _ControllingArea     on  $projection.ControllingArea = _ControllingArea.ControllingArea

{
      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_ControllingAreaStdVH',
                     element: 'ControllingArea' }
        }]
      @ObjectModel.text.association: '_ControllingAreaText'
      @Consumption.filter: {mandatory : true, selectionType : #SINGLE, multipleSelections : false }
      @ObjectModel.foreignKey.association: '_ControllingArea' //Inserted by VDM CDS Suite Plugin

  key cast( hrrp_node_n.kokrs as fis_kokrs preserving type )         as ControllingArea,
      @Consumption.filter: {mandatory : true, selectionType : #SINGLE, multipleSelections : false }
      @ObjectModel.foreignKey.association: '_Hierarchy'
  key cast(hrrp_node_n.hryid as fis_hryid_cctr preserving type )        as CostCenterHierarchy,
      @ObjectModel.text.association: '_Text'
  key hrrp_node_n.hrynode                              as HierarchyNode,
      @Semantics.businessDate.to: true
      @Consumption.filter: {mandatory : true, selectionType : #SINGLE, multipleSelections : false }
  key cast(hrrp_node_n.hryvalto as fis_datbi preserving type )  as ValidityEndDate,
      hrrp_node_n.parnode                              as ParentNode,
      @VDM.lifecycle.status:    #DEPRECATED
      cast( '000000000000001' as hryversn )                           as HierarchyVersion,
      @Semantics.businessDate.from: true
      cast(hrrp_node_n.hryvalfrom as fis_datab preserving type )  as ValidityStartDate,
      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_CostCenterStdVH',
                     element: 'CostCenter' },
          additionalBinding: [{ localElement: 'ControllingArea',
                                element: 'ControllingArea' }]
        }]
      @ObjectModel.foreignKey.association: '_CostCenter'
      cast ( hrrp_node_n.kostl as fis_kostl preserving type )      as CostCenter,
      @VDM.lifecycle.status:    #DEPRECATED
      @VDM.lifecycle.successor: 'HierarchyNodeSequence'
      concat(hrrp_node_n.hryseqnbr, hrrp_node_n.hrynode) as SequenceNumber, // do not use any longer, use HierarchyNodeSequence

      hrrp_node_n.hryseqnbr                            as HierarchyNodeSequence,
      hrrp_node_n.hrylevel                             as HierarchyNodeLevel,
      hrrp_node_n.nodetype                             as NodeType,
      hrrp_node_n.nodevalue                            as HierarchyNodeVal,

      //@Semantics.businessDate.to: true

      //case when hryid = 'H101/A000/001L' and hrynode = '10010101101' then '20201231' else hrrp_node.hryvalto end as NodeEndDate,

      //@Semantics.businessDate.from: true

      //case when hryid = 'H101/A000/001L' and hrynode = '10010101101' then '20201130' else hrrp_node.hryvalfrom end as NodeStartDate,


      _Text,
      _CostCenter,
      _Hierarchy,
      _ControllingArea,
      @Consumption.hidden: true
      _ControllingAreaText


}
where
      nodetype          <> 'D'
  and hrrp_node_n.hrytyp =  '0101';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"HRRP_NODE_N"
],
"ASSOCIATED":
[
"I_CONTROLLINGAREA",
"I_COSTCENTER",
"I_COSTCENTERHIERARCHY",
"I_COSTCENTERHIERARCHYNODET"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/