@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
@AbapCatalog.preserveKey:true
define view I_ProjectCostLineItemsByPeriod
as select distinct from I_ProjectCostLineItems as _ProjCostSpclPerdTR
left outer join I_ProjectBudgetPlngCategory as _BudgetPlnCat on _BudgetPlnCat.PlanningCatIsForAvailyCtrl = 'X'
association [0..1] to P_PROJCOTMERNGEWTHSPCLPERD as _SpecialPeriod on _ProjCostSpclPerdTR.FiscalYearPeriod = _SpecialPeriod.FiscalYearPeriod
and _ProjCostSpclPerdTR.CompanyCode = _SpecialPeriod.CompanyCode
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_Project as _Project on $projection.Project = _Project.Project
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 I_PPM_Task as _PPMTask on $projection.WBSElementInternalID = _PPMTask.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 _SpecialPeriod.FiscalYear,
@ObjectModel.foreignKey.association: '_JournalEntry'
key AccountingDocument,
key LedgerGLLineItem,
key FinancialPlanningReqTransSqnc,
key FinancialPlanningDataPacket,
@DefaultAggregation: #NONE
key FinancialPlanningEntryItem,
_ProjCostSpclPerdTR.BusinessArea,
_ProjCostSpclPerdTR.FunctionalArea,
ProjectInternalID,
@ObjectModel.foreignKey.association: '_ControllingArea'
ControllingArea,
// @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
case
when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
then ''
else GLAccount
end as GLAccount,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
ChartOfAccounts,
//2008:fields Specific to PMO integration to cost report-start
// OrderID,
// OrderOperation,
// MaintenanceOrderDesc,
// OperationDescription,
// cast(MaintenanceOrderIsSelected as boolean ) as MaintenanceOrderIsSelected,
// PlanningCategory1,
// PlanningCategory2,
//2008:fields Specific to PMO integration to cost report-END
////////////////////////////////////////////////////////////////////////////////////
// G/L additional account assignments
////////////////////////////////////////////////////////////////////////////////////
//S/4HANA CE2108 - Maintenance Order enablement-Begin
OrderID,
cast(MaintenanceOrderIsSelected as boolean ) as MaintenanceOrderIsSelected,
PlanningCategory1,
PlanningCategory2,
//S/4HANA CE2108 - Maintenance Order enablement-End
//S/4HANA CE2302 - Production Order enablement-Begin
ProjectObjectNode,
//S/4HANA CE2302 - Production Order enablement-End
@ObjectModel.foreignKey.association: '_Project'
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,
_SpecialPeriod.FiscalPeriod,
_SpecialPeriod.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,
//S/4HANA CE2108 - Inclusion of Functional Currency -Begin
@Semantics.currencyCode: true
FunctionalCurrency,
//S/4HANA CE2108 - Inclusion of Functional Currency -End
@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,
/*
//S/4HANA CE2308 - Project stock costs enablement - Begin
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
PrjStockAmountInGlobalCurrency,
//S/4HANA CE2308 - Project stock costs enablement - End
*/
//S/4HANA CE2108 - Inclusion of Functional Currency -Begin
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
ActualAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
CmtmtAmountInFunctionalCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency '} }
PlanAmountInFunctionalCurrency,
//S/4HANA CE2108 - Inclusion of Functional Currency -End
@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,
@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
when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory // BUDGET01
then ''
else SemanticTag
end as SemanticTag,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
@DefaultAggregation: #SUM
@UI.lineItem.position: 70
case
when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
then AmountInGlobalCurrency
else 0
end as BudgetInGlobalCrcy,
@Semantics.amount.currencyCode: 'CompanyCodeCurrency'
@DefaultAggregation: #SUM
case
when _ProjCostSpclPerdTR.PlanningCategory =_BudgetPlnCat.PlanningCategory // 'BUDGET01'
then AmountInCompanyCodeCurrency
else 0
end as BudgetAmountInCompanyCodeCrcy,
@Semantics.amount.currencyCode: 'TransactionCurrency'
@DefaultAggregation: #SUM
case
when _ProjCostSpclPerdTR.PlanningCategory =_BudgetPlnCat.PlanningCategory // 'BUDGET01'
then AmountInTransactionCurrency
else 0
end as BudgetAmountInTransactionCrcy,
@Semantics.amount.currencyCode: 'GlobalCurrency'
@DefaultAggregation: #SUM
case
when _ProjCostSpclPerdTR.PlanningCategory = _BudgetPlnCat.PlanningCategory //'BUDGET01'
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,
/////////////////////////////////////////////////////////////////////////////
//Available since CE1908
////////////////////////////////////////////////////////////////////////////
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'}}
AmountInObjectCurrency,
WBSElementInternalID,
ProjectUUID,
_PPMTask.TaskUUID,
_SourceLedger,
_JournalEntry,
_ControllingArea,
_Ledger,
_CompanyCode,
_GLAccountInChartOfAccounts,
_ChartOfAccounts,
_FiscalYear,
_ProfitCenter,
_Project,
_WBSElement,
_FiscalYearVariant,
_PlanningCategory,
_UserName
}