@AbapCatalog.sqlViewName: 'IPROCSTLITMPERD'
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Project Cost Line Items by Period'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
define view I_ProjectCostLineItemsByPeriod
//2502 Performance improvement for PCR app - Begin - association pushed down
as select from I_ProjectCostLineItems as _ProjCostSpclPerdTR
// as select distinct from I_ProjectCostLineItems as _ProjCostSpclPerdTR
// left outer join I_ProjectBudgetPlngCategory as _BudgetPlnCat on _BudgetPlnCat.PlanningCatIsForAvailyCtrl = 'X'
//2502 Performance improvement for PCR app-End
association [0..1] to I_Ledger as _SourceLedger on $projection.SourceLedger = _SourceLedger.Ledger
association [1..1] to I_JournalEntry as _JournalEntry on $projection.CompanyCode = _JournalEntry.CompanyCode
and $projection.FiscalYear = _JournalEntry.FiscalYear
and $projection.AccountingDocument = _JournalEntry.AccountingDocument
association [0..1] to I_ControllingArea as _ControllingArea on $projection.ControllingArea = _ControllingArea.ControllingArea
association [0..1] to I_Ledger as _Ledger on $projection.Ledger = _Ledger.Ledger
association [1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
association [0..1] to I_GLAccountInChartOfAccounts as _GLAccountInChartOfAccounts on $projection.ChartOfAccounts = _GLAccountInChartOfAccounts.ChartOfAccounts
and $projection.GLAccount = _GLAccountInChartOfAccounts.GLAccount
association [1] to I_ChartOfAccounts as _ChartOfAccounts on $projection.ChartOfAccounts = _ChartOfAccounts.ChartOfAccounts
association [0..1] to I_FiscalYearForCompanyCode as _FiscalYear on $projection.FiscalYear = _FiscalYear.FiscalYear
and $projection.CompanyCode = _FiscalYear.CompanyCode
association [0..*] to I_ProfitCenter as _ProfitCenter on $projection.ControllingArea = _ProfitCenter.ControllingArea
and $projection.ProfitCenter = _ProfitCenter.ProfitCenter
association [0..1] to I_ProjectBasicData as _Project on $projection.ProjectInternalID = _Project.ProjectInternalID
association [0..1] to I_WBSElementBasicData as _WBSElement on $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
association [1] to I_FiscalYearVariant as _FiscalYearVariant on $projection.FiscalYearVariant = _FiscalYearVariant.FiscalYearVariant
association [1..1] to I_User as _UserName on $projection.AccountingDocCreatedByUser = _UserName.UserID
association [0..1] to I_PlanningCategory as _PlanningCategory on $projection.PlanningCategory = _PlanningCategory.PlanningCategory
association [1..1] to R_EnterpriseProjectElement as _ProjectElement on $projection.WBSElementInternalID = _ProjectElement.WBSElementInternalID
association [0..*] to I_FiscalYearPeriodText as _FiscalYearPeriodText on $projection.FiscalYearVariant = _FiscalYearPeriodText.FiscalYearVariant
and $projection.FiscalYear = _FiscalYearPeriodText.FiscalYear
and $projection.FiscalPeriod = _FiscalYearPeriodText.FiscalPeriod
{
@ObjectModel.foreignKey.association: '_SourceLedger'
key SourceLedger,
@ObjectModel.foreignKey.association: '_Ledger'
key Ledger,
@ObjectModel.foreignKey.association: '_CompanyCode'
key _ProjCostSpclPerdTR.CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
key _ProjCostSpclPerdTR.OriginalFiscalYear as FiscalYear,
@ObjectModel.foreignKey.association: '_JournalEntry'
key AccountingDocument,
key LedgerGLLineItem,
key FinancialPlanningReqTransSqnc,
key FinancialPlanningDataPacket,
@DefaultAggregation: #NONE
key FinancialPlanningEntryItem,
_ProjCostSpclPerdTR.BusinessArea,
_ProjCostSpclPerdTR.FunctionalArea,
@ObjectModel.foreignKey.association: '_Project'
ProjectInternalID,
@ObjectModel.foreignKey.association: '_ControllingArea'
ControllingArea,
case
//2502 Performance improvement for PCR app-Begin
//when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then ''
else GLAccount
end as GLAccount,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
ChartOfAccounts,
OrderID,
//2408 Performance improvement for Project Cost Report Overview and Line Items-Begin
ProjectObjectType,
//2408 Performance improvement for Project Cost Report Overview and Line Items-End
cast(MaintenanceOrderIsSelected as boolean ) as MaintenanceOrderIsSelected,
PlanningCategory1,
PlanningCategory2,
ProjectObjectNode,
Project,
ProjectDescription,
ProjectProfileCode,
ProjectSummaryTaskUUID,
ProjectCategory,
@ObjectModel.foreignKey.association: '_ProfitCenter'
ProfitCenter,
@ObjectModel.foreignKey.association: '_WBSElement'
WBSElement,
WBSDescription,
WBSElementProfitCenter,
ResponsibleCostCenter,
AccountingDocCreatedByUser,
AvailyCtrlTimeRangeType,
@EndUserText.label: 'Created By'
_UserName.UserDescription,
_ProjCostSpclPerdTR.OriginalFiscalPeriod as FiscalPeriod,
_ProjCostSpclPerdTR.NextFiscalYearPeriod as FiscalYearPeriod,
@ObjectModel.foreignKey.association: '_FiscalYearVariant'
_ProjCostSpclPerdTR.FiscalYearVariant,
@ObjectModel.foreignKey.association: '_PlanningCategory'
_ProjCostSpclPerdTR.PlanningCategory,
@Semantics.currencyCode:true
TransactionCurrency,
@Semantics.currencyCode:true
CompanyCodeCurrency,
@Semantics.currencyCode:true
GlobalCurrency,
@Semantics.currencyCode: true
FunctionalCurrency,
@Semantics.currencyCode:true
ControllingObjectCurrency,
@Semantics.currencyCode:true
FreeDefinedCurrency1,
@Semantics.currencyCode:true
FreeDefinedCurrency2,
@Semantics.currencyCode:true
FreeDefinedCurrency3,
@Semantics.currencyCode:true
FreeDefinedCurrency4,
@Semantics.currencyCode:true
FreeDefinedCurrency5,
@Semantics.currencyCode:true
FreeDefinedCurrency6,
@Semantics.currencyCode:true
FreeDefinedCurrency7,
@Semantics.currencyCode:true
FreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
AmountInTransactionCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
AmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
ActualAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
CmtmtAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
PlanAmountInFunctionalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
AmountInFreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
AmountInFreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
AmountInFreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
AmountInFreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
AmountInFreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
AmountInFreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
AmountInFreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
AmountInFreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ActualAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
PlanAmountInGlobalCurrency,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
CmtmtCostInGlobalCurrency,
// Project currency fields
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ActlCostInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
PlndCostAmtInProjCrcy,
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
@DefaultAggregation: #SUM
CmtmtCostInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
ActualAmountInFreeDfndCrcy1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
ActualAmountInFreeDfndCrcy2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
ActualAmountInFreeDfndCrcy3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
ActualAmountInFreeDfndCrcy4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
ActualAmountInFreeDfndCrcy5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
ActualAmountInFreeDfndCrcy6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
ActualAmountInFreeDfndCrcy7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
ActualAmountInFreeDfndCrcy8,
//2502 Include Project Stock costs in Project Cost Report - Begin
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
PrjStockAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
PrjStockAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
ProjectStockAmtInProjCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
PrjStockAmtInCompanyCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
PrjStockAmtInTransactionCrcy,
//2502 - Fields are pushed down from C_Projectcostlineitems
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
ActualAmountInCompanyCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
ActualAmountInTransactionCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
ActualCumltvAmtInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@Consumption.filter: {hidden: true}
ActlCmtmtCumltvAmtInGlobCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
CmtmtCostInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
CmtmtCostInTransacCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
CmtmtCumltvAmtInGlobCrcy,
//2502 Include Project Stock costs in Project Cost Report - End
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
PlanAmountInFreeDefinedCrcy1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
PlanAmountInFreeDefinedCrcy2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
PlanAmountInFreeDefinedCrcy3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
PlanAmountInFreeDefinedCrcy4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
PlanAmountInFreeDefinedCrcy5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
PlanAmountInFreeDefinedCrcy6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
PlanAmountInFreeDefinedCrcy7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
PlanAmountInFreeDefinedCrcy8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
CmtmtCostInFreeDefinedCrcy1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
CmtmtCostInFreeDefinedCrcy2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
CmtmtCostInFreeDefinedCrcy3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
CmtmtCostInFreeDefinedCrcy4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
CmtmtCostInFreeDefinedCrcy5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
CmtmtCostInFreeDefinedCrcy6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
CmtmtCostInFreeDefinedCrcy7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
CmtmtCostInFreeDefinedCrcy8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
BudgetInProjCrcy,
BudgetCurrencyRole,
//Sending Partner fields
PartnerOrder,
PartnerOrderCategory,
PartnerWBSElement,
PartnerProject,
BusinessTransactionType,
DebitCreditCode,
case
//2502 Performance improvement for PCR app-Begin
//when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory // BUDGET01
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then ''
else SemanticTag
end as SemanticTag,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
@UI.lineItem.position: 70
case
//2502 Performance improvement for PCR app-Begin
//when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then AmountInGlobalCurrency
else 0
end as BudgetInGlobalCrcy,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@DefaultAggregation: #SUM
case
//2502 Performance improvement for PCR app-Begin
// when _ProjCostSpclPerdTR.PlanningCategory =_BudgetPlnCat.PlanningCategory // 'BUDGET01'
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then AmountInCompanyCodeCurrency
else 0
end as BudgetAmountInCompanyCodeCrcy,
@Semantics.amount.currencyCode: 'TransactionCurrency'
@DefaultAggregation: #SUM
case
//2502 Performance improvement for PCR app-Begin
// when _ProjCostSpclPerdTR.PlanningCategory =_BudgetPlnCat.PlanningCategory // 'BUDGET01'
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then AmountInTransactionCurrency
else 0
end as BudgetAmountInTransactionCrcy,
@Semantics.amount.currencyCode: 'GlobalCurrency'
@DefaultAggregation: #SUM
case
//2502 Performance improvement for PCR app-Begin
// when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
when _ProjCostSpclPerdTR.PlanningCategory = BudgetPlanningCategory
//2502 Performance improvement for PCR app-End
then AmountInGlobalCurrency
else 0
end as AccmltdAvailBdgtInGlobalCrcy,
PostingDate,
cast(case
when Ledger is null
then 'X'
else
IsSettled
end as ps_s4_considersettlement) as IsSettled,
SourceReferenceDocumentType,
SourceLogicalSystem,
SourceReferenceDocumentCntxt,
SourceReferenceDocument,
SourceReferenceDocumentItem,
SourceReferenceDocSubitem,
IsCommitment,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'}}
AmountInObjectCurrency,
WBSElementInternalID,
ProjectUUID,
// CE2402: Changes for AO /s4ppm/pr1 - Begin
_ProjCostSpclPerdTR.Plant,
_ProjCostSpclPerdTR.ProjectType,
// CE2402: Changes for AO /s4ppm/pr1 - End
_ProjectElement.ProjectElementUUID as TaskUUID,
_SourceLedger,
_JournalEntry,
_ControllingArea,
_Ledger,
_CompanyCode,
_GLAccountInChartOfAccounts,
_ChartOfAccounts,
_FiscalYear,
_ProfitCenter,
_Project,
_WBSElement,
_FiscalYearVariant,
_PlanningCategory,
_UserName
}