@AbapCatalog.sqlViewName: 'PPRJBYCMTMTBGT'
@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
@EndUserText.label: 'Project Budget Commitment'
define view P_PROJCMTMTBUDGETLINEITMS
as
select from P_ProjectsWithProjCat6 as Project
inner join I_GLAccountLineItemRawData as _ProjCstLineItm on _ProjCstLineItm.ProjectInternalID = Project.ProjectInternalID
//2602 performance change-begin
// inner join I_LedgerSourceLedger as _SourceLedger on _ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
// inner join I_ControllingArea as _ContArea on _ContArea.ControllingArea = _ProjCstLineItm.ControllingArea
//2602 performance change-end
inner join P_PROJECTSEMTAGACC as _SemTagGL on _ProjCstLineItm.ControllingArea = _SemTagGL.ControllingArea
and _ProjCstLineItm.GLAccount = _SemTagGL.HierarchyNodeVal
and _ProjCstLineItm.ChartOfAccounts = _SemTagGL.HierarchyNodeClass
inner join P_GetRlvtSemanticTagForProj as _AllCost on _AllCost.ProjectInternalID = _ProjCstLineItm.ProjectInternalID
left outer to one join I_WBSElementBasicData as _WBSElementBasicData on _ProjCstLineItm.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
//2602 performance change - begin
and Project.ProjectInternalID = _WBSElementBasicData.ProjectInternalID
//2602 performance change - end
left outer to one join I_EnterpriseProject as _ProjectSummary on _ProjectSummary.ProjectInternalID = _ProjCstLineItm.ProjectInternalID
association [0..1] to I_FiscalPeriodForVariant as _FiscalPeriod on $projection.LedgerFiscalYear = _FiscalPeriod.FiscalYear
and $projection.FiscalPeriod = _FiscalPeriod.FiscalPeriod
and $projection.FiscalYearVariant = _FiscalPeriod.FiscalYearVariant
{
key _ProjCstLineItm.SourceLedger,
//2602 performance change - start
//key _SourceLedger.Ledger,
//2602 performance change - end
key _ProjCstLineItm.SourceLedger as Ledger,
key case
when _ProjCstLineItm.CompanyCode is initial or _ProjCstLineItm.CompanyCode is null
then _WBSElementBasicData.CompanyCode
else _ProjCstLineItm.CompanyCode end as CompanyCode,
key _ProjCstLineItm.FiscalYear,
key _ProjCstLineItm.AccountingDocument,
key cast( '00000000000000000000000' as fis_fp_request_tsn preserving type ) as FinancialPlanningReqTransSqnc,
key cast( '000000' as fis_fp_data_packet preserving type ) as FinancialPlanningDataPacket,
key cast( LedgerGLLineItem as fis_act_pln_docln) as ActualPlanJournalEntryItem,
_ProjCstLineItm.LedgerFiscalYear,
_ProjCstLineItm.LedgerGLLineItem,
cast( 0 as fis_fp_entry_item ) as FinancialPlanningEntryItem,
_ProjCstLineItm.GLAccount,
_ProjCstLineItm.ChartOfAccounts,
_ProjCstLineItm.AccountingDocCreatedByUser,
_SemTagGL.GLAccountHierarchy,
_ProjCstLineItm.BusinessArea,
_ProjCstLineItm.CostCenter,
cast(' ' as budget_process preserving type ) as BudgetProcess,
_ProjCstLineItm.PartnerOrder,
_ProjCstLineItm.PartnerOrderCategory,
// S/4 Hana CE2302- Field Deprecation - Begin
// _ProjCstLineItm.PartnerWBSElement,
_ProjCstLineItm._PartnerWBSElementBasicData.WBSElementExternalID as PartnerWBSElement,
// _ProjCstLineItm.PartnerProject,
_ProjCstLineItm._PartnerProjectBasicData.ProjectExternalID as PartnerProject,
// S/4 Hana CE2302- Field Deprecation - End
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
case
when _ProjCstLineItm.ProfitCenter is initial or _ProjCstLineItm.ProfitCenter is null
then _WBSElementBasicData.ProfitCenter
else _ProjCstLineItm.ProfitCenter end as ProfitCenter,
_WBSElementBasicData.ProfitCenter as WBSElementProfitCenter,
_WBSElementBasicData.WBSDescription,
_WBSElementBasicData.WBSElementObject as ProjectObjectNode,
// S/4 HANA CE2208: mapping change for coding mask- start
//_ProjCstLineItm.WBSElement,
_WBSElementBasicData.WBSElementExternalID as WBSElement,
// S/4 HANA CE2208: mapping change for coding mask - end
_WBSElementBasicData.ResponsibleCostCenter,
// S/4HANA CE2202: Project Type normalization - Begin
_WBSElementBasicData.ProjectType,
// S/4HANA CE2202: Project Type normalization - End
_ProjCstLineItm.WBSElementInternalID,
// S/4 HANA CE2208: mapping change for coding mask - start
//Project.ControllingArea,
_ProjCstLineItm.ControllingArea,
//_ProjCstLineItm.Project,
Project.ProjectExternalID as Project,
//CE2402: Add Plant fied for /S4PPM/PR1 Auth
_WBSElementBasicData.Plant,
//_ProjCstLineItm.ProjectInternalID,
Project.ProjectInternalID,
// S/4 HANA CE2208: mapping change for coding mask - end
_ProjectSummary.Project as ProjectExternalID,
//2602 performance change - begin
// Project.ProjectDescription,
// Project.ProjectProfileCode,
// Project.ProjectObject,
// Project.AvailabilityControlProfile,
// Project.AvailabilityControlIsActive,
// Project._AvailabilityCtrlProfile._SemanticTag.SemanticTag as ParentSemanticTag,
// Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
// Project._AvailabilityCtrlProfile.BudgetCurrencyRole,
// Project.ProjectCurrency,
_ProjCstLineItm._ProjectBasicData.ProjectDescription,
_ProjCstLineItm._ProjectBasicData.ProjectProfileCode,
_ProjCstLineItm._ProjectBasicData.ProjectObject,
_ProjCstLineItm._ProjectBasicData.AvailabilityControlProfile,
_ProjCstLineItm._ProjectBasicData.AvailabilityControlIsActive,
_ProjCstLineItm._ProjectBasicData._AvailabilityCtrlProfile._SemanticTag.SemanticTag as ParentSemanticTag,
_ProjCstLineItm._ProjectBasicData._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
_ProjCstLineItm._ProjectBasicData._AvailabilityCtrlProfile.BudgetCurrencyRole,
_ProjCstLineItm._ProjectBasicData.ProjectCurrency,
//2602 performance change - end
_ProjectSummary.ProjectSummaryTaskUUID,
'6' as ProjectCategory,
_ProjectSummary.ProjectUUID,
_ProjectSummary.ProcessingStatus,
_ProjectSummary.ProjectSummaryTaskUUID as TaskUUID,
_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,
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
@DefaultAggregation: #SUM
_ProjCstLineItm.AmountInFunctionalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as CmtmtCostInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
_ProjCstLineItm.AmountInObjectCurrency as CmtmtCostInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
_ProjCstLineItm.AmountInFunctionalCurrency as CmtmtAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency as CmtmtCostInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency as CmtmtCostInTransacCrcy,
cast( cast( 'CMTMT' as abap.char( 10 )) as fcom_category) as PlanningCategory,
_ProjCstLineItm.PostingDate,
_ProjCstLineItm.DocumentDate,
_ProjCstLineItm.FiscalPeriod,
_ProjCstLineItm.FiscalYearPeriod,
_ProjCstLineItm.FiscalYearVariant,
case
//S/4HANA CE2308 - Performence tuning Begin
when ( _ProjCstLineItm.ControllingDebitCreditCode <> 'A' and _ProjCstLineItm.ControllingDebitCreditCode <> 'S' )
or ( _ProjCstLineItm.ControllingDebitCreditCode = 'S' and ( _ProjCstLineItm.BusinessTransactionType <> 'KOAO' and _ProjCstLineItm.BusinessTransactionType <> 'KOAE' ) )
or ( _ProjCstLineItm.ControllingDebitCreditCode = 'S' and (_ProjCstLineItm.BusinessTransactionType = 'KOAO' or _ProjCstLineItm.BusinessTransactionType = 'KOAE')
and ( _ProjCstLineItm.PartnerProject <> _ProjCstLineItm.Project and ( _ProjCstLineItm.PartnerProject <> ' ' or _ProjCstLineItm.PartnerOrder <> ' ' or _ProjCstLineItm.PartnerSalesDocument <> ' ' or
_ProjCstLineItm.PartnerProjectNetwork <> ' ' or _ProjCstLineItm.PartnerProjectNetworkActivity <> ' ' or
_ProjCstLineItm.PartnerBusinessProcess <> ' ' or _ProjCstLineItm.PartnerCostObject <> ' ') )
)
then 'X'
//S/4HANA CE2308 - Performence tuning End
end as IsSettled,
_ProjCstLineItm.SourceReferenceDocumentType,
_ProjCstLineItm.SourceLogicalSystem,
_ProjCstLineItm.SourceReferenceDocumentCntxt,
_ProjCstLineItm.SourceReferenceDocument,
_ProjCstLineItm.SourceReferenceDocumentItem,
_ProjCstLineItm.SourceReferenceDocSubitem,
_ProjCstLineItm.IsCommitment,
//S/4HANA CE2302 - Maintenance Order enablement-Begin
_ProjCstLineItm.OrderID,
cast( 'X' as boolean ) as MaintenanceOrderIsSelected,
//S/4HANA CE2302 - Maintenance Order enablement-End
_SemTagGL.SemanticTag,
_AllCost.SemanticTagIsBudgetRelevant,
_AllCost.SemanticTagIsBudgetRelevant as ObjectIsBudgeted,
_AllCost.ProjectIsBudgetRelevant,
// //2602 performance change - begin
// '' as ProjectObjectType,
// //2602 performance change - end
_FiscalPeriod
}
where
//2602 performance change - begin
// _SemTagGL.GLAccountHierarchy = _ContArea.CtrlgStdFinStatementVersion
// and _ContArea.CtrlgStdFinStatementVersion is not initial
// and(
// _SourceLedger.Ledger = _ProjCstLineItm.SourceLedger
// )
// Project.Project != '' // //2602 performance change
// and(
// _SemTagGL.ValidityStartDate <= $session.system_date
// and _SemTagGL.ValidityEndDate >= $session.system_date
// )
// and //2602 performance change - begin
_SemTagGL.SemanticTag = _AllCost.SemanticTag
// and _AllCost.FinancialStatementVariant = _ContArea.CtrlgStdFinStatementVersion
//2602 performance change - end
and _AllCost.FinancialStatementVariant = _SemTagGL.GLAccountHierarchy
and Project.ProjectProfileCode <> 'YP01'
and _ProjectSummary.ProjectInternalID = _ProjCstLineItm.ProjectInternalID
and _ProjCstLineItm.IsCommitment = 'X'
//S/4HANA CE2302 - Include only relevant project costs -Begin
and ( _ProjCstLineItm.AccountAssignmentType = 'PR'
or _ProjCstLineItm.AccountAssignmentType = 'KS' )
//S/4HANA CE2302 - Include only relevant project costs -End
and _ProjCstLineItm.JointVentureAccountingActivity != 'CI'
//S/4HANA CE2302 - Exclude Balance Carry Forward amount -Begin
and _ProjCstLineItm.FiscalPeriod > '000'
//S/4HANA CE2302 - Exclude Balance Carry Forward amount -End
//S/4HANA CE2302 - Maintenance Order enablement-Begin
union all
//2602 performance change
//select from I_GLAccountLineItemRawData as ProjCstLineItm
select from
P_ProjectsWithProjCat6 as _Project
inner join I_MaintenanceOrder as _Orders on _Orders.ProjectInternalID = _Project.ProjectInternalID //ProjCstLineItm.OrderID
and _Orders.MaintenanceOrder is not initial //2602 performance change - and condition added
inner join I_GLAccountLineItemRawData as ProjCstLineItm on ProjCstLineItm.OrderID = _Orders.MaintenanceOrder
//2602 performance changes - begin
// inner join P_ProjectsWithProjCat6 as _Project on _Orders.ProjectInternalID = _Project.ProjectInternalID
// inner join I_LedgerSourceLedger as _SourceLedger on ProjCstLineItm.SourceLedger = _SourceLedger.SourceLedger
// inner join I_ControllingArea as _ContArea on _ContArea.ControllingArea = ProjCstLineItm.ControllingArea
//2602 performance changes - end
inner join P_PROJECTSEMTAGACC as _SemTagGL on ProjCstLineItm.ControllingArea = _SemTagGL.ControllingArea
and ProjCstLineItm.GLAccount = _SemTagGL.HierarchyNodeVal
and ProjCstLineItm.ChartOfAccounts = _SemTagGL.HierarchyNodeClass
inner join P_GetRlvtSemanticTagForProj as _AllCost on _AllCost.ProjectInternalID = _Orders.ProjectInternalID
left outer to one join I_WBSElementBasicData as _WBSElementBasicData on _Orders.WBSElementInternalID = _WBSElementBasicData.WBSElementInternalID
and _Project.ProjectInternalID = _WBSElementBasicData.ProjectInternalID //2602 performance changes
left outer to one join I_EnterpriseProject as _ProjectSummary on _ProjectSummary.ProjectInternalID = _Orders.ProjectInternalID
association [0..1] to I_FiscalPeriodForVariant as _FiscalPeriod on $projection.LedgerFiscalYear = _FiscalPeriod.FiscalYear
and $projection.FiscalPeriod = _FiscalPeriod.FiscalPeriod
and $projection.FiscalYearVariant = _FiscalPeriod.FiscalYearVariant
{
key ProjCstLineItm.SourceLedger,
//2602 performance change - begin
//key _SourceLedger.Ledger,
key ProjCstLineItm.SourceLedger as Ledger,
//2602 performance change - end
key case
when ProjCstLineItm.CompanyCode is initial or ProjCstLineItm.CompanyCode is null
then _WBSElementBasicData.CompanyCode
else ProjCstLineItm.CompanyCode end as CompanyCode,
key ProjCstLineItm.FiscalYear,
key ProjCstLineItm.AccountingDocument,
key cast( '00000000000000000000000' as fis_fp_request_tsn preserving type ) as FinancialPlanningReqTransSqnc,
key cast( '000000' as fis_fp_data_packet preserving type ) as FinancialPlanningDataPacket,
key cast( LedgerGLLineItem as fis_act_pln_docln) as ActualPlanJournalEntryItem,
ProjCstLineItm.LedgerFiscalYear,
ProjCstLineItm.LedgerGLLineItem,
cast( 0 as fis_fp_entry_item ) as FinancialPlanningEntryItem,
ProjCstLineItm.GLAccount,
ProjCstLineItm.ChartOfAccounts,
ProjCstLineItm.AccountingDocCreatedByUser,
_SemTagGL.GLAccountHierarchy,
ProjCstLineItm.BusinessArea,
ProjCstLineItm.CostCenter,
cast(' ' as budget_process preserving type ) as BudgetProcess,
ProjCstLineItm.PartnerOrder,
ProjCstLineItm.PartnerOrderCategory,
// S/4 Hana CE2302- Field Deprecation - Begin
// ProjCstLineItm.PartnerWBSElement,
ProjCstLineItm._PartnerWBSElementBasicData.WBSElementExternalID as PartnerWBSElement,
// ProjCstLineItm.PartnerProject,
ProjCstLineItm._PartnerProjectBasicData.ProjectExternalID as PartnerProject,
// S/4 Hana CE2302- Field Deprecation - End
ProjCstLineItm.BusinessTransactionType,
ProjCstLineItm.DebitCreditCode,
ProjCstLineItm.ControllingDebitCreditCode,
case
when ProjCstLineItm.ProfitCenter is initial or ProjCstLineItm.ProfitCenter is null
then _WBSElementBasicData.ProfitCenter
else ProjCstLineItm.ProfitCenter end as ProfitCenter,
_WBSElementBasicData.ProfitCenter as WBSElementProfitCenter,
_WBSElementBasicData.WBSDescription,
//S/4HANA CE2302 - Maintenance Order enablement-Begin
ProjCstLineItm.OrderID as ProjectObjectNode,
//S/4HANA CE2302 - Maintenance Order enablement-End
// S/4 HANA CE2208: mapping change for coding mask- start
//ProjCstLineItm.WBSElement,
_WBSElementBasicData.WBSElementExternalID as WBSElement,
// S/4 HANA CE2208: mapping change for coding mask - end
_WBSElementBasicData.ResponsibleCostCenter,
// S/4HANA CE2202: Project Type normalization - Begin
_WBSElementBasicData.ProjectType,
// S/4HANA CE2202: Project Type normalization - End
_Orders.WBSElementInternalID, //CE2302 Maintenace order - WBSElement Internal ID
// S/4 HANA CE2208: mapping change for coding mask - start
//_Project.ControllingArea,
ProjCstLineItm.ControllingArea,
//ProjCstLineItm.Project,
_Project.ProjectExternalID as Project,
//CE2402: Add Plant fied for /S4PPM/PR1 Auth
_WBSElementBasicData.Plant,
//ProjCstLineItm.ProjectInternalID,
_Project.ProjectInternalID,
// S/4 HANA CE2208: mapping change for coding mask - end
_ProjectSummary.Project as ProjectExternalID,
_Project.ProjectDescription,
_Project.ProjectProfileCode,
_Project.ProjectObject,
_Project.AvailabilityControlProfile,
_Project.AvailabilityControlIsActive,
_Project._AvailabilityCtrlProfile._SemanticTag.SemanticTag as ParentSemanticTag,
_Project._AvailabilityCtrlProfile.AvailyCtrlTimeRangeType,
_Project._AvailabilityCtrlProfile.BudgetCurrencyRole,
_Project.ProjectCurrency,
_ProjectSummary.ProjectSummaryTaskUUID,
'6' as ProjectCategory,
_ProjectSummary.ProjectUUID,
_ProjectSummary.ProcessingStatus,
_ProjectSummary.ProjectSummaryTaskUUID as TaskUUID,
ProjCstLineItm.CreationDate,
ProjCstLineItm.FunctionalArea,
ProjCstLineItm.CostCtrActivityType,
@Semantics.currencyCode: true
//S/4HANA CE2302 - Maintenance Order enablement-Start
//Maintenace order doesn't have object currency
_Project.ProjectCurrency as ControllingObjectCurrency,
//S/4HANA CE2302 - Maintenance Order enablement-End
@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,
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
@DefaultAggregation: #SUM
ProjCstLineItm.AmountInFunctionalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ProjCstLineItm.AmountInGlobalCurrency as CmtmtCostInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjCstLineItm.AmountInObjectCurrency as CmtmtCostInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
ProjCstLineItm.AmountInFunctionalCurrency as CmtmtAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
ProjCstLineItm.AmountInCompanyCodeCurrency as CmtmtCostInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ProjCstLineItm.AmountInTransactionCurrency as CmtmtCostInTransacCrcy,
cast( cast( 'CMTMT' as abap.char( 10 )) as fcom_category) as PlanningCategory,
ProjCstLineItm.PostingDate,
ProjCstLineItm.DocumentDate,
ProjCstLineItm.FiscalPeriod,
ProjCstLineItm.FiscalYearPeriod,
ProjCstLineItm.FiscalYearVariant,
case
//S/4HANA CE2308 - Performence tuning Begin
when ( ProjCstLineItm.ControllingDebitCreditCode <> 'A' and ProjCstLineItm.ControllingDebitCreditCode <> 'S' )
or ( ProjCstLineItm.ControllingDebitCreditCode = 'S' and ( ProjCstLineItm.BusinessTransactionType <> 'KOAO' and ProjCstLineItm.BusinessTransactionType <> 'KOAE' ) )
or ( ProjCstLineItm.ControllingDebitCreditCode = 'S' and ( ProjCstLineItm.BusinessTransactionType = 'KOAO' or ProjCstLineItm.BusinessTransactionType = 'KOAE')
and ( ProjCstLineItm.PartnerProject <> ProjCstLineItm.Project and ( ProjCstLineItm.PartnerProject <> ' ' or ProjCstLineItm.PartnerOrder <> ' ' or ProjCstLineItm.PartnerSalesDocument <> ' ' or
ProjCstLineItm.PartnerProjectNetwork <> ' ' or ProjCstLineItm.PartnerProjectNetworkActivity <> ' ' or
ProjCstLineItm.PartnerBusinessProcess <> ' ' or ProjCstLineItm.PartnerCostObject <> ' ') )
)
then 'X'
//S/4HANA CE2308 - Performence tuning End
end as IsSettled,
ProjCstLineItm.SourceReferenceDocumentType,
ProjCstLineItm.SourceLogicalSystem,
ProjCstLineItm.SourceReferenceDocumentCntxt,
ProjCstLineItm.SourceReferenceDocument,
ProjCstLineItm.SourceReferenceDocumentItem,
ProjCstLineItm.SourceReferenceDocSubitem,
ProjCstLineItm.IsCommitment,
//S/4HANA CE2302 - Maintenance Order enablement-Begin
ProjCstLineItm.OrderID,
cast( ' ' as boolean ) as MaintenanceOrderIsSelected,
//S/4HANA CE2302 - Maintenance Order enablement-End
_SemTagGL.SemanticTag,
_AllCost.SemanticTagIsBudgetRelevant,
_AllCost.SemanticTagIsBudgetRelevant as ObjectIsBudgeted,
_AllCost.ProjectIsBudgetRelevant,
//2602 performance change - begin
// case
// when ProjCstLineItm.OrderID is not null
// then 'OR' end as ProjectObjectType,
//2602 performance change - end
_FiscalPeriod
}
where
//2602 performance change - begin
// _SemTagGL.GLAccountHierarchy = _ContArea.CtrlgStdFinStatementVersion
// and _ContArea.CtrlgStdFinStatementVersion is not initial
// and(
// _SourceLedger.Ledger = ProjCstLineItm.SourceLedger
// )
// _Project.Project != '' //2602 performance change - begin
// and(
// _SemTagGL.ValidityStartDate <= $session.system_date
// and _SemTagGL.ValidityEndDate >= $session.system_date
// )
// and //2602 performance change - begin
_SemTagGL.SemanticTag = _AllCost.SemanticTag
and _AllCost.FinancialStatementVariant = _SemTagGL.GLAccountHierarchy
// and _AllCost.FinancialStatementVariant = _ContArea.CtrlgStdFinStatementVersion
//2602 performance change - end
and _Project.ProjectProfileCode <> 'YP01'
and _ProjectSummary.ProjectInternalID = _Orders.ProjectInternalID
and ProjCstLineItm.IsCommitment = 'X'
and ProjCstLineItm.AccountAssignmentType = 'OR' //S/4HANA CE2302 - Maintenance Order enablement
and ProjCstLineItm.JointVentureAccountingActivity != 'CI'
//S/4HANA CE2302 - Maintenance Order enablement-End
//S/4HANA CE2302 - Exclude Balance Carry Forward amount -Begin
and ProjCstLineItm.FiscalPeriod > '000'
//S/4HANA CE2302 - Exclude Balance Carry Forward amount -End
//2602 performance change - begin
and ( ProjCstLineItm.ProjectInternalID = _Project.ProjectInternalID
or ProjCstLineItm.ProjectInternalID is initial )
and ProjCstLineItm.OrderID is not initial
//2602 performance change - end