I_CostElement

DDL: I_COSTELEMENT SQL: IFICOSTELMNT Type: view COMPOSITE

Cost Element

I_CostElement is a Composite CDS View (Dimension) that provides data about "Cost Element" in SAP S/4HANA. It reads from 3 data sources (I_CostElementOnChartOfAccounts, I_CostElementOnControllingArea, P_EffctvCostElmntOnCtrlgArea) and exposes 20 fields with key fields ControllingArea, CostElement. It has 7 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_CostElementOnChartOfAccounts I_CostElementOnChartOfAccounts inner
I_CostElementOnControllingArea I_CostElementOnControllingArea inner
P_EffctvCostElmntOnCtrlgArea P_EffctvCostElmntOnCtrlgArea from

Associations (7)

CardinalityTargetAliasCondition
[0..1] I_ControllingArea _ControllingArea $projection.ControllingArea = _ControllingArea.ControllingArea
[0..*] I_CostElementText _Text $projection.ChartOfAccounts = _Text.ChartOfAccounts and $projection.CostElement = _Text.CostElement
[0..1] I_UnitOfMeasure _UnitOfMeasure $projection.UnitOfMeasure = _UnitOfMeasure.UnitOfMeasure
[0..1] I_FunctionalArea _FunctionalArea $projection.FunctionalArea = _FunctionalArea.FunctionalArea
[0..1] I_ChartOfAccounts _ChartOfAccounts $projection.ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts
[0..1] I_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts $projection.ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts and $projection.CostElement = _GLAccountInChartOfAccounts.GLAccount
[0..1] I_CostElementCategory _CostElementCategory $projection.CostElementCategory = _CostElementCategory.CostElementCategory

Annotations (14)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName IFICOSTELMNT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Cost Element view
Analytics.dataCategory #DIMENSION view
ObjectModel.entityChangeStateId LastChangeDateTime view
ObjectModel.representativeKey CostElement view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #M view
ObjectModel.usageType.dataClass #MIXED view
Metadata.allowExtensions true view

Fields (20)

KeyFieldSource TableSource FieldDescription
KEY ControllingArea I_CostElementOnControllingArea ControllingArea
KEY CostElement I_CostElementOnControllingArea CostElement
ValidityStartDate I_CostElementOnControllingArea ValidityStartDate
ValidityEndDate I_CostElementOnControllingArea ValidityEndDate
CostElementCategory I_CostElementOnControllingArea CostElementCategory
ConsumptionQtyIsRecorded I_CostElementOnControllingArea ConsumptionQtyIsRecorded
UnitOfMeasure I_CostElementOnControllingArea UnitOfMeasure
ChartOfAccounts I_CostElementOnChartOfAccounts ChartOfAccounts
GLAccount
CreationDate I_CostElementOnChartOfAccounts CreationDate
CreatedByUser I_CostElementOnChartOfAccounts CreatedByUser
FunctionalArea I_CostElementOnChartOfAccounts FunctionalArea
LastChangeDateTime I_CostElementOnControllingArea LastChangeDateTime
_ChartOfAccounts _ChartOfAccounts
_GLAccountInChartOfAccounts _GLAccountInChartOfAccounts
_ControllingArea _ControllingArea
_UnitOfMeasure _UnitOfMeasure
_FunctionalArea _FunctionalArea
_CostElementCategory _CostElementCategory
_Text _Text
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'IFICOSTELMNT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Cost Element'
@Analytics.dataCategory: #DIMENSION
@ObjectModel.entityChangeStateId: 'LastChangeDateTime'
@ObjectModel.representativeKey: 'CostElement'
@ObjectModel.usageType: {
  serviceQuality: #C,
  sizeCategory: #M,
  dataClass: #MIXED
}
@Metadata.allowExtensions:true
define view I_CostElement
  as select from P_EffctvCostElmntOnCtrlgArea

    inner join   I_CostElementOnControllingArea on  P_EffctvCostElmntOnCtrlgArea.ControllingArea = I_CostElementOnControllingArea.ControllingArea
                                                and P_EffctvCostElmntOnCtrlgArea.CostElement     = I_CostElementOnControllingArea.CostElement
                                                and P_EffctvCostElmntOnCtrlgArea.ValidityEndDate = I_CostElementOnControllingArea.ValidityEndDate

    inner join   I_CostElementOnChartOfAccounts on  I_CostElementOnControllingArea.ChartOfAccounts = I_CostElementOnChartOfAccounts.ChartOfAccounts
                                                and I_CostElementOnControllingArea.CostElement     = I_CostElementOnChartOfAccounts.CostElement

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

  association [0..*] to I_CostElementText            as _Text                       on  $projection.ChartOfAccounts = _Text.ChartOfAccounts
                                                                                    and $projection.CostElement     = _Text.CostElement

  association [0..1] to I_UnitOfMeasure              as _UnitOfMeasure              on  $projection.UnitOfMeasure = _UnitOfMeasure.UnitOfMeasure

  association [0..1] to I_FunctionalArea             as _FunctionalArea             on  $projection.FunctionalArea = _FunctionalArea.FunctionalArea

  association [0..1] to I_ChartOfAccounts            as _ChartOfAccounts            on  $projection.ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts

  association [0..1] to I_GLAccountInChartOfAccounts as _GLAccountInChartOfAccounts on  $projection.ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts
                                                                                    and $projection.CostElement     = _GLAccountInChartOfAccounts.GLAccount
  association [0..1] to I_CostElementCategory        as _CostElementCategory        on  $projection.CostElementCategory = _CostElementCategory.CostElementCategory

{
      @ObjectModel.foreignKey.association: '_ControllingArea'
  key I_CostElementOnControllingArea.ControllingArea,
  key I_CostElementOnControllingArea.CostElement,

      @Semantics.businessDate.from: true
      I_CostElementOnControllingArea.ValidityStartDate,
      @Semantics.businessDate.to: true
      I_CostElementOnControllingArea.ValidityEndDate,

      @ObjectModel.foreignKey.association: '_CostElementCategory'
      I_CostElementOnControllingArea.CostElementCategory,
      I_CostElementOnControllingArea.ConsumptionQtyIsRecorded,
      @ObjectModel.foreignKey.association: '_UnitOfMeasure'
      I_CostElementOnControllingArea.UnitOfMeasure,

      @ObjectModel.foreignKey.association: '_ChartOfAccounts'
      I_CostElementOnChartOfAccounts.ChartOfAccounts,
      cast (I_CostElementOnChartOfAccounts.CostElement as saknr) as GLAccount,

      @Semantics.businessDate.createdAt: true
      I_CostElementOnChartOfAccounts.CreationDate,
      @Semantics.user.createdBy: true
      I_CostElementOnChartOfAccounts.CreatedByUser,

      @ObjectModel.foreignKey.association: '_FunctionalArea'
      I_CostElementOnChartOfAccounts.FunctionalArea,

      cast (case when I_CostElementOnControllingArea.CostElementCategory = '90' then // 90 = Statistical cost element for balance sheet account, defined in domain KATYP

        'X'
      else
        ''
      end as fac_ce_exists_90)                                   as AcctAssignmentIsStatistical,

      I_CostElementOnControllingArea.LastChangeDateTime,

      _ChartOfAccounts,
      _GLAccountInChartOfAccounts,
      _ControllingArea,
      _UnitOfMeasure,
      _FunctionalArea,
      _CostElementCategory,
      _Text
}    
  
  
  
 /*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COSTELEMENTONCHARTOFACCOUNTS",
"I_COSTELEMENTONCONTROLLINGAREA",
"P_EFFCTVCOSTELMNTONCTRLGAREA"
],
"ASSOCIATED":
[
"I_CHARTOFACCOUNTS",
"I_CONTROLLINGAREA",
"I_COSTELEMENTCATEGORY",
"I_COSTELEMENTTEXT",
"I_FUNCTIONALAREA",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/