P_ProjCmtmtCostLineItms

DDL: P_PROJCMTMTCOSTLINEITMS SQL: PPRJBYCMTMTCST Type: view COMPOSITE

P_ProjCmtmtCostLineItms is a Composite CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 197 fields with key fields SourceLedger, Ledger, CompanyCode, FiscalYear, AccountingDocument.

Data Sources (6)

SourceAliasJoin Type
I_ProjectBasicData _Project from
I_ProjectBasicData _Project union_all
P_PROJECTSEMTAGACC _SemanticTag inner
P_PROJECTSEMTAGACC _SemanticTag inner
I_LedgerSourceLedger _SourceLedger inner
I_LedgerSourceLedger _SourceLedger inner

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PPRJBYCMTMTCST view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AbapCatalog.buffering.status #NOT_ALLOWED view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (197)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger _ProjCstLineItm SourceLedger
KEY Ledger I_LedgerSourceLedger Ledger
KEY CompanyCode _ProjCstLineItm CompanyCode
KEY FiscalYear _ProjCstLineItm FiscalYear
KEY AccountingDocument _ProjCstLineItm AccountingDocument
FinancialPlanningReqTransSqnc
FinancialPlanningDataPacket
ActualPlanJournalEntryItem
LedgerFiscalYear _ProjCstLineItm LedgerFiscalYear
ActualPlanCode
LedgerGLLineItem _ProjCstLineItm LedgerGLLineItem
FinancialPlanningEntryItem
AccountingDocCreatedByUser _ProjCstLineItm AccountingDocCreatedByUser
BusinessArea _ProjCstLineItm BusinessArea
PartnerOrder _ProjCstLineItm PartnerOrder
OrderID _ProjCstLineItm OrderID
PartnerOrderCategory _ProjCstLineItm PartnerOrderCategory
PartnerWBSElement
PartnerProject
BusinessTransactionType _ProjCstLineItm BusinessTransactionType
DebitCreditCode _ProjCstLineItm DebitCreditCode
ControllingDebitCreditCode _ProjCstLineItm ControllingDebitCreditCode
WBSElement _WBS WBSElementExternalID
Project I_ProjectBasicData ProjectExternalID
ProjectInternalID I_ProjectBasicData ProjectInternalID
WBSElementInternalID _ProjCstLineItm WBSElementInternalID
ControllingArea _ProjCstLineItm ControllingArea
GLAccount _ProjCstLineItm GLAccount
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
ChartOfAccounts _ProjCstLineItm ChartOfAccounts
CostCenter _ProjCstLineItm CostCenter
ProfitCenter _ProjCstLineItm ProfitCenter
CreationDate _ProjCstLineItm CreationDate
FunctionalArea _ProjCstLineItm FunctionalArea
CostCtrActivityType _ProjCstLineItm CostCtrActivityType
ControllingObjectCurrency _ProjCstLineItm ControllingObjectCurrency
AmountInObjectCurrency _ProjCstLineItm AmountInObjectCurrency
TransactionCurrency _ProjCstLineItm TransactionCurrency
AmountInTransactionCurrency _ProjCstLineItm AmountInTransactionCurrency
CompanyCodeCurrency _ProjCstLineItm CompanyCodeCurrency
AmountInCompanyCodeCurrency _ProjCstLineItm AmountInCompanyCodeCurrency
GlobalCurrency _ProjCstLineItm GlobalCurrency
AmountInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
FunctionalCurrency _ProjCstLineItm FunctionalCurrency
CmtmtAmountInFunctionalCrcy _ProjCstLineItm AmountInFunctionalCurrency
FreeDefinedCurrency1 _ProjCstLineItm FreeDefinedCurrency1
AmountInFreeDefinedCurrency1 _ProjCstLineItm AmountInFreeDefinedCurrency1
FreeDefinedCurrency2 _ProjCstLineItm FreeDefinedCurrency2
AmountInFreeDefinedCurrency2 _ProjCstLineItm AmountInFreeDefinedCurrency2
FreeDefinedCurrency3 _ProjCstLineItm FreeDefinedCurrency3
AmountInFreeDefinedCurrency3 _ProjCstLineItm AmountInFreeDefinedCurrency3
FreeDefinedCurrency4 _ProjCstLineItm FreeDefinedCurrency4
AmountInFreeDefinedCurrency4 _ProjCstLineItm AmountInFreeDefinedCurrency4
FreeDefinedCurrency5 _ProjCstLineItm FreeDefinedCurrency5
AmountInFreeDefinedCurrency5 _ProjCstLineItm AmountInFreeDefinedCurrency5
FreeDefinedCurrency6 _ProjCstLineItm FreeDefinedCurrency6
AmountInFreeDefinedCurrency6 _ProjCstLineItm AmountInFreeDefinedCurrency6
FreeDefinedCurrency7 _ProjCstLineItm FreeDefinedCurrency7
AmountInFreeDefinedCurrency7 _ProjCstLineItm AmountInFreeDefinedCurrency7
FreeDefinedCurrency8 _ProjCstLineItm FreeDefinedCurrency8
AmountInFreeDefinedCurrency8 _ProjCstLineItm AmountInFreeDefinedCurrency8
CmtmtCostInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
CmtmtCostInProjCrcy _ProjCstLineItm AmountInObjectCurrency
CmtmtCostInFreeDefinedCrcy1 _ProjCstLineItm AmountInFreeDefinedCurrency1
CmtmtCostInFreeDefinedCrcy2 _ProjCstLineItm AmountInFreeDefinedCurrency2
CmtmtCostInFreeDefinedCrcy3 _ProjCstLineItm AmountInFreeDefinedCurrency3
CmtmtCostInFreeDefinedCrcy4 _ProjCstLineItm AmountInFreeDefinedCurrency4
CmtmtCostInFreeDefinedCrcy5 _ProjCstLineItm AmountInFreeDefinedCurrency5
CmtmtCostInFreeDefinedCrcy6 _ProjCstLineItm AmountInFreeDefinedCurrency6
CmtmtCostInFreeDefinedCrcy7 _ProjCstLineItm AmountInFreeDefinedCurrency7
CmtmtCostInFreeDefinedCrcy8 _ProjCstLineItm AmountInFreeDefinedCurrency8
SourceReferenceDocumentType _ProjCstLineItm SourceReferenceDocumentType
SourceLogicalSystem _ProjCstLineItm SourceLogicalSystem
SourceReferenceDocumentCntxt _ProjCstLineItm SourceReferenceDocumentCntxt
SourceReferenceDocument _ProjCstLineItm SourceReferenceDocument
SourceReferenceDocumentItem _ProjCstLineItm SourceReferenceDocumentItem
SourceReferenceDocSubitem _ProjCstLineItm SourceReferenceDocSubitem
IsCommitment _ProjCstLineItm IsCommitment
IsSettled
PlanningCategory
PostingDate _ProjCstLineItm PostingDate
DocumentDate _ProjCstLineItm DocumentDate
FiscalPeriod _ProjCstLineItm FiscalPeriod
FiscalYearPeriod _ProjCstLineItm FiscalYearPeriod
FiscalYearVariant _ProjCstLineItm FiscalYearVariant
MaintenanceOrderIsSelected
SemanticTag P_PROJECTSEMTAGACC SemanticTag
WBSElementProfitCenter _WBS ProfitCenter
WBSDescription _WBS WBSDescription
ProjectObjectNode _WBS WBSElementObject
ResponsibleCostCenter _WBS ResponsibleCostCenter
ProjectType _WBS ProjectType
ProjectDescription I_ProjectBasicData ProjectDescription
ProjectProfileCode I_ProjectBasicData ProjectProfileCode
ProjectObject I_ProjectBasicData ProjectObject
AvailabilityControlProfile I_ProjectBasicData AvailabilityControlProfile
AvailabilityControlIsActive I_ProjectBasicData AvailabilityControlIsActive
AvailyCtrlTimeRangeType
SourceLedger
KEY Ledger I_LedgerSourceLedger Ledger
KEY CompanyCode _ProjCstLineItm CompanyCode
KEY FiscalYear _ProjCstLineItm FiscalYear
KEY AccountingDocument _ProjCstLineItm AccountingDocument
FinancialPlanningReqTransSqnc
FinancialPlanningDataPacket
ActualPlanJournalEntryItem
LedgerFiscalYear _ProjCstLineItm LedgerFiscalYear
ActualPlanCode
LedgerGLLineItem _ProjCstLineItm LedgerGLLineItem
FinancialPlanningEntryItem
AccountingDocCreatedByUser _ProjCstLineItm AccountingDocCreatedByUser
BusinessArea _ProjCstLineItm BusinessArea
PartnerOrder _ProjCstLineItm PartnerOrder
OrderID _ProjCstLineItm OrderID
PartnerOrderCategory _ProjCstLineItm PartnerOrderCategory
PartnerWBSElement _ProjCstLineItm PartnerWBSElement
PartnerProject _ProjCstLineItm PartnerProject
BusinessTransactionType _ProjCstLineItm BusinessTransactionType
DebitCreditCode _ProjCstLineItm DebitCreditCode
ControllingDebitCreditCode _ProjCstLineItm ControllingDebitCreditCode
WBSElement _WBS WBSElementExternalID
Project I_ProjectBasicData ProjectExternalID
ProjectInternalID I_ProjectBasicData ProjectInternalID
WBSElementInternalID _Orders WBSElementInternalID
ControllingArea _ProjCstLineItm ControllingArea
GLAccount _ProjCstLineItm GLAccount
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
ChartOfAccounts _ProjCstLineItm ChartOfAccounts
CostCenter _ProjCstLineItm CostCenter
ProfitCenter _ProjCstLineItm ProfitCenter
CreationDate _ProjCstLineItm CreationDate
FunctionalArea _ProjCstLineItm FunctionalArea
CostCtrActivityType _ProjCstLineItm CostCtrActivityType
ControllingObjectCurrency _ProjCstLineItm ControllingObjectCurrency
AmountInObjectCurrency _ProjCstLineItm AmountInObjectCurrency
TransactionCurrency _ProjCstLineItm TransactionCurrency
AmountInTransactionCurrency _ProjCstLineItm AmountInTransactionCurrency
CompanyCodeCurrency _ProjCstLineItm CompanyCodeCurrency
AmountInCompanyCodeCurrency _ProjCstLineItm AmountInCompanyCodeCurrency
GlobalCurrency _ProjCstLineItm GlobalCurrency
AmountInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
FunctionalCurrency _ProjCstLineItm FunctionalCurrency
CmtmtAmountInFunctionalCrcy _ProjCstLineItm AmountInFunctionalCurrency
FreeDefinedCurrency1 _ProjCstLineItm FreeDefinedCurrency1
AmountInFreeDefinedCurrency1 _ProjCstLineItm AmountInFreeDefinedCurrency1
FreeDefinedCurrency2 _ProjCstLineItm FreeDefinedCurrency2
AmountInFreeDefinedCurrency2 _ProjCstLineItm AmountInFreeDefinedCurrency2
FreeDefinedCurrency3 _ProjCstLineItm FreeDefinedCurrency3
AmountInFreeDefinedCurrency3 _ProjCstLineItm AmountInFreeDefinedCurrency3
FreeDefinedCurrency4 _ProjCstLineItm FreeDefinedCurrency4
AmountInFreeDefinedCurrency4 _ProjCstLineItm AmountInFreeDefinedCurrency4
FreeDefinedCurrency5 _ProjCstLineItm FreeDefinedCurrency5
AmountInFreeDefinedCurrency5 _ProjCstLineItm AmountInFreeDefinedCurrency5
FreeDefinedCurrency6 _ProjCstLineItm FreeDefinedCurrency6
AmountInFreeDefinedCurrency6 _ProjCstLineItm AmountInFreeDefinedCurrency6
FreeDefinedCurrency7 _ProjCstLineItm FreeDefinedCurrency7
AmountInFreeDefinedCurrency7 _ProjCstLineItm AmountInFreeDefinedCurrency7
FreeDefinedCurrency8 _ProjCstLineItm FreeDefinedCurrency8
AmountInFreeDefinedCurrency8 _ProjCstLineItm AmountInFreeDefinedCurrency8
CmtmtCostInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
CmtmtCostInProjCrcy _ProjCstLineItm AmountInObjectCurrency
CmtmtCostInFreeDefinedCrcy1 _ProjCstLineItm AmountInFreeDefinedCurrency1
CmtmtCostInFreeDefinedCrcy2 _ProjCstLineItm AmountInFreeDefinedCurrency2
CmtmtCostInFreeDefinedCrcy3 _ProjCstLineItm AmountInFreeDefinedCurrency3
CmtmtCostInFreeDefinedCrcy4 _ProjCstLineItm AmountInFreeDefinedCurrency4
CmtmtCostInFreeDefinedCrcy5 _ProjCstLineItm AmountInFreeDefinedCurrency5
CmtmtCostInFreeDefinedCrcy6 _ProjCstLineItm AmountInFreeDefinedCurrency6
CmtmtCostInFreeDefinedCrcy7 _ProjCstLineItm AmountInFreeDefinedCurrency7
CmtmtCostInFreeDefinedCrcy8 _ProjCstLineItm AmountInFreeDefinedCurrency8
SourceReferenceDocumentType _ProjCstLineItm SourceReferenceDocumentType
SourceLogicalSystem _ProjCstLineItm SourceLogicalSystem
SourceReferenceDocumentCntxt _ProjCstLineItm SourceReferenceDocumentCntxt
SourceReferenceDocument _ProjCstLineItm SourceReferenceDocument
SourceReferenceDocumentItem _ProjCstLineItm SourceReferenceDocumentItem
SourceReferenceDocSubitem _ProjCstLineItm SourceReferenceDocSubitem
IsCommitment _ProjCstLineItm IsCommitment
IsSettled
PlanningCategory
PostingDate _ProjCstLineItm PostingDate
DocumentDate _ProjCstLineItm DocumentDate
FiscalPeriod _ProjCstLineItm FiscalPeriod
FiscalYearPeriod _ProjCstLineItm FiscalYearPeriod
FiscalYearVariant _ProjCstLineItm FiscalYearVariant
MaintenanceOrderIsSelected
SemanticTag P_PROJECTSEMTAGACC SemanticTag
WBSElementProfitCenter _WBS ProfitCenter
WBSDescription _WBS WBSDescription
ProjectObjectNode _ProjCstLineItm OrderID
ResponsibleCostCenter _WBS ResponsibleCostCenter
ProjectType _WBS ProjectType
ProjectDescription I_ProjectBasicData ProjectDescription
ProjectProfileCode I_ProjectBasicData ProjectProfileCode
ProjectObject I_ProjectBasicData ProjectObject
AvailabilityControlProfile I_ProjectBasicData AvailabilityControlProfile
AvailabilityControlIsActive I_ProjectBasicData AvailabilityControlIsActive
AvailyCtrlTimeRangeType
BudgetCurrencyRole
@AbapCatalog.sqlViewName: 'PPRJBYCMTMTCST'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AbapCatalog.buffering.status: #NOT_ALLOWED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #D
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_ProjCmtmtCostLineItms
  // CE2308 - Optimization of existing selections - Start

  as select from I_ProjectBasicData          as _Project
  left outer to many join I_WBSElementBasicData      as _WBS            on  _Project.ProjectInternalID    = _WBS.ProjectInternalID
  left outer to many join I_GLAccountLineItemRawData as _ProjCstLineItm on  ( _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
                                                                      or _ProjCstLineItm.Project        = _Project.Project )
                                                                    and _WBS.ProjectInternalID            = _Project.ProjectInternalID
                                                                    and _ProjCstLineItm.WBSElementInternalID         = _WBS.WBSElementInternalID
  inner join   I_LedgerSourceLedger       as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
  inner join   P_PROJECTSEMTAGACC         as _SemanticTag  on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea
                                                             and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount
                                                             and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
  // CE2308 - Optimization of existing selections - End

  /*                                                           
  as select from I_GLAccountLineItemRawData as _ProjCstLineItm
    inner join   I_LedgerSourceLedger       as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
    inner join   I_WBSElementBasicData      as _WBS          on  _ProjCstLineItm.ProjectInternalID    = _WBS.ProjectInternalID
                                                             and _ProjCstLineItm.WBSElementInternalID = _WBS.WBSElementInternalID

    inner join   I_ProjectBasicData         as _Project      on  _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
                                                             and _WBS.ProjectInternalID            = _Project.ProjectInternalID
    inner join   P_PROJECTSEMTAGACC         as _SemanticTag  on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea
                                                             and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount
                                                             and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
  */
{
  key _ProjCstLineItm.SourceLedger, //key

  key _SourceLedger.Ledger, //key

  key _ProjCstLineItm.CompanyCode, //key

  key _ProjCstLineItm.FiscalYear,
  key _ProjCstLineItm.AccountingDocument, //key

      cast(cast( '00000000000000000000000' as abap.numc (23)) as fis_fp_request_tsn ) as FinancialPlanningReqTransSqnc,
      cast(cast( '000000' as abap.numc (6)) as fis_fp_data_packet )                   as FinancialPlanningDataPacket,
      // field ActualPlanJournalEntryItem required for representative key definition

      cast( _ProjCstLineItm.LedgerGLLineItem as fis_act_pln_docln)                    as ActualPlanJournalEntryItem,

      _ProjCstLineItm.LedgerFiscalYear,
      cast(cast( 'A' as abap.char (1)) as fis_actual_plan_code)                       as ActualPlanCode,
      _ProjCstLineItm.LedgerGLLineItem,
      cast(cast( 0 as abap.int4 ) as fis_fp_entry_item )                              as FinancialPlanningEntryItem,
      _ProjCstLineItm.AccountingDocCreatedByUser,
      _ProjCstLineItm.BusinessArea,
      //Sending Partner fields

      _ProjCstLineItm.PartnerOrder,
      _ProjCstLineItm.OrderID,
      _ProjCstLineItm.PartnerOrderCategory,

      // S/4 Hana CE2302- Field Deprecation - Begin

      // _ProjCstLineItm.PartnerWBSElement,

      _ProjCstLineItm._PartnerWBSElementBasicData.WBSElementExternalID                as PartnerWBSElement,

      // _ProjCstLineItm.PartnerProject,

      _ProjCstLineItm._PartnerProjectBasicData.ProjectExternalID                      as PartnerProject,
      // S/4 Hana CE2302- Field Deprecation - End


      _ProjCstLineItm.BusinessTransactionType,
      _ProjCstLineItm.DebitCreditCode,
      _ProjCstLineItm.ControllingDebitCreditCode,
      ///  _WBSElementBasicData.WBSElementObject as ProjectObjectNode,

      _WBS.WBSElementExternalID                                                       as WBSElement,
      _Project.ProjectExternalID                                                      as Project,
      _Project.ProjectInternalID,
      _ProjCstLineItm.WBSElementInternalID,
      _ProjCstLineItm.ControllingArea,
      _ProjCstLineItm.GLAccount,
      _SemanticTag.GLAccountHierarchy,
      _ProjCstLineItm.ChartOfAccounts,
      _ProjCstLineItm.CostCenter,
      _ProjCstLineItm.ProfitCenter,
      _ProjCstLineItm.CreationDate,
      _ProjCstLineItm.FunctionalArea,
      _ProjCstLineItm.CostCtrActivityType,
      @Semantics.currencyCode: true
      _ProjCstLineItm.ControllingObjectCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'ControllingObjectCurrency'
      _ProjCstLineItm.AmountInObjectCurrency,

      @Semantics.currencyCode:true
      _ProjCstLineItm.TransactionCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
      _ProjCstLineItm.AmountInTransactionCurrency,

      @Semantics.currencyCode:true
      _ProjCstLineItm.CompanyCodeCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
      _ProjCstLineItm.AmountInCompanyCodeCurrency,

      @Semantics.currencyCode:true
      _ProjCstLineItm.GlobalCurrency,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      _ProjCstLineItm.AmountInGlobalCurrency,

      //S/4HANA CE2108 - Inclusion of Functional Currency -Begin

      @Semantics.currencyCode: true
      _ProjCstLineItm.FunctionalCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      _ProjCstLineItm.AmountInFunctionalCurrency                                      as CmtmtAmountInFunctionalCrcy,

      //S/4HANA CE2108 - Inclusion of Functional Currency -End


      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency1,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency1,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency2,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency2,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency3,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency3,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency4,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency4,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency5,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency5,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency6,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency6,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency7,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency7,

      @Semantics.currencyCode:true
      _ProjCstLineItm.FreeDefinedCurrency8,
      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency8,

      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
      @DefaultAggregation: #SUM
      _ProjCstLineItm.AmountInGlobalCurrency                                          as CmtmtCostInGlobalCurrency,

      @Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
      @DefaultAggregation: #SUM
      _ProjCstLineItm.AmountInObjectCurrency                                          as CmtmtCostInProjCrcy,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency1                                    as CmtmtCostInFreeDefinedCrcy1,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency2                                    as CmtmtCostInFreeDefinedCrcy2,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency3                                    as CmtmtCostInFreeDefinedCrcy3,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency4                                    as CmtmtCostInFreeDefinedCrcy4,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency5                                    as CmtmtCostInFreeDefinedCrcy5,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency6                                    as CmtmtCostInFreeDefinedCrcy6,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency7                                    as CmtmtCostInFreeDefinedCrcy7,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
      _ProjCstLineItm.AmountInFreeDefinedCurrency8                                    as CmtmtCostInFreeDefinedCrcy8,

      _ProjCstLineItm.SourceReferenceDocumentType,
      _ProjCstLineItm.SourceLogicalSystem,
      _ProjCstLineItm.SourceReferenceDocumentCntxt,
      _ProjCstLineItm.SourceReferenceDocument,
      _ProjCstLineItm.SourceReferenceDocumentItem,
      _ProjCstLineItm.SourceReferenceDocSubitem,
      _ProjCstLineItm.IsCommitment,
      'X'                                                                             as IsSettled,
      cast( cast( 'CMTMT' as abap.char( 10  )) as fcom_category)                      as PlanningCategory,
      _ProjCstLineItm.PostingDate,
      _ProjCstLineItm.DocumentDate,
      _ProjCstLineItm.FiscalPeriod,
      _ProjCstLineItm.FiscalYearPeriod,
      _ProjCstLineItm.FiscalYearVariant,
      //S/4HANA CE2108 - Maintenance Order enablement-Begin

      cast( 'X' as boolean  )                                                         as MaintenanceOrderIsSelected,
      //S/4HANA CE2108 - Maintenance Order enablement-End

      _SemanticTag.SemanticTag,
      _WBS.ProfitCenter                                                               as WBSElementProfitCenter,
      _WBS.WBSDescription                                                             as WBSDescription,
      _WBS.WBSElementObject                                                           as ProjectObjectNode,
      _WBS.ResponsibleCostCenter                                                      as ResponsibleCostCenter,
      //    S/4HANA  CE2202: Project Type normalization - Begin

      _WBS.ProjectType,
      //    S/4HANA  CE2202: Project Type normalization - End

      _Project.ProjectDescription,
      _Project.ProjectProfileCode,
      _Project.ProjectObject,
      _Project.AvailabilityControlProfile,
      _Project.AvailabilityControlIsActive,
      _Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
      _Project._AvailabilityCtrlProfile.BudgetCurrencyRole
}
//    S/4HANA  CE2302: Commitment costs for maintenance orders - Begin

where
      _ProjCstLineItm.ProjectInternalID = _WBS.ProjectInternalID
  and _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
  and _ProjCstLineItm.CompanyCode       = _WBS.CompanyCode
  and IsCommitment                      = 'X'
  and _ProjCstLineItm.FiscalPeriod      > '000' // CE2302 - Adding additional checks

  
// CE2308 - Optimization of existing selections - Start

union all  select from I_ProjectBasicData         as _Project      
    left outer to many join I_WBSElementBasicData         as _WBS          on  _Project.ProjectInternalID   = _WBS.ProjectInternalID 
    left outer to one join  I_MaintenanceOrder           as _Orders       on _Orders.ProjectInternalID    = _WBS.ProjectInternalID
                                                                   and _Orders.WBSElementInternalID = _WBS.WBSElementInternalID
    left outer to many join I_GLAccountLineItemRawData    as _ProjCstLineItm on _ProjCstLineItm.OrderID = _Orders.MaintenanceOrder
    inner join   I_LedgerSourceLedger             as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger 
    inner join   P_PROJECTSEMTAGACC               as _SemanticTag  on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea 
                                                                   and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount 
                                                                   and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts  
// CE2308 - Optimization of existing selections - End

/*union all  select from I_GLAccountLineItemRawData as _ProjCstLineItm 
    inner join   I_MaintenanceOrder         as _Orders       on _ProjCstLineItm.OrderID = _Orders.MaintenanceOrder 
    inner join   I_LedgerSourceLedger       as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger 
    inner join   I_WBSElementBasicData      as _WBS          on  _Orders.ProjectInternalID   = _WBS.ProjectInternalID 
                                                             and _Orders.WBSElementInternalID = _WBS.WBSElementInternalID 
    inner join   I_ProjectBasicData         as _Project      on  _WBS.ProjectInternalID          = _Project.ProjectInternalID 
    inner join   P_PROJECTSEMTAGACC         as _SemanticTag  on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea 

                                                             and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount 

                                                             and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts     
*/
{ 

  key _ProjCstLineItm.SourceLedger, //key 

  key _SourceLedger.Ledger, //key 

  key _ProjCstLineItm.CompanyCode, //key 

  key _ProjCstLineItm.FiscalYear, 
  key _ProjCstLineItm.AccountingDocument, //key 

      cast(cast( '00000000000000000000000' as abap.numc (23)) as fis_fp_request_tsn ) as FinancialPlanningReqTransSqnc, 
      cast(cast( '000000' as abap.numc (6)) as fis_fp_data_packet )                   as FinancialPlanningDataPacket, 
      cast( _ProjCstLineItm.LedgerGLLineItem as fis_act_pln_docln)                    as ActualPlanJournalEntryItem, 
      _ProjCstLineItm.LedgerFiscalYear, 
      cast(cast( 'A' as abap.char (1)) as fis_actual_plan_code)                       as ActualPlanCode, 
      _ProjCstLineItm.LedgerGLLineItem, 
      cast(cast( 0 as abap.int4 ) as fis_fp_entry_item )                              as FinancialPlanningEntryItem, 
      _ProjCstLineItm.AccountingDocCreatedByUser, 
      _ProjCstLineItm.BusinessArea, 
      _ProjCstLineItm.PartnerOrder, 
      _ProjCstLineItm.OrderID, 
      _ProjCstLineItm.PartnerOrderCategory, 
      _ProjCstLineItm.PartnerWBSElement, 
      _ProjCstLineItm.PartnerProject, 
      _ProjCstLineItm.BusinessTransactionType, 
      _ProjCstLineItm.DebitCreditCode, 
      _ProjCstLineItm.ControllingDebitCreditCode, 
      _WBS.WBSElementExternalID                                                       as WBSElement, 
      _Project.ProjectExternalID                                                      as Project,    

      _Project.ProjectInternalID, 

      _Orders.WBSElementInternalID                                                    as WBSElementInternalID, 

      _ProjCstLineItm.ControllingArea, 
      _ProjCstLineItm.GLAccount, 
      _SemanticTag.GLAccountHierarchy, 
      _ProjCstLineItm.ChartOfAccounts, 
      _ProjCstLineItm.CostCenter, 
      _ProjCstLineItm.ProfitCenter, 
      _ProjCstLineItm.CreationDate, 
      _ProjCstLineItm.FunctionalArea, 
      _ProjCstLineItm.CostCtrActivityType, 

      @Semantics.currencyCode: true 
      _ProjCstLineItm.ControllingObjectCurrency, 

      @DefaultAggregation: #SUM 
      @Semantics.amount.currencyCode: 'ControllingObjectCurrency' 
      _ProjCstLineItm.AmountInObjectCurrency, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.TransactionCurrency, 
      
      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'TransactionCurrency'} } 
      _ProjCstLineItm.AmountInTransactionCurrency, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.CompanyCodeCurrency, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} } 
      _ProjCstLineItm.AmountInCompanyCodeCurrency, 
 
      @Semantics.currencyCode:true 
      _ProjCstLineItm.GlobalCurrency, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} } 
      _ProjCstLineItm.AmountInGlobalCurrency, 
      
      @Semantics.currencyCode: true 
      _ProjCstLineItm.FunctionalCurrency, 
      
      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} } 
      _ProjCstLineItm.AmountInFunctionalCurrency                                      as CmtmtAmountInFunctionalCrcy, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency1, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency1, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency2, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency2, 
      
      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency3, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency3, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency4, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency4, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency5, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency5, 
 
      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency6, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency6, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency7, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency7, 

      @Semantics.currencyCode:true 
      _ProjCstLineItm.FreeDefinedCurrency8, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency8, 

      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} } 
      @DefaultAggregation: #SUM 
      _ProjCstLineItm.AmountInGlobalCurrency                                          as CmtmtCostInGlobalCurrency, 

      @Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} } 
      @DefaultAggregation: #SUM 
      _ProjCstLineItm.AmountInObjectCurrency                                          as CmtmtCostInProjCrcy, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency1                                    as CmtmtCostInFreeDefinedCrcy1, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency2                                    as CmtmtCostInFreeDefinedCrcy2, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency3                                    as CmtmtCostInFreeDefinedCrcy3, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency4                                    as CmtmtCostInFreeDefinedCrcy4, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency5                                    as CmtmtCostInFreeDefinedCrcy5, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency6                                    as CmtmtCostInFreeDefinedCrcy6, 

      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency7                                    as CmtmtCostInFreeDefinedCrcy7, 
      
      @DefaultAggregation: #SUM 
      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} } 
      _ProjCstLineItm.AmountInFreeDefinedCurrency8                                    as CmtmtCostInFreeDefinedCrcy8, 
      _ProjCstLineItm.SourceReferenceDocumentType, 
      _ProjCstLineItm.SourceLogicalSystem, 
      _ProjCstLineItm.SourceReferenceDocumentCntxt, 
      _ProjCstLineItm.SourceReferenceDocument, 
      _ProjCstLineItm.SourceReferenceDocumentItem, 
      _ProjCstLineItm.SourceReferenceDocSubitem, 
      _ProjCstLineItm.IsCommitment, 
      'X'                                                                             as IsSettled, 
      cast( cast( 'CMTMT' as abap.char( 10  )) as fcom_category)                      as PlanningCategory, 
      _ProjCstLineItm.PostingDate, 
      _ProjCstLineItm.DocumentDate, 
      _ProjCstLineItm.FiscalPeriod, 
      _ProjCstLineItm.FiscalYearPeriod, 
      _ProjCstLineItm.FiscalYearVariant, 
      cast( ' ' as boolean  )                                                         as MaintenanceOrderIsSelected,       
      _SemanticTag.SemanticTag, 
      _WBS.ProfitCenter                                                               as WBSElementProfitCenter, 
      _WBS.WBSDescription                                                             as WBSDescription, 
      _ProjCstLineItm.OrderID                                                         as ProjectObjectNode, 
      _WBS.ResponsibleCostCenter                                                      as ResponsibleCostCenter, 
      _WBS.ProjectType, 
      _Project.ProjectDescription, 
      _Project.ProjectProfileCode, 
      _Project.ProjectObject, 
      _Project.AvailabilityControlProfile, 
      _Project.AvailabilityControlIsActive,
      _Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,      
      _Project._AvailabilityCtrlProfile.BudgetCurrencyRole 
} 
where 
  _ProjCstLineItm.OrderID           is not initial 
  and _ProjCstLineItm.CompanyCode   = _WBS.CompanyCode 
  and IsCommitment                  = 'X'   
  and _ProjCstLineItm.FiscalPeriod  > '000' // CE2302 - Adding additional checks

//    S/4HANA  CE2302: Commitment costs for maintenance orders - End