I_CostElementTP

DDL: I_COSTELEMENTTP SQL: ICOELTP Type: view TRANSACTIONAL

G/L Account in CtrlgArea (Draft 2.0)

I_CostElementTP is a Transactional CDS View that provides data about "G/L Account in CtrlgArea (Draft 2.0)" in SAP S/4HANA. It reads from 2 data sources (P_GLAcctNotMarkForDeletion, I_CostElement) and exposes 20 fields with key fields ChartOfAccounts, GLAccount, ControllingArea. It has 5 associations to related views.

Data Sources (2)

SourceAliasJoin Type
P_GLAcctNotMarkForDeletion _PostableGLAccount left_outer
I_CostElement I_CostElement from

Associations (5)

CardinalityTargetAliasCondition
[1..1] I_GLAcctInChtAcctsTP _GLAcctInChtAcctsTP $projection.ChartOfAccounts = _GLAcctInChtAcctsTP.ChartOfAccounts and $projection.GLAccount = _GLAcctInChtAcctsTP.GLAccount
[0..1] I_ControllingArea _ControllingArea $projection.ControllingAreaForEdit = _ControllingArea.ControllingArea and $projection.ChartOfAccountsForEdit = _ControllingArea.ChartOfAccounts
[0..1] I_CostElementCategory _CostElementCategory $projection.CostElementCategory = _CostElementCategory.CostElementCategory
[0..1] I_UnitOfMeasure _UnitOfMeasure $projection.UnitOfMeasure = _UnitOfMeasure.UnitOfMeasure
[0..1] I_FunctionalArea _FunctionalArea $projection.FunctionalArea = _FunctionalArea.FunctionalArea

Annotations (12)

NameValueLevelField
AbapCatalog.compiler.compareFilter true view
AbapCatalog.sqlViewName ICOELTP view
AccessControl.authorizationCheck #CHECK view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label G/L Account in CtrlgArea (Draft 2.0) view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.writeDraftPersistence CSKB_DRAFT_20 view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
Search.searchable true view
VDM.viewType #TRANSACTIONAL view

Fields (20)

KeyFieldSource TableSource FieldDescription
KEY ChartOfAccounts I_CostElement ChartOfAccounts
KEY GLAccount I_CostElement GLAccount
KEY ControllingArea I_CostElement ControllingArea
ControllingAreaForEdit I_CostElement ControllingArea
ChartOfAccountsForEdit _GLAcctInChtAcctsTP ChartOfAccounts
GLAccountForEdit _GLAcctInChtAcctsTP GLAccountForEdit
ValidityStartDate ValidityStartDate
ValidityEndDate ValidityEndDate
CostElementCategory CostElementCategory
ConsumptionQtyIsRecorded ConsumptionQtyIsRecorded
UnitOfMeasure UnitOfMeasure
CreationDate CreationDate
CreatedByUser CreatedByUser
FunctionalArea FunctionalArea
AcctAssignmentIsStatistical AcctAssignmentIsStatistical
_ControllingArea _ControllingArea
_CostElementCategory _CostElementCategory
_FunctionalArea _FunctionalArea
_UnitOfMeasure _UnitOfMeasure
_GLAcctInChtAcctsTP _GLAcctInChtAcctsTP
@AbapCatalog.compiler.compareFilter: true  
@AbapCatalog.sqlViewName: 'ICOELTP' 
@AccessControl.authorizationCheck: #CHECK
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'G/L Account in CtrlgArea (Draft 2.0)'
@Metadata.ignorePropagatedAnnotations: true  
@ObjectModel: { 
  semanticKey: ['ChartOfAccounts', 'GLAccount', 'ControllingArea'], 
  //transactionalProcessingEnabled: true,  

  writeDraftPersistence: 'CSKB_DRAFT_20',   
  createEnabled, 
  deleteEnabled,   
  updateEnabled,
  usageType: {
    dataClass: #MIXED,
    serviceQuality: #D,    
    sizeCategory: #XL 
  }  
}  
@Search.searchable: true
@VDM.viewType: #TRANSACTIONAL    

define view I_CostElementTP          
  as select from I_CostElement
  left outer join P_GLAcctNotMarkForDeletion as _PostableGLAccount on  I_CostElement.ChartOfAccounts = _PostableGLAccount.ChartOfAccounts 
                                                                   and I_CostElement.ControllingArea = _PostableGLAccount.ControllingArea 
                                                                   and I_CostElement.GLAccount = _PostableGLAccount.GLAccount
  /* BO node associations */
  association [1..1] to I_GLAcctInChtAcctsTP  as _GLAcctInChtAcctsTP  on  $projection.ChartOfAccounts = _GLAcctInChtAcctsTP.ChartOfAccounts
                                                                      and $projection.GLAccount       = _GLAcctInChtAcctsTP.GLAccount

  /* Associations */
  association [0..1] to I_ControllingArea     as _ControllingArea     on  $projection.ControllingAreaForEdit = _ControllingArea.ControllingArea
                                                                      and $projection.ChartOfAccountsForEdit = _ControllingArea.ChartOfAccounts

  association [0..1] to I_CostElementCategory as _CostElementCategory on  $projection.CostElementCategory = _CostElementCategory.CostElementCategory

  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..*] to I_GLAcctTextTP        as _Text                on  $projection.ChartOfAccounts = _Text.ChartOfAccounts

//                                                                      and $projection.GLAccount       = _Text.GLAccount

{
  key I_CostElement.ChartOfAccounts,
      // not readonly because when created we must copy value from parent

  key I_CostElement.GLAccount, 
      @ObjectModel.readOnly: true
  key I_CostElement.ControllingArea,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Search.ranking: #HIGH
      //@ObjectModel.foreignKey.association: '_ControllingArea'

      @ObjectModel.mandatory: true
      I_CostElement.ControllingArea                                 as ControllingAreaForEdit,

      @ObjectModel.readOnly: true
      _GLAcctInChtAcctsTP.ChartOfAccounts             as ChartOfAccountsForEdit, // Alias of ChartOfAccounts for active; Value to be updated when root node updated for draft


      @ObjectModel.readOnly: true
      _GLAcctInChtAcctsTP.GLAccountForEdit, // Alias of GLAccount for active; Value to be updated when root node updated for draft (via BO determination triggered by UPDATE on root)

      @Semantics.businessDate.from: true
      @ObjectModel.readOnly: true // should not be editable by user

      ValidityStartDate,
      @Semantics.businessDate.to: true
      @ObjectModel.readOnly: true
      ValidityEndDate,
      @ObjectModel.foreignKey.association: '_CostElementCategory'
      @ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
      CostElementCategory,
      @ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
      ConsumptionQtyIsRecorded,
      @ObjectModel.foreignKey.association: '_UnitOfMeasure'
      @ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
      UnitOfMeasure,
      @Semantics.systemDate.createdAt: true
      CreationDate,
      @Semantics.user.createdBy: true
      CreatedByUser,
      @ObjectModel.foreignKey.association: '_FunctionalArea'
      FunctionalArea,
      //@ObjectModel.readOnly: 'EXTERNAL_CALCULATION' // dynamic field control

      AcctAssignmentIsStatistical, // though value is calculated, the field must be updatable

      @ObjectModel.readOnly: true
      cast(case when _PostableGLAccount.AccountIsMarkedForDeletion is null then 'X'
      else _PostableGLAccount.AccountIsMarkedForDeletion 
      end as xloev ) as AccountIsMarkedForDeletion,
      //cast ('' as xloev )                             as AccountIsMarkedForDeletion, // Always FALSE for active entity; For draft entity, TRUE if all relevant CompanyCode assignments are MarkedForDelete


      /* Associations */
      _ControllingArea,
      _CostElementCategory,
      _FunctionalArea,
      //_Text,

      _UnitOfMeasure,
      @ObjectModel.association.type: [#TO_COMPOSITION_PARENT, #TO_COMPOSITION_ROOT]
      _GLAcctInChtAcctsTP
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COSTELEMENT",
"I_GLACCTINCHTACCTSTP",
"P_GLACCTNOTMARKFORDELETION"
],
"ASSOCIATED":
[
"I_CONTROLLINGAREA",
"I_COSTELEMENTCATEGORY",
"I_FUNCTIONALAREA",
"I_GLACCTINCHTACCTSTP",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/