P_ProjPlnCostLineItms

DDL: P_PROJPLNCOSTLINEITMS SQL: PPRJBYPLNCST Type: view COMPOSITE

P_ProjPlnCostLineItms is a Composite CDS View in SAP S/4HANA. It reads from 11 data sources and exposes 304 fields with key fields FinancialPlanningReqTransSqnc, FinancialPlanningDataPacket, ActualPlanJournalEntryItem, FinancialPlanningDataPacket, ActualPlanJournalEntryItem.

Data Sources (11)

SourceAliasJoin Type
P_IsLeadingLedger _Ledger inner
P_IsLeadingLedger _Ledger inner
P_IsLeadingLedger _Ledger inner
I_OrderPlanningCategoryMap _OrderCategoryMap inner
I_OrderPlanningCategoryMap _OrderCategoryMap inner
I_ProjectBasicData _Project from
I_ProjectBasicData _Project union_all
I_ProjectBasicData _Project union_all
P_PROJECTSEMTAGACC _SemanticTag inner
P_PROJECTSEMTAGACC _SemanticTag inner
P_PROJECTSEMTAGACC _SemanticTag inner

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PPRJBYPLNCST 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 (304)

KeyFieldSource TableSource FieldDescription
KEY FinancialPlanningReqTransSqnc _ProjCstLineItm FinancialPlanningReqTransSqnc
KEY FinancialPlanningDataPacket _ProjCstLineItm FinancialPlanningDataPacket
KEY ActualPlanJournalEntryItem
SourceLedger
Ledger _ProjCstLineItm Ledger
CompanyCode _ProjCstLineItm CompanyCode
FiscalYear _ProjCstLineItm FiscalYear
AccountingDocument
LedgerFiscalYear _ProjCstLineItm LedgerFiscalYear
LedgerGLLineItem
FinancialPlanningEntryItem _ProjCstLineItm FinancialPlanningEntryItem
ActualPlanCode
AccountingDocCreatedByUser _ProjCstLineItm FinPlngEntryItemCreatedByUser
BusinessArea _ProjCstLineItm BusinessArea
PartnerOrder _ProjCstLineItm PartnerOrder_2
OrderID _ProjCstLineItm OrderID
OrderOperation
OperationDescription
PartnerOrderCategory
PartnerWBSElement
PartnerProject
BusinessTransactionType _ProjCstLineItm BusinessTransactionType
ControllingDebitCreditCode _ProjCstLineItm ControllingDebitCreditCode
WBSElement _WBS WBSElementExternalID
Project I_ProjectBasicData ProjectExternalID
ProjectInternalID I_ProjectBasicData ProjectInternalID
WBSElementInternalID _ProjCstLineItm WBSElementInternalID
ControllingArea _ProjCstLineItm ControllingArea
GLAccount _ProjCstLineItm GLAccount
CostCenter _ProjCstLineItm CostCenter
ProfitCenter _ProjCstLineItm ProfitCenter
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
ChartOfAccounts _ProjCstLineItm ChartOfAccounts
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
PlanAmountInFunctionalCurrency _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
PlndCostAmtInProjCrcy _ProjCstLineItm AmountInObjectCurrency
PlanAmountInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
PlanAmountInFreeDefinedCrcy1 _ProjCstLineItm AmountInFreeDefinedCurrency1
PlanAmountInFreeDefinedCrcy2 _ProjCstLineItm AmountInFreeDefinedCurrency2
PlanAmountInFreeDefinedCrcy3 _ProjCstLineItm AmountInFreeDefinedCurrency3
PlanAmountInFreeDefinedCrcy4 _ProjCstLineItm AmountInFreeDefinedCurrency4
PlanAmountInFreeDefinedCrcy5 _ProjCstLineItm AmountInFreeDefinedCurrency5
PlanAmountInFreeDefinedCrcy6 _ProjCstLineItm AmountInFreeDefinedCurrency6
PlanAmountInFreeDefinedCrcy7 _ProjCstLineItm AmountInFreeDefinedCurrency7
PlanAmountInFreeDefinedCrcy8 _ProjCstLineItm AmountInFreeDefinedCurrency8
SourceReferenceDocumentType
SourceLogicalSystem
SourceReferenceDocumentCntxt
SourceReferenceDocument
SourceReferenceDocumentItem
SourceReferenceDocSubitem
IsCommitment
IsSettled
PlanningCategory _ProjCstLineItm PlanningCategory
PlanningCategory1
PlanningCategory2
PostingDate _ProjCstLineItm PostingDate
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
FinancialPlanningReqTransSqnc
KEY FinancialPlanningDataPacket _ProjCstLineItm FinancialPlanningDataPacket
KEY ActualPlanJournalEntryItem
KEY SourceLedger
KEY Ledger _ProjCstLineItm Ledger
KEY CompanyCode _ProjCstLineItm CompanyCode
KEY FiscalYear _ProjCstLineItm FiscalYear
KEY AccountingDocument
LedgerFiscalYear _ProjCstLineItm LedgerFiscalYear
LedgerGLLineItem
FinancialPlanningEntryItem _ProjCstLineItm FinancialPlanningEntryItem
ActualPlanCode
AccountingDocCreatedByUser _ProjCstLineItm FinPlngEntryItemCreatedByUser
BusinessArea _ProjCstLineItm BusinessArea
PartnerOrder _ProjCstLineItm PartnerOrder_2
OrderID _ProjCstLineItm OrderID
OrderOperation _ProjCstLineItm OrderOperation
OperationDescription
PartnerOrderCategory
PartnerWBSElement
PartnerProject
BusinessTransactionType _ProjCstLineItm BusinessTransactionType
ControllingDebitCreditCode _ProjCstLineItm ControllingDebitCreditCode
WBSElement _WBS WBSElementExternalID
Project I_ProjectBasicData ProjectExternalID
ProjectInternalID _ProjCstLineItm ProjectInternalID
WBSElementInternalID _ProjCstLineItm WBSElementInternalID
ControllingArea _ProjCstLineItm ControllingArea
GLAccount _ProjCstLineItm GLAccount
CostCenter _ProjCstLineItm CostCenter
ProfitCenter _ProjCstLineItm ProfitCenter
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
ChartOfAccounts _ProjCstLineItm ChartOfAccounts
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
PlanAmountInFunctionalCurrency _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
PlndCostAmtInProjCrcy _ProjCstLineItm AmountInObjectCurrency
PlanAmountInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
PlanAmountInFreeDefinedCrcy1 _ProjCstLineItm AmountInFreeDefinedCurrency1
PlanAmountInFreeDefinedCrcy2 _ProjCstLineItm AmountInFreeDefinedCurrency2
PlanAmountInFreeDefinedCrcy3 _ProjCstLineItm AmountInFreeDefinedCurrency3
PlanAmountInFreeDefinedCrcy4 _ProjCstLineItm AmountInFreeDefinedCurrency4
PlanAmountInFreeDefinedCrcy5 _ProjCstLineItm AmountInFreeDefinedCurrency5
PlanAmountInFreeDefinedCrcy6 _ProjCstLineItm AmountInFreeDefinedCurrency6
PlanAmountInFreeDefinedCrcy7 _ProjCstLineItm AmountInFreeDefinedCurrency7
PlanAmountInFreeDefinedCrcy8 _ProjCstLineItm AmountInFreeDefinedCurrency8
SourceReferenceDocumentType
SourceLogicalSystem
SourceReferenceDocumentCntxt
SourceReferenceDocument
SourceReferenceDocumentItem
SourceReferenceDocSubitem
IsCommitment
IsSettled
PlanningCategory _ProjCstLineItm PlanningCategory
PlanningCategory1 I_OrderPlanningCategoryMap PlanningCategory1
PlanningCategory2 I_OrderPlanningCategoryMap PlanningCategory2
PostingDate _ProjCstLineItm PostingDate
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
FinancialPlanningReqTransSqnc
KEY FinancialPlanningDataPacket _ProjCstLineItm FinancialPlanningDataPacket
KEY ActualPlanJournalEntryItem
KEY SourceLedger
KEY Ledger _ProjCstLineItm Ledger
KEY CompanyCode _ProjCstLineItm CompanyCode
KEY FiscalYear _ProjCstLineItm FiscalYear
KEY AccountingDocument
LedgerFiscalYear _ProjCstLineItm LedgerFiscalYear
LedgerGLLineItem
FinancialPlanningEntryItem _ProjCstLineItm FinancialPlanningEntryItem
ActualPlanCode
AccountingDocCreatedByUser _ProjCstLineItm FinPlngEntryItemCreatedByUser
BusinessArea _ProjCstLineItm BusinessArea
PartnerOrder _ProjCstLineItm PartnerOrder_2
OrderID _ProjCstLineItm OrderID
OrderOperation _ProjCstLineItm OrderOperation
OperationDescription
PartnerOrderCategory
PartnerWBSElement
PartnerProject
BusinessTransactionType _ProjCstLineItm BusinessTransactionType
ControllingDebitCreditCode _ProjCstLineItm ControllingDebitCreditCode
WBSElement _WBS WBSElementExternalID
Project I_ProjectBasicData ProjectExternalID
ProjectInternalID I_ProjectBasicData ProjectInternalID
WBSElementInternalID _WBS WBSElementInternalID
ControllingArea _ProjCstLineItm ControllingArea
GLAccount _ProjCstLineItm GLAccount
CostCenter _ProjCstLineItm CostCenter
ProfitCenter _ProjCstLineItm ProfitCenter
GLAccountHierarchy P_PROJECTSEMTAGACC GLAccountHierarchy
ChartOfAccounts _ProjCstLineItm ChartOfAccounts
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
PlanAmountInFunctionalCurrency _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
PlndCostAmtInProjCrcy _ProjCstLineItm AmountInObjectCurrency
PlanAmountInGlobalCurrency _ProjCstLineItm AmountInGlobalCurrency
PlanAmountInFreeDefinedCrcy1 _ProjCstLineItm AmountInFreeDefinedCurrency1
PlanAmountInFreeDefinedCrcy2 _ProjCstLineItm AmountInFreeDefinedCurrency2
PlanAmountInFreeDefinedCrcy3 _ProjCstLineItm AmountInFreeDefinedCurrency3
PlanAmountInFreeDefinedCrcy4 _ProjCstLineItm AmountInFreeDefinedCurrency4
PlanAmountInFreeDefinedCrcy5 _ProjCstLineItm AmountInFreeDefinedCurrency5
PlanAmountInFreeDefinedCrcy6 _ProjCstLineItm AmountInFreeDefinedCurrency6
PlanAmountInFreeDefinedCrcy7 _ProjCstLineItm AmountInFreeDefinedCurrency7
PlanAmountInFreeDefinedCrcy8 _ProjCstLineItm AmountInFreeDefinedCurrency8
SourceReferenceDocumentType
SourceLogicalSystem
SourceReferenceDocumentCntxt
SourceReferenceDocument
SourceReferenceDocumentItem
SourceReferenceDocSubitem
IsCommitment
IsSettled
PlanningCategory _ProjCstLineItm PlanningCategory
PlanningCategory1 I_OrderPlanningCategoryMap PlanningCategory1
PlanningCategory2 I_OrderPlanningCategoryMap PlanningCategory2
PostingDate _ProjCstLineItm PostingDate
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: 'PPRJBYPLNCST'
@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_ProjPlnCostLineItms
  // 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_FinancialPlanningEntryItem as _ProjCstLineItm on  ( _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
                                                                      or _ProjCstLineItm.Project        = _Project.Project )
                                                                    and _WBS.ProjectInternalID            = _Project.ProjectInternalID
                                                                    and _ProjCstLineItm.WBSElementInternalID         = _WBS.WBSElementInternalID
  inner join   P_IsLeadingLedger            as _Ledger      on _ProjCstLineItm.Ledger = _Ledger.Ledger
  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_FinancialPlanningEntryItem as _ProjCstLineItm
    inner join   P_IsLeadingLedger            as _Ledger      on _ProjCstLineItm.Ledger = _Ledger.Ledger
    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
  */
  //CE2111 - Fix for PCR Hierarchy - Start

  //S/4HANA CE2108 - Maintenance Order enablement-Begin

  //    left outer to one join I_MaintenanceOrder           as _MaintOrder  on _ProjCstLineItm.OrderID = _MaintOrder.MaintenanceOrder

  //    left outer to one join I_OrderPlanningCategoryMap   as _OrdCatMap   on _MaintOrder.MaintenanceOrderCategory = _OrdCatMap.OrderCategory

  //S/4HANA CE2108 - Maintenance Order enablement-End

  //CE2111 - Fix for PCR Hierarchy - End

{
  key  _ProjCstLineItm.FinancialPlanningReqTransSqnc, //key

  key  _ProjCstLineItm.FinancialPlanningDataPacket, //key

  key  cast(abs(_ProjCstLineItm.FinancialPlanningEntryItem) as  fis_act_pln_docln )       as ActualPlanJournalEntryItem,
       cast(cast('' as abap.char (2)) as fins_ledger_pers )                               as SourceLedger,
       _ProjCstLineItm.Ledger,
       _ProjCstLineItm.CompanyCode,
       _ProjCstLineItm.FiscalYear,
       cast(cast('' as abap.char (10)) as farp_belnr_d )                                  as AccountingDocument,
       _ProjCstLineItm.LedgerFiscalYear,
       cast(cast('' as abap.char (6)) as fis_docln )                                      as LedgerGLLineItem,
       _ProjCstLineItm.FinancialPlanningEntryItem,
       cast(cast( 'P' as abap.char (1)) as fis_actual_plan_code)                          as ActualPlanCode,
       _ProjCstLineItm.FinPlngEntryItemCreatedByUser                                      as AccountingDocCreatedByUser,
       _ProjCstLineItm.BusinessArea,
       //Sending Partner fields


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

       //_ProjCstLineItm.PartnerOrder,

       _ProjCstLineItm.PartnerOrder_2                                                     as PartnerOrder,
       // S/4 Hana CE2302- Field Deprecation - END


       _ProjCstLineItm.OrderID,
       ' '                                                                                as OrderOperation,
       //S/4HANA CE2108 - Inclusion of Maintenance Order Changes-Begin


       //   ' '                                                                                as MaintenanceOrderDesc,

       //_ProjCstLineItm._Order.OrderDescription                                            as MaintenanceOrderDesc,

       //_ProjCstLineItm.PartnerAccountAssignmentType,

       //S/4HANA CE2108 - Inclusion of Maintenance Order Changes-End

       ' '                                                                                as OperationDescription,

       cast(_PartnerOrder.OrderCategory as fis_par_auftyp preserving type )               as 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,
       cast( ( case ControllingDebitCreditCode
               when 'S' then 'S'
                        else 'H'
         end )
       as fis_shkzg preserving type )                                                     as DebitCreditCode,
       _ProjCstLineItm.ControllingDebitCreditCode,
       ///  _WBSElementBasicData.WBSElementObject as ProjectObjectNode,

       _WBS.WBSElementExternalID                                                          as WBSElement,
       _Project.ProjectExternalID                                                         as Project,
       _Project.ProjectInternalID,
       _ProjCstLineItm.WBSElementInternalID,
       _ProjCstLineItm.ControllingArea,
       _ProjCstLineItm.GLAccount,
       _ProjCstLineItm.CostCenter,
       _ProjCstLineItm.ProfitCenter,
       _SemanticTag.GLAccountHierarchy,
       _ProjCstLineItm.ChartOfAccounts,
       cast(cast(substring(FinancialPlanningReqTransSqnc,1,8)as abap.dats) as fis_budat ) as 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 PlanAmountInFunctionalCurrency,
       //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,

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

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

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

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

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

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

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

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

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

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

       cast('' as fins_src_awtyp   )                                                      as SourceReferenceDocumentType,
       cast('' as fins_src_awsys   )                                                      as SourceLogicalSystem,
       cast('' as fins_src_aworg   )                                                      as SourceReferenceDocumentCntxt,
       cast('' as fins_src_awref   )                                                      as SourceReferenceDocument,
       cast('000000' as fins_src_awitem preserving type )                                 as SourceReferenceDocumentItem,
       cast('000000' as fins_src_awsubit preserving type )                                as SourceReferenceDocSubitem,
       cast(' ' as fins_xcommitment preserving type )                                     as IsCommitment,
       'X'                                                                                as IsSettled,
       _ProjCstLineItm.PlanningCategory,
       //CE2111 - Fix for PCR Hierarchy - Start

       //S/4HANA CE2108 - Maintenance Order enablement-Begin

       cast( '' as fcom_category )                                                        as PlanningCategory1,
       cast( '' as fcom_category )                                                        as PlanningCategory2,
       //       _OrdCatMap.PlanningCategory1,

       //       _OrdCatMap.PlanningCategory2,

       //S/4HANA CE2108 - Maintenance Order enablement-End

       //CE2111 - Fix for PCR Hierarchy - End

       _ProjCstLineItm.PostingDate,

       cast( '00000000' as bldat )                                                        as DocumentDate,
       _ProjCstLineItm.FiscalPeriod,
       _ProjCstLineItm.FiscalYearPeriod,
       _ProjCstLineItm.FiscalYearVariant,

       //CE2111 - Fix for PCR Hierarchy - Start

       //S/4HANA CE2108 - Maintenance Order enablement-Begin

       //       case

       //       when _ProjCstLineItm.AccountAssignmentType = 'OR'

       //       then cast( ' ' as boolean )

       //       else cast( 'X' as boolean )

       //       end                                                                                as MaintenanceOrderIsSelected,

       //S/4HANA CE2108 - Maintenance Order enablement-End

       cast( 'X' as boolean )                                                             as MaintenanceOrderIsSelected,
       //CE2111 - Fix for PCR Hierarchy - End

       _SemanticTag.SemanticTag,
       _WBS.ProfitCenter                                                                  as WBSElementProfitCenter,
       _WBS.WBSDescription                                                                as WBSDescription,
       //CE2111 - Fix for PCR Hierarchy - Start

       //S/4HANA CE2108 - Maintenance Order enablement-Begin

       //       case

       //       when _ProjCstLineItm.AccountAssignmentType = 'OR'

       //       then _ProjCstLineItm.OrderID

       //       else  _WBS.WBSElementObject

       //       end                                                                                as ProjectObjectNode,

       //S/4HANA CE2108 - Maintenance Order enablement-End

       _WBS.WBSElementObject                                                              as ProjectObjectNode,
       //CE2111 - Fix for PCR Hierarchy - End


       _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
}
where
      _ProjCstLineItm.ProjectInternalID = _WBS.ProjectInternalID
  and _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
  and _ProjCstLineItm.AccountAssignmentType != 'OR' //CE2111 - Fix for PCR Hierarchy

//and _Ledger.IsLeadingLedger           = 'X'

//  and _ProjCstLineItm.FiscalYear        = _FiscalPeriod.FiscalYear

//  and _ProjCstLineItm.FiscalPeriod      = _FiscalPeriod.FiscalPeriod


  // 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 _WBS.WBSElementInternalID  = _Orders.WBSElementInternalID //on _Project.ProjectInternalID  = _Orders.ProjectInternalID

  left outer to many join I_FinancialPlanningEntryItem   as _ProjCstLineItm    on  _ProjCstLineItm.OrderID = _Orders.MaintenanceOrder

  inner join   P_IsLeadingLedger                         as _Ledger            on _ProjCstLineItm.Ledger = _Ledger.Ledger
  inner join   P_PROJECTSEMTAGACC                        as _SemanticTag       on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea
                                                                               and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount
                                                                               and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
  inner join          I_OrderPlanningCategoryMap         as _OrderCategoryMap  on _OrderCategoryMap.OrderCategory    = _Orders.MaintenanceOrderCategory
                                                                               and(
                                                                                  _ProjCstLineItm.PlanningCategory    = _OrderCategoryMap.PlanningCategory1
                                                                                  or _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory2
                                                                               )                                                             
  // CE2308 - Optimization of existing selections - End

  
  
/*//CE2111 - Fix for PCR Hierarchy - Start


union all select from I_FinancialPlanningEntryItem as _ProjCstLineItm
  inner join          P_IsLeadingLedger            as _Ledger           on _ProjCstLineItm.Ledger = _Ledger.Ledger //CE2111 - Fix for PCR Hierarchy

  inner join          I_MaintenanceOrder           as _Orders           on _ProjCstLineItm.OrderID = _Orders.MaintenanceOrder
  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
  inner join          I_OrderPlanningCategoryMap   as _OrderCategoryMap on _OrderCategoryMap.OrderCategory    = _Orders.MaintenanceOrderCategory
                                                                        and(
                                                                          _ProjCstLineItm.PlanningCategory    = _OrderCategoryMap.PlanningCategory1
                                                                          or _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory2
                                                                        )
//CE2111 - Fix for PCR Hierarchy - Start

//  left outer to one join I_FiscalYearPeriodForCmpnyCode as _FiscalPeriod     on  _ProjCstLineItm.FiscalYear   = _FiscalPeriod.FiscalYear

//                                                                             and _ProjCstLineItm.FiscalPeriod = _FiscalPeriod.FiscalPeriod

//                                                                             and _ProjCstLineItm.CompanyCode  = _FiscalPeriod.CompanyCode

//CE2111 - Fix for PCR Hierarchy - End

*/
{
  key _ProjCstLineItm.FinancialPlanningReqTransSqnc, //key

  key _ProjCstLineItm.FinancialPlanningDataPacket,   //key

  key cast(abs(_ProjCstLineItm.FinancialPlanningEntryItem) as  fis_act_pln_docln )       as ActualPlanJournalEntryItem,
  key cast(cast('' as abap.char (2)) as fins_ledger_pers )                               as SourceLedger,
  key _ProjCstLineItm.Ledger,
  key _ProjCstLineItm.CompanyCode,
  key _ProjCstLineItm.FiscalYear,
  key cast(cast('' as abap.char (10)) as farp_belnr_d )                                  as AccountingDocument,


      _ProjCstLineItm.LedgerFiscalYear,
      cast(cast('' as abap.char (6)) as fis_docln )                                      as LedgerGLLineItem,
      _ProjCstLineItm.FinancialPlanningEntryItem,
      cast(cast( 'P' as abap.char (1)) as fis_actual_plan_code)                          as ActualPlanCode,
      _ProjCstLineItm.FinPlngEntryItemCreatedByUser                                      as AccountingDocCreatedByUser,
      _ProjCstLineItm.BusinessArea,
      //Sending Partner fields


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

      //_ProjCstLineItm.PartnerOrder,

      _ProjCstLineItm.PartnerOrder_2                                                     as PartnerOrder,
      // S/4 Hana CE2302- Field Deprecation - END


      _ProjCstLineItm.OrderID,
      _ProjCstLineItm.OrderOperation,
      //      _ProjCstLineItm._Order.OrderDescription                                            as MaintenanceOrderDesc, //CE2111 - Fix for PCR Hierarchy

      ' '                                                                                as OperationDescription,
      cast(_PartnerOrder.OrderCategory as fis_par_auftyp preserving type )               as 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,
      cast( ( case ControllingDebitCreditCode
              when 'S' then 'S'
                       else 'H'
        end )
      as fis_shkzg preserving type )                                                     as DebitCreditCode,
      _ProjCstLineItm.ControllingDebitCreditCode,
      ///  _WBSElementBasicData.WBSElementObject as ProjectObjectNode,

      //CE2111 - Fix for PCR Hierarchy - Start

      //      _ProjCstLineItm.WBSElement,

      //      _ProjCstLineItm.Project,

      _WBS.WBSElementExternalID                                                          as WBSElement,
      _Project.ProjectExternalID                                                         as Project,
      //CE2111 - Fix for PCR Hierarchy - End

      _ProjCstLineItm.ProjectInternalID,
      _ProjCstLineItm.WBSElementInternalID,
      _ProjCstLineItm.ControllingArea,
      _ProjCstLineItm.GLAccount,
      _ProjCstLineItm.CostCenter,
      _ProjCstLineItm.ProfitCenter,
      _SemanticTag.GLAccountHierarchy,
      _ProjCstLineItm.ChartOfAccounts,
      cast(cast(substring(FinancialPlanningReqTransSqnc,1,8)as abap.dats) as fis_budat ) as 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,

      //CE2111 - Fix for PCR Hierarchy - Start

      @Semantics.currencyCode: true
      _ProjCstLineItm.FunctionalCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      _ProjCstLineItm.AmountInFunctionalCurrency                                         as PlanAmountInFunctionalCurrency,
      //CE2111 - Fix for PCR Hierarchy - 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,

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

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

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

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

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

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

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

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

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

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

      cast('' as fins_src_awtyp   )                                                      as SourceReferenceDocumentType,
      cast('' as fins_src_awsys   )                                                      as SourceLogicalSystem,
      cast('' as fins_src_aworg   )                                                      as SourceReferenceDocumentCntxt,
      cast('' as fins_src_awref   )                                                      as SourceReferenceDocument,
      cast('000000' as fins_src_awitem preserving type )                                 as SourceReferenceDocumentItem,
      cast('000000' as fins_src_awsubit preserving type )                                as SourceReferenceDocSubitem,
      cast(' ' as fins_xcommitment preserving type )                                     as IsCommitment,
      'X'                                                                                as IsSettled,
      _ProjCstLineItm.PlanningCategory,
      _OrderCategoryMap.PlanningCategory1,
      _OrderCategoryMap.PlanningCategory2,
      //CE2111 - Fix for PCR Hierarchy - Start

      //      cast( ( case PostingDate when '00000000' then _FiscalPeriod.FiscalPeriodEndDate

      //                                         else PostingDate

      //              end )

      //      as fis_budat preserving type )                                                     as PostingDate,

      _ProjCstLineItm.PostingDate                                                        as PostingDate,
      //CE2111 - Fix for PCR Hierarchy - End


      cast( '00000000' as bldat )                                                        as DocumentDate,
      _ProjCstLineItm.FiscalPeriod,
      _ProjCstLineItm.FiscalYearPeriod,
      _ProjCstLineItm.FiscalYearVariant,

      //CE2111 - Fix for PCR Hierarchy - Start

      //      case

      //      when _ProjCstLineItm.AccountAssignmentType = 'OR'

      //      then cast( ' ' as boolean )

      //      else cast( 'X' as boolean )

      //      end  as MaintenanceOrderIsSelected,


      cast( ' ' as boolean )                                                             as MaintenanceOrderIsSelected,
      //CE2111 - Fix for PCR Hierarchy - End


      _SemanticTag.SemanticTag,
      _WBS.ProfitCenter                                                                  as WBSElementProfitCenter,
      _WBS.WBSDescription                                                                as WBSDescription,
      _ProjCstLineItm.OrderID                                                            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
}
where
      _ProjCstLineItm.ProjectInternalID     = _Project.ProjectInternalID
  and _ProjCstLineItm.ProjectInternalID     = _WBS.ProjectInternalID
  and _ProjCstLineItm.ProjectInternalID     = _Orders.ProjectInternalID
  and _ProjCstLineItm.AccountAssignmentType = 'OR' //CE2111 - Fix for PCR Hierarchy

  
  // 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_ManufacturingOrder         as _Orders           on _WBS.WBSElementInternalID  = _Orders.WBSElementInternalID
  left outer to many join I_FinancialPlanningEntryItem as _ProjCstLineItm   on  _ProjCstLineItm.OrderID = _Orders.ManufacturingOrder

  inner join   P_IsLeadingLedger                       as _Ledger           on _ProjCstLineItm.Ledger = _Ledger.Ledger
  inner join   P_PROJECTSEMTAGACC                      as _SemanticTag      on  _SemanticTag.ControllingArea    = _ProjCstLineItm.ControllingArea
                                                                            and _SemanticTag.HierarchyNodeVal   = _ProjCstLineItm.GLAccount
                                                                            and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
  inner join          I_OrderPlanningCategoryMap       as _OrderCategoryMap on _OrderCategoryMap.OrderCategory    = _Orders.ManufacturingOrderCategory
                                                                            and(
                                                                              _ProjCstLineItm.PlanningCategory    = _OrderCategoryMap.PlanningCategory1
                                                                              or _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory2
                                                                            )                                                                                                                    
  // CE2308 - Optimization of existing selections - End  


// CE2302 - Including Production Orders - Start  


/*union all select from I_FinancialPlanningEntryItem as _ProjCstLineItm
  inner join          P_IsLeadingLedger            as _Ledger           on _ProjCstLineItm.Ledger = _Ledger.Ledger 
  inner join          I_ManufacturingOrder         as _Orders           on _ProjCstLineItm.OrderID = _Orders.ManufacturingOrder
  inner join          I_WBSElementBasicData        as _WBS              on _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
  inner join          I_OrderPlanningCategoryMap   as _OrderCategoryMap on _OrderCategoryMap.OrderCategory    = _Orders.ManufacturingOrderCategory
                                                                        and(
                                                                          _ProjCstLineItm.PlanningCategory    = _OrderCategoryMap.PlanningCategory1
                                                                          or _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory2
                                                                        )
*/
{
  key _ProjCstLineItm.FinancialPlanningReqTransSqnc, //key

  key _ProjCstLineItm.FinancialPlanningDataPacket,   //key

  key cast(abs(_ProjCstLineItm.FinancialPlanningEntryItem) as  fis_act_pln_docln )       as ActualPlanJournalEntryItem,
  key cast(cast('' as abap.char (2)) as fins_ledger_pers )                               as SourceLedger,
  key _ProjCstLineItm.Ledger,
  key _ProjCstLineItm.CompanyCode,
  key _ProjCstLineItm.FiscalYear,
  key cast(cast('' as abap.char (10)) as farp_belnr_d )                                  as AccountingDocument,


      _ProjCstLineItm.LedgerFiscalYear,
      cast(cast('' as abap.char (6)) as fis_docln )                                      as LedgerGLLineItem,
      _ProjCstLineItm.FinancialPlanningEntryItem,
      cast(cast( 'P' as abap.char (1)) as fis_actual_plan_code)                          as ActualPlanCode,
      _ProjCstLineItm.FinPlngEntryItemCreatedByUser                                      as AccountingDocCreatedByUser,
      _ProjCstLineItm.BusinessArea,
      _ProjCstLineItm.PartnerOrder_2                                                     as PartnerOrder,
      _ProjCstLineItm.OrderID,
      _ProjCstLineItm.OrderOperation,
      ' '                                                                                as OperationDescription,
      cast(_PartnerOrder.OrderCategory as fis_par_auftyp preserving type )               as PartnerOrderCategory,


      _ProjCstLineItm._PartnerWBSElementBasicData.WBSElementExternalID                   as PartnerWBSElement,

      _ProjCstLineItm._PartnerProjectBasicData.ProjectExternalID                         as PartnerProject,

      _ProjCstLineItm.BusinessTransactionType,
      cast( ( case ControllingDebitCreditCode
              when 'S' then 'S'
                       else 'H'
        end )
      as fis_shkzg preserving type )                                                     as DebitCreditCode,
      _ProjCstLineItm.ControllingDebitCreditCode,
      _WBS.WBSElementExternalID                                                          as WBSElement,
      _Project.ProjectExternalID                                                         as Project,
      //_ProjCstLineItm.ProjectInternalID,

     // _ProjCstLineItm.WBSElementInternalID,

      _Project.ProjectInternalID,
      _WBS.WBSElementInternalID,      
      _ProjCstLineItm.ControllingArea,
      _ProjCstLineItm.GLAccount,
      _ProjCstLineItm.CostCenter,
      _ProjCstLineItm.ProfitCenter,
      _SemanticTag.GLAccountHierarchy,
      _ProjCstLineItm.ChartOfAccounts,
      cast(cast(substring(FinancialPlanningReqTransSqnc,1,8)as abap.dats) as fis_budat ) as 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,

      //CE2111 - Fix for PCR Hierarchy - Start

      @Semantics.currencyCode: true
      _ProjCstLineItm.FunctionalCurrency,

      @DefaultAggregation: #SUM
      @Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
      _ProjCstLineItm.AmountInFunctionalCurrency                                         as PlanAmountInFunctionalCurrency,
      //CE2111 - Fix for PCR Hierarchy - 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,

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

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

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

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

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

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

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

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

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

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

      cast('' as fins_src_awtyp   )                                                      as SourceReferenceDocumentType,
      cast('' as fins_src_awsys   )                                                      as SourceLogicalSystem,
      cast('' as fins_src_aworg   )                                                      as SourceReferenceDocumentCntxt,
      cast('' as fins_src_awref   )                                                      as SourceReferenceDocument,
      cast('000000' as fins_src_awitem preserving type )                                 as SourceReferenceDocumentItem,
      cast('000000' as fins_src_awsubit preserving type )                                as SourceReferenceDocSubitem,
      cast(' ' as fins_xcommitment preserving type )                                     as IsCommitment,
      'X'                                                                                as IsSettled,
      _ProjCstLineItm.PlanningCategory,
      _OrderCategoryMap.PlanningCategory1,
      _OrderCategoryMap.PlanningCategory2,
      _ProjCstLineItm.PostingDate                                                        as PostingDate,

      cast( '00000000' as bldat )                                                        as 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.ProjectInternalID     = _Project.ProjectInternalID
  and _ProjCstLineItm.ProjectInternalID     = _WBS.ProjectInternalID
  and*/ 
  _ProjCstLineItm.AccountAssignmentType = 'OR' 

// CE2302 - Including Production Orders - End


 
//union all select from    I_FinancialPlanningEntryItem   as _ProjCstLineItm

//  inner join             I_MaintenanceOrder             as _Orders           on _ProjCstLineItm.OrderID = _Orders.MaintenanceOrder

//  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

//  inner join             I_OrderPlanningCategoryMap     as _OrderCategoryMap on _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory1

//                                                                             or _ProjCstLineItm.PlanningCategory = _OrderCategoryMap.PlanningCategory2

//

//  left outer to one join I_FiscalYearPeriodForCmpnyCode as _FiscalPeriod     on  _ProjCstLineItm.FiscalYear   = _FiscalPeriod.FiscalYear

//                                                                             and _ProjCstLineItm.FiscalPeriod = _FiscalPeriod.FiscalPeriod

//                                                                             and _ProjCstLineItm.CompanyCode  = _FiscalPeriod.CompanyCode

//

//{

//  key cast(cast('' as abap.char (2)) as fins_ledger_pers )                               as SourceLedger,

//  key _ProjCstLineItm.Ledger,

//  key _ProjCstLineItm.CompanyCode,

//  key _ProjCstLineItm.FiscalYear,

//  key cast(cast('' as abap.char (10)) as farp_belnr_d )                                  as AccountingDocument,

//  key _ProjCstLineItm.FinancialPlanningReqTransSqnc, //key

//  key _ProjCstLineItm.FinancialPlanningDataPacket,   //key

//  key cast(abs(_ProjCstLineItm.FinancialPlanningEntryItem) as  fis_act_pln_docln )       as ActualPlanJournalEntryItem,

//      _ProjCstLineItm.LedgerFiscalYear,

//      cast(cast('' as abap.char (6)) as fis_docln )                                      as LedgerGLLineItem,

//      _ProjCstLineItm.FinancialPlanningEntryItem,

//      cast(cast( 'P' as abap.char (1)) as fis_actual_plan_code)                          as ActualPlanCode,

//      _ProjCstLineItm.FinPlngEntryItemCreatedByUser                                      as AccountingDocCreatedByUser,

//      _ProjCstLineItm.BusinessArea,

//      //Sending Partner fields

//      _ProjCstLineItm.PartnerOrder,

//      _ProjCstLineItm.OrderID,

//      _ProjCstLineItm.OrderOperation,

//      _ProjCstLineItm._Order.OrderDescription                                            as MaintenanceOrderDesc,

//      ' '                                                                                as OperationDescription,

//      cast(_PartnerOrder.OrderCategory as fis_par_auftyp preserving type )               as PartnerOrderCategory,

//      _ProjCstLineItm.PartnerWBSElement,

//      _ProjCstLineItm.PartnerProject,

//      _ProjCstLineItm.BusinessTransactionType,

//      cast( ( case ControllingDebitCreditCode

//              when 'S' then 'S'

//                       else 'H'

//        end )

//      as fis_shkzg preserving type )                                                     as DebitCreditCode,

//      _ProjCstLineItm.ControllingDebitCreditCode,

//      ///  _WBSElementBasicData.WBSElementObject as ProjectObjectNode,

//      _ProjCstLineItm.WBSElement,

//      _ProjCstLineItm.Project,

//      _ProjCstLineItm.ProjectInternalID,

//      _ProjCstLineItm.WBSElementInternalID,

//      _ProjCstLineItm.ControllingArea,

//      _ProjCstLineItm.GLAccount,

//      _ProjCstLineItm.CostCenter,

//      _ProjCstLineItm.ProfitCenter,

//      _SemanticTag.GLAccountHierarchy,

//      _ProjCstLineItm.ChartOfAccounts,

//      cast(cast(substring(FinancialPlanningReqTransSqnc,1,8)as abap.dats) as fis_budat ) as 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.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,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }

//      _ProjCstLineItm.AmountInObjectCurrency                                             as PlndCostAmtInProjCrcy,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }

//      _ProjCstLineItm.AmountInGlobalCurrency                                             as PlanAmountInGlobalCurrency,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency1                                       as PlanAmountInFreeDefinedCrcy1,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency2                                       as PlanAmountInFreeDefinedCrcy2,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency3                                       as PlanAmountInFreeDefinedCrcy3,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency4                                       as PlanAmountInFreeDefinedCrcy4,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency5                                       as PlanAmountInFreeDefinedCrcy5,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency6                                       as PlanAmountInFreeDefinedCrcy6,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency7                                       as PlanAmountInFreeDefinedCrcy7,

//

//      @DefaultAggregation: #SUM

//      @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }

//      _ProjCstLineItm.AmountInFreeDefinedCurrency8                                       as PlanAmountInFreeDefinedCrcy8,

//

//      cast('' as fins_src_awtyp   )                                                      as SourceReferenceDocumentType,

//      cast('' as fins_src_awsys   )                                                      as SourceLogicalSystem,

//      cast('' as fins_src_aworg   )                                                      as SourceReferenceDocumentCntxt,

//      cast('' as fins_src_awref   )                                                      as SourceReferenceDocument,

//      cast('000000' as fins_src_awitem preserving type )                                 as SourceReferenceDocumentItem,

//      cast('000000' as fins_src_awsubit preserving type )                                as SourceReferenceDocSubitem,

//      cast(' ' as fins_xcommitment preserving type )                                     as IsCommitment,

//      'X'                                                                                as IsSettled,

//      _ProjCstLineItm.PlanningCategory,

//      _OrderCategoryMap.PlanningCategory1,

//      _OrderCategoryMap.PlanningCategory2,

//      cast( ( case PostingDate when '00000000' then _FiscalPeriod.FiscalPeriodEndDate

//                                         else PostingDate

//              end )

//      as fis_budat preserving type )                                                     as PostingDate,

//

//      cast( '00000000' as bldat )                                                        as DocumentDate,

//      _ProjCstLineItm.FiscalPeriod,

//      _ProjCstLineItm.FiscalYearPeriod,

//      _ProjCstLineItm.FiscalYearVariant,

//      _SemanticTag.SemanticTag,

//      _WBS.ProfitCenter                                                                  as WBSElementProfitCenter,

//      _WBS.WBSDescription                                                                as WBSDescription,

//      _ProjCstLineItm.OrderID                                                            as ProjectObjectNode,

//      _WBS.ResponsibleCostCenter                                                         as ResponsibleCostCenter,

//      _Project.ProjectDescription,

//      _Project.ProjectProfileCode,

//      _Project.ProjectObject,

//      _Project.AvailabilityControlProfile,

//      _Project.AvailabilityControlIsActive,

//      _Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,

//      _Project._AvailabilityCtrlProfile.BudgetCurrencyRole

//}

//where

//      _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID

//  and _ProjCstLineItm.ProjectInternalID = _WBS.ProjectInternalID

//  and _ProjCstLineItm.ProjectInternalID = _Orders.ProjectInternalID

//  and _ProjCstLineItm.OrderID           is not initial

//  and _Ledger.IsLeadingLedger           = 'X'

//  and _ProjCstLineItm.FiscalYear        = _FiscalPeriod.FiscalYear

//  and _ProjCstLineItm.FiscalPeriod      = _FiscalPeriod.FiscalPeriod