@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
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
//2502 Performance improvement for PCR app - Begin - removal of disjoint join
// or _ProjCstLineItm.Project = _Project.Project
)
// and _WBS.ProjectInternalID = _Project.ProjectInternalID
//2502 Performance improvement for PCR app - End
and _ProjCstLineItm.WBSElementInternalID = _WBS.WBSElementInternalID
//2502 Performance improvement for PCR app - Begin - association removed due to introduction of derivation filter for Ledger field in C_Projectcostlineitems
// inner join I_LedgerSourceLedger as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
//2502 Performance improvement for PCR app - End
//2502 Q commitments inclusion - Start
// inner join P_PROJECTSEMTAGACC as _SemanticTag on _SemanticTag.ControllingArea = _ProjCstLineItm.ControllingArea
// and _SemanticTag.HierarchyNodeVal = _ProjCstLineItm.GLAccount
// and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
inner join P_ProjSemTagAcctWithProjStock as _SemanticTag on _SemanticTag.ControllingArea = _ProjCstLineItm.ControllingArea
and _SemanticTag.HierarchyNodeVal = _ProjCstLineItm.GLAccount
and _SemanticTag.HierarchyNodeClass = _ProjCstLineItm.ChartOfAccounts
//2502 Q commitments inclusion - End
// 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
//2502 Performance improvement for PCR app - Begin
// key _SourceLedger.Ledger, //key
key _ProjCstLineItm.SourceLedger as Ledger,
//2502 Performance improvement for PCR app - End
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,
//2408 Performance improvement for Project Cost Report Overview and Line Items-Begin
'' as ProjectObjectType,
//2408 Performance improvement for Project Cost Report Overview and Line Items-End
_ProjCstLineItm.PartnerOrderCategory,
_ProjCstLineItm._PartnerWBSElementBasicData.WBSElementExternalID as PartnerWBSElement,
_ProjCstLineItm._PartnerProjectBasicData.ProjectExternalID as PartnerProject,
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
_WBS.Plant,
_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,
@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,
//2502 Include Project Stock costs in Project Cost Report - Begin
//Fields are pushed down from C_Projectcostlineitems
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency as CmtmtCostInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency as CmtmtCostInTransacCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as CmtmtCumltvAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as ActlCmtmtCumltvAmtInGlobCrcy,
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
@DefaultAggregation: #SUM
_ProjCstLineItm.AmountInObjectCurrency as NonAccmltdCmtmtAmtInProjCrcy,
//2502 Include Project Stock costs in Project Cost Report - End
@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( 'X' as boolean ) as MaintenanceOrderIsSelected,
_SemanticTag.SemanticTag,
_WBS.ProfitCenter as WBSElementProfitCenter,
_WBS.WBSDescription as WBSDescription,
_WBS.WBSElementObject as ProjectObjectNode,
_WBS.ResponsibleCostCenter as ResponsibleCostCenter,
_WBS.ProjectType,
_Project.ProjectDescription,
_Project.ProjectProfileCode,
_Project.ProjectObject,
_Project.AvailabilityControlProfile,
_Project.AvailabilityControlIsActive,
_Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
_Project._AvailabilityCtrlProfile.BudgetCurrencyRole,
//2502 Performance improvement for PCR app - Begin - - fetch fields from the bottom
_ProjCstLineItm._FiscalCalendarDate.FiscalYear as OriginalFiscalYear,
_ProjCstLineItm._FiscalCalendarDate.FiscalPeriod as OriginalFiscalPeriod,
_ProjCstLineItm._FiscalCalendarDate.FiscalYearPeriod as NextFiscalYearPeriod
//2502 Performance improvement for PCR app - End
}
where
_ProjCstLineItm.ProjectInternalID = _WBS.ProjectInternalID
and _ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
and _ProjCstLineItm.CompanyCode = _WBS.CompanyCode
and _ProjCstLineItm.IsCommitment = 'X'
and _ProjCstLineItm.FiscalPeriod > '000' // CE2302 - Adding additional checks
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
//2502 Performance improvement for PCR app - Begin - association removed due to introduction of derivation filter for Ledger field in C_Projectcostlineitems
// inner join I_LedgerSourceLedger as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
//2502 Performance improvement for PCR app - End
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
//2502 Performance improvement for PCR app - Begin
// key _SourceLedger.Ledger, //key
key _ProjCstLineItm.SourceLedger as Ledger,
//2502 Performance improvement for PCR app - End
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,
//2408 Performance improvement for Project Cost Report Overview and Line Items-Begin
case
when _ProjCstLineItm.OrderID is not null
then 'OR' end as ProjectObjectType,
//2408 Performance improvement for Project Cost Report Overview and Line Items-End
_ProjCstLineItm.PartnerOrderCategory,
_ProjCstLineItm.PartnerWBSElement,
_ProjCstLineItm.PartnerProject,
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
_WBS.Plant,
_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,
//2502 Include Project Stock costs in Project Cost Report - Begin
//Fields are pushed down from C_Projectcostlineitems
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency as CmtmtCostInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency as CmtmtCostInTransacCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as CmtmtCumltvAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as ActlCmtmtCumltvAmtInGlobCrcy,
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
@DefaultAggregation: #SUM
_ProjCstLineItm.AmountInObjectCurrency as NonAccmltdCmtmtAmtInProjCrcy,
//2502 Include Project Stock costs in Project Cost Report - End
@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,
//2502 Performance improvement for PCR app - Begin - fetch fields from the bottom
_ProjCstLineItm._FiscalCalendarDate.FiscalYear as OriginalFiscalYear,
_ProjCstLineItm._FiscalCalendarDate.FiscalPeriod as OriginalFiscalPeriod,
_ProjCstLineItm._FiscalCalendarDate.FiscalYearPeriod as NextFiscalYearPeriod
//2502 Performance improvement for PCR app - End
}
where
_ProjCstLineItm.OrderID is not initial
// and _ProjCstLineItm.CompanyCode = _WBS.CompanyCode //CE2402:- Fix for commitment is not appearing for miantenance order in PCR when maintenance order company code is differ from WBS Element CompanyCode
and _ProjCstLineItm.IsCommitment = 'X'
and _ProjCstLineItm.FiscalPeriod > '000' // CE2302 - Adding additional checks