@AbapCatalog.sqlViewName: 'PPROJACTCOSTITEM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@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_ProjectActualCostLineItem
with parameters
P_ProjectObjectRootNode : j_objnr
as select from I_GLAccountLineItemRawData as _ProjCstLineItm
inner join P_ProjectObject_2 as _hierachyData on _ProjCstLineItm.ControllingObject = _hierachyData.ProjectObjectNode
and _ProjCstLineItm.ControllingObject <> ''
and _hierachyData.ProjectObjectRootNode = $parameters.P_ProjectObjectRootNode
association [0..*] to I_VirtualPlanningCategory as _VirtualPlanningCategory on $projection.PlanningCategory = _VirtualPlanningCategory.SourcePlanningCategory
association to I_WBSElementData_2 as _WBSElement on _hierachyData.ProjectObjectNode = _WBSElement.WBSElementObject
association to I_NetworkActivityForCostReport as _NetworkActivity on _hierachyData.ProjectObjectNode = _NetworkActivity.NetworkActivityObject
association to I_ProjectNetwork as _ProjectNetwork on _hierachyData.ProjectObjectNode = _ProjectNetwork.ProjectNetworkObject
association to I_ProjectNetwork as _PartnerProjectNetwork on $projection.PartnerProjectNetwork = _PartnerProjectNetwork.ProjectNetwork
association to I_MaintenanceOrder as _PMOrder on _hierachyData.ProjectObjectNode = _PMOrder.MaintenanceOrderInternalID
association to I_MaintenanceOrder as _PartnerPMOrder on $projection.PartnerOrder = _PartnerPMOrder.MaintenanceOrder
association to I_InternalOrder as _PartnerIOrder on $projection.PartnerOrder = _PartnerIOrder.InternalOrder
association to I_InternalOrder as _InternalOrder on $projection.InternalOrder = _InternalOrder.InternalOrder
{
key _ProjCstLineItm.SourceLedger,
key _ProjCstLineItm.SourceLedger as Ledger,
key _ProjCstLineItm.CompanyCode,
key _ProjCstLineItm.FiscalYear,
key _ProjCstLineItm.AccountingDocument,
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( LedgerGLLineItem as fis_act_pln_docln) as ActualPlanJournalEntryItem,
_ProjCstLineItm.LedgerFiscalYear,
_ProjCstLineItm.LedgerGLLineItem,
@Aggregation.default: #NONE
cast(cast( 0 as abap.int4 ) as fis_fp_entry_item ) as FinancialPlanningEntryItem,
cast(cast( 'A' as abap.char (1)) as fis_actual_plan_code) as ActualPlanCode,
_ProjCstLineItm.AccountingDocCreatedByUser,
_ProjCstLineItm.BusinessArea,
_ProjCstLineItm.PartnerOrder,
// _ProjCstLineItm.OrderID,
case
when _hierachyData.ProjectObjectType = 'OR'
then
_ProjCstLineItm.OrderID
else
''
end as OrderID,
_ProjCstLineItm.OrderOperation,
_ProjCstLineItm.OrderSuboperation,
' ' as MaintenanceOrderDesc,
_ProjCstLineItm.PartnerAccountAssignmentType,
'' as OperationDescription,
_ProjCstLineItm.PartnerOrderCategory,
_hierachyData.ProjectObjectType as ProjectObjectType,
case
when _hierachyData.ProjectObjectType = 'PR'
then _ProjCstLineItm.PartnerWBSElement
when _hierachyData.ProjectObjectType = 'OR'
then _ProjCstLineItm.PartnerOrder
when _hierachyData.ProjectObjectType = 'NV' or _hierachyData.ProjectObjectType = 'EL'
or _hierachyData.ProjectObjectType = 'NP'
then _ProjCstLineItm.PartnerProjectNetwork
end as ProjectPartnerObject,
_ProjCstLineItm.PartnerProjectNetwork,
case
when _hierachyData.ProjectObjectType = 'PR' or _hierachyData.ProjectObjectType = 'OR'
or _hierachyData.ProjectObjectType = 'NP'
then ''
when _hierachyData.ProjectObjectType = 'NV' or _hierachyData.ProjectObjectType = 'EL'
then _hierachyData.ProjectObjectType
end as PartnerProjectNetworkActivity,
case
when _hierachyData.ProjectObjectType = 'IO'
then
_ProjCstLineItm.OrderID
else
''
end as InternalOrder,
case
when _hierachyData.ProjectObjectType = 'PP'
then
_ProjCstLineItm.OrderID
else
''
end as ProductionOrder,
_ProjCstLineItm.Product,
case
when _hierachyData.ProjectObjectType = 'SV'
then
_ProjCstLineItm.ServiceDocument
else
''
end as ServiceOrder,
case
when _hierachyData.ProjectObjectType = 'SV'
then
_ProjCstLineItm.ServiceDocumentItem
else
''
end as ServiceOrderItem,
case
when _hierachyData.ProjectObjectType = 'SC'
then
_ProjCstLineItm.ServiceDocument
else
''
end as ServiceContract,
case
when _hierachyData.ProjectObjectType = 'SC'
then
_ProjCstLineItm.ServiceDocumentItem
else
''
end as ServiceContractItem,
_ProjCstLineItm.PartnerProject,
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
_hierachyData.WBSElement,
_ProjCstLineItm.ProjectNetwork as ProjectNetwork,
_NetworkActivity.NetworkActivity,
_NetworkActivity.NetworkActivityElement as NetworkActivityElement,
_hierachyData.ProjectObjectExternalID,
case
when _hierachyData.ProjectObjectType = 'PR' or _hierachyData.ProjectObjectType = 'OR' or
_hierachyData.ProjectObjectType = 'NP'
then ''
when _hierachyData.ProjectObjectType = 'NV' or _hierachyData.ProjectObjectType = 'EL'
then _ProjCstLineItm.RelatedNetworkActivity
end as ProjectNetworkActivity,
_hierachyData.Project,
_ProjCstLineItm.ProjectInternalID,
case
when _hierachyData.ProjectObjectType = 'PR'
then _ProjCstLineItm.WBSElementInternalID
when _hierachyData.ProjectObjectType = 'OR' or _hierachyData.ProjectObjectType = 'PP'
then _ProjCstLineItm.OrderID
when _hierachyData.ProjectObjectType= 'NV' or _hierachyData.ProjectObjectType = 'EL'
or _hierachyData.ProjectObjectType = 'NP'
then _ProjCstLineItm.ProjectNetwork
end as ObjectInternalID,
_ProjCstLineItm.ControllingArea,
_ProjCstLineItm.GLAccount,
_ProjCstLineItm.ChartOfAccounts,
_ProjCstLineItm.CostCenter,
_ProjCstLineItm.ProfitCenter,
_ProjCstLineItm.CreationDate,
_ProjCstLineItm.FunctionalArea,
_ProjCstLineItm.CostCtrActivityType,
_ProjCstLineItm.OriginCostCtrActivityType,
_ProjCstLineItm.OriginCostCenter,
@Semantics.currencyCode: true
_ProjCstLineItm.ControllingObjectCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'ControllingObjectCurrency'
_ProjCstLineItm.AmountInObjectCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.TransactionCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.CompanyCodeCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.GlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency,
@Semantics.currencyCode: true
_ProjCstLineItm.FunctionalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
_ProjCstLineItm.AmountInFunctionalCurrency as ActualAmountInFunctionalCrcy,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as ActualAmountInGlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
_ProjCstLineItm.AmountInObjectCurrency as ActlCostInProjCrcy,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1 as ActualAmountInFreeDfndCrcy1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2 as ActualAmountInFreeDfndCrcy2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3 as ActualAmountInFreeDfndCrcy3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4 as ActualAmountInFreeDfndCrcy4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5 as ActualAmountInFreeDfndCrcy5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6 as ActualAmountInFreeDfndCrcy6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7 as ActualAmountInFreeDfndCrcy7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8 as ActualAmountInFreeDfndCrcy8,
_ProjCstLineItm.SourceReferenceDocumentType,
_ProjCstLineItm.SourceLogicalSystem,
_ProjCstLineItm.SourceReferenceDocumentCntxt,
_ProjCstLineItm.SourceReferenceDocument,
_ProjCstLineItm.SourceReferenceDocumentItem,
_ProjCstLineItm.SourceReferenceDocSubitem,
_ProjCstLineItm.IsCommitment,
_ProjCstLineItm.PartnerProfitCenter,
_ProjCstLineItm.PartnerCompanyCode,
case
when ControllingDebitCreditCode = 'A'
then cast( '' as ps_s4_considersettlement preserving type )
when ControllingDebitCreditCode = 'S' and
(BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
( _PartnerProjectNetwork._Project.ProjectObject = _hierachyData.ProjectObjectRootNode )
or ( _PartnerPMOrder._Project.ProjectObject = _hierachyData.ProjectObjectRootNode )
or ( _PartnerIOrder._WBSElementBasicData._Project.ProjectObject = _hierachyData.ProjectObjectRootNode )
then cast( '' as ps_s4_considersettlement preserving type )
when ControllingDebitCreditCode = 'S' and
(BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
( PartnerProject = ' ' and PartnerOrder = ' ' and PartnerSalesDocument = ' ' and PartnerProjectNetwork = ' '
and PartnerProjectNetworkActivity = ' ' and PartnerBusinessProcess = ' ' and PartnerCostObject = ' '
and PartnerAccountAssignment = ' ')
then cast( '' as ps_s4_considersettlement preserving type )
when ControllingDebitCreditCode = 'S' and (BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
(PartnerProject = _ProjCstLineItm.Project)
then cast( '' as ps_s4_considersettlement preserving type )
when ControllingDebitCreditCode = 'S' and (BusinessTransactionType = 'KOAO' or BusinessTransactionType = 'KOAE') and
(PartnerAccountAssignmentType = 'OR') and (PartnerProject = _ProjCstLineItm.Project)
then cast( '' as ps_s4_considersettlement preserving type )
else cast( 'X' as ps_s4_considersettlement preserving type )
end as IsSettled,
cast( cast( 'ACT01' 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,
case
when _hierachyData.ProjectObjectType = 'PR'
then _hierachyData.ProjectObjectType
when _hierachyData.ProjectObjectType = 'OR' or _hierachyData.ProjectObjectType = 'OV'
then cast( 'OR' as ps_s4_projselobj )
when _hierachyData.ProjectObjectType = 'NV' or _hierachyData.ProjectObjectType = 'EL' or
_hierachyData.ProjectObjectType = 'NP'
then cast( 'ZZ' as ps_s4_projselobj )
when _hierachyData.ProjectObjectType = 'IO'
then _hierachyData.ProjectObjectType
when _hierachyData.ProjectObjectType = 'SV'
then _hierachyData.ProjectObjectType
when _hierachyData.ProjectObjectType = 'SC'
then _hierachyData.ProjectObjectType
when _hierachyData.ProjectObjectType = 'PP'
then _hierachyData.ProjectObjectType
end as ProjectSelectedObject,
_hierachyData.ProjectObjectProfitCenter,
_hierachyData.ProjectObjectDescription,
// _ProjCstLineItm.ControllingObject as ProjectObjectNode,
_hierachyData.ProjectObjectNode,
_hierachyData.ProjectObjectRootNode,
_hierachyData.ResponsibleCostCenter,
_hierachyData.ProjectType,
_hierachyData.OrderType,
_VirtualPlanningCategory,
//_Project,
_WBSElement,
_ProjectNetwork,
_NetworkActivity,
_PMOrder,
_InternalOrder
}
where
ProjectObjectRootNode = $parameters.P_ProjectObjectRootNode
// and _ProjCstLineItm.BusinessTransactionType <> 'TBRR'
//
//StatisticalWBSElement Logic
union all select from I_GLAccountLineItemRawData as _ProjCstLineItm
inner join I_WBSElementData_2 as WBSElement on WBSElement.WBSElementInternalID = _ProjCstLineItm.WBSElementInternalID
and WBSElement.WBSIsStatisticalWBSElement = 'X'
and _ProjCstLineItm.WBSElementInternalID <> '00000000'
inner join I_ProjectData_2 as Project on WBSElement.ProjectInternalID = Project.ProjectInternalID
and Project.ProjectObject = $parameters.P_ProjectObjectRootNode
association [0..*] to I_VirtualPlanningCategory as _VirtualPlanningCategory on $projection.PlanningCategory = _VirtualPlanningCategory.SourcePlanningCategory
association to I_WBSElementData_2 as _WBSElement on WBSElement.WBSElementObject = _WBSElement.WBSElementObject
association to I_NetworkActivityForCostReport as _NetworkActivity on WBSElement.WBSElementObject = _NetworkActivity.NetworkActivityObject
association to I_ProjectNetwork as _ProjectNetwork on WBSElement.WBSElementObject = _ProjectNetwork.ProjectNetworkObject
association to I_MaintenanceOrder as _PMOrder on WBSElement.WBSElementObject = _PMOrder.MaintenanceOrderInternalID
association to I_InternalOrder as _InternalOrder on $projection.InternalOrder = _InternalOrder.InternalOrder
{
key _ProjCstLineItm.SourceLedger,
key _ProjCstLineItm.SourceLedger as Ledger,
key _ProjCstLineItm.CompanyCode,
key _ProjCstLineItm.FiscalYear,
key _ProjCstLineItm.AccountingDocument,
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( LedgerGLLineItem as fis_act_pln_docln) as ActualPlanJournalEntryItem,
_ProjCstLineItm.LedgerFiscalYear,
_ProjCstLineItm.LedgerGLLineItem,
@Aggregation.default: #NONE
cast(cast( 0 as abap.int4 ) as fis_fp_entry_item ) as FinancialPlanningEntryItem,
cast(cast( 'A' as abap.char (1)) as fis_actual_plan_code) as ActualPlanCode,
_ProjCstLineItm.AccountingDocCreatedByUser,
_ProjCstLineItm.BusinessArea,
_ProjCstLineItm.PartnerOrder,
_ProjCstLineItm.OrderID,
_ProjCstLineItm.OrderOperation,
_ProjCstLineItm.OrderSuboperation,
' ' as MaintenanceOrderDesc,
_ProjCstLineItm.PartnerAccountAssignmentType,
'' as OperationDescription,
_ProjCstLineItm.PartnerOrderCategory,
cast('PR' as abap.char(2)) as ProjectObjectType,
_ProjCstLineItm.PartnerWBSElement as ProjectPartnerObject,
_ProjCstLineItm.PartnerProjectNetwork,
'' as PartnerProjectNetworkActivity,
'' as InternalOrder,
'' as ProductionOrder,
_ProjCstLineItm.Product,
'' as ServiceOrder,
'' as ServiceOrderItem,
'' as ServiceContract,
'' as ServiceContractItem,
_ProjCstLineItm.PartnerProject,
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
_ProjCstLineItm.WBSElement,
_ProjCstLineItm.ProjectNetwork as ProjectNetwork,
'' as NetworkActivity,
'' as NetworkActivityElement,
WBSElement.WBSElementExternalID as ProjectObjectExternalID,
'' as ProjectNetworkActivity,
_Project.Project,
WBSElement.ProjectInternalID,
_ProjCstLineItm.WBSElementInternalID as ObjectInternalID,
_ProjCstLineItm.ControllingArea,
_ProjCstLineItm.GLAccount,
_ProjCstLineItm.ChartOfAccounts,
_ProjCstLineItm.CostCenter,
_ProjCstLineItm.ProfitCenter,
_ProjCstLineItm.CreationDate,
_ProjCstLineItm.FunctionalArea,
_ProjCstLineItm.CostCtrActivityType,
_ProjCstLineItm.OriginCostCtrActivityType,
_ProjCstLineItm.OriginCostCenter,
@Semantics.currencyCode: true
_ProjCstLineItm.ControllingObjectCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'ControllingObjectCurrency'
_ProjCstLineItm.AmountInObjectCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.TransactionCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.CompanyCodeCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.GlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency,
@Semantics.currencyCode: true
_ProjCstLineItm.FunctionalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
_ProjCstLineItm.AmountInFunctionalCurrency as ActualAmountInFunctionalCrcy,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as ActualAmountInGlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
_ProjCstLineItm.AmountInObjectCurrency as ActlCostInProjCrcy,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1 as ActualAmountInFreeDfndCrcy1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2 as ActualAmountInFreeDfndCrcy2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3 as ActualAmountInFreeDfndCrcy3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4 as ActualAmountInFreeDfndCrcy4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5 as ActualAmountInFreeDfndCrcy5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6 as ActualAmountInFreeDfndCrcy6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7 as ActualAmountInFreeDfndCrcy7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8 as ActualAmountInFreeDfndCrcy8,
_ProjCstLineItm.SourceReferenceDocumentType,
_ProjCstLineItm.SourceLogicalSystem,
_ProjCstLineItm.SourceReferenceDocumentCntxt,
_ProjCstLineItm.SourceReferenceDocument,
_ProjCstLineItm.SourceReferenceDocumentItem,
_ProjCstLineItm.SourceReferenceDocSubitem,
_ProjCstLineItm.IsCommitment,
_ProjCstLineItm.PartnerProfitCenter,
_ProjCstLineItm.PartnerCompanyCode,
cast('X' as boolean) as IsSettled,
cast( cast( 'ACT01' 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,
cast( 'PR' as ps_s4_projselobj ) as ProjectSelectedObject,
WBSElement.ProfitCenter as ProjectObjectProfitCenter,
WBSElement.WBSDescription as ProjectObjectDescription,
WBSElement.WBSElementObject as ProjectObjectNode,
WBSElement._Project.ProjectObject as ProjectObjectRootNode,
WBSElement.ResponsibleCostCenter as ResponsibleCostCenter,
WBSElement.ProjectType as ProjectType,
cast( '' as aufart ) as OrderType,
_VirtualPlanningCategory,
_WBSElement,
_ProjectNetwork,
_NetworkActivity,
_PMOrder,
_InternalOrder
}
//where
// _ProjCstLineItm.BusinessTransactionType <> 'TBRR'
//Statistical Internal Orders
union all select from I_GLAccountLineItemRawData as _ProjCstLineItm
inner join I_InternalOrder as InternalOrder on InternalOrder.InternalOrder = _ProjCstLineItm.OrderID
and _ProjCstLineItm.OrderID <> ''
and InternalOrder.IsStatisticalOrder = 'X'
inner join I_WBSElementData_2 as WBSElement on InternalOrder.WBSElementInternalID = WBSElement.WBSElementInternalID
inner join I_ProjectData_2 as Project on WBSElement.ProjectInternalID = Project.ProjectInternalID
and Project.ProjectObject = $parameters.P_ProjectObjectRootNode
association [0..*] to I_VirtualPlanningCategory as _VirtualPlanningCategory on $projection.PlanningCategory = _VirtualPlanningCategory.SourcePlanningCategory
association to I_WBSElementData_2 as _WBSElement on InternalOrder.ControllingObject = _WBSElement.WBSElementObject
association to I_NetworkActivityForCostReport as _NetworkActivity on InternalOrder.ControllingObject = _NetworkActivity.NetworkActivityObject
association to I_ProjectNetwork as _ProjectNetwork on InternalOrder.ControllingObject = _ProjectNetwork.ProjectNetworkObject
association to I_MaintenanceOrder as _PMOrder on InternalOrder.ControllingObject = _PMOrder.MaintenanceOrderInternalID
association to I_InternalOrder as _InternalOrder on $projection.InternalOrder = _InternalOrder.InternalOrder
{
key _ProjCstLineItm.SourceLedger,
key _ProjCstLineItm.SourceLedger as Ledger,
key _ProjCstLineItm.CompanyCode,
key _ProjCstLineItm.FiscalYear,
key _ProjCstLineItm.AccountingDocument,
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( LedgerGLLineItem as fis_act_pln_docln) as ActualPlanJournalEntryItem,
_ProjCstLineItm.LedgerFiscalYear,
_ProjCstLineItm.LedgerGLLineItem,
@Aggregation.default: #NONE
cast(cast( 0 as abap.int4 ) as fis_fp_entry_item ) as FinancialPlanningEntryItem,
cast(cast( 'A' as abap.char (1)) as fis_actual_plan_code) as ActualPlanCode,
_ProjCstLineItm.AccountingDocCreatedByUser,
_ProjCstLineItm.BusinessArea,
_ProjCstLineItm.PartnerOrder,
_ProjCstLineItm.OrderID,
_ProjCstLineItm.OrderOperation,
_ProjCstLineItm.OrderSuboperation,
' ' as MaintenanceOrderDesc,
_ProjCstLineItm.PartnerAccountAssignmentType,
'' as OperationDescription,
_ProjCstLineItm.PartnerOrderCategory,
cast('IO' as abap.char(2)) as ProjectObjectType,
_ProjCstLineItm.PartnerWBSElement as ProjectPartnerObject,
_ProjCstLineItm.PartnerProjectNetwork,
'' as PartnerProjectNetworkActivity,
_ProjCstLineItm.OrderID as InternalOrder,
'' as ProductionOrder,
_ProjCstLineItm.Product,
'' as ServiceOrder,
'' as ServiceOrderItem,
'' as ServiceContract,
'' as ServiceContractItem,
_ProjCstLineItm.PartnerProject,
_ProjCstLineItm.BusinessTransactionType,
_ProjCstLineItm.DebitCreditCode,
_ProjCstLineItm.ControllingDebitCreditCode,
_ProjCstLineItm.WBSElement,
_ProjCstLineItm.ProjectNetwork as ProjectNetwork,
'' as NetworkActivity,
'' as NetworkActivityElement,
InternalOrder.InternalOrder as ProjectObjectExternalID,
'' as ProjectNetworkActivity,
InternalOrder._WBSElementBasicData._Project.Project,
InternalOrder._WBSElementBasicData.ProjectInternalID,
_ProjCstLineItm.OrderID as ObjectInternalID,
_ProjCstLineItm.ControllingArea,
_ProjCstLineItm.GLAccount,
_ProjCstLineItm.ChartOfAccounts,
_ProjCstLineItm.CostCenter,
_ProjCstLineItm.ProfitCenter,
_ProjCstLineItm.CreationDate,
_ProjCstLineItm.FunctionalArea,
_ProjCstLineItm.CostCtrActivityType,
_ProjCstLineItm.OriginCostCtrActivityType,
_ProjCstLineItm.OriginCostCenter,
@Semantics.currencyCode: true
_ProjCstLineItm.ControllingObjectCurrency,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'ControllingObjectCurrency'
_ProjCstLineItm.AmountInObjectCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.TransactionCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'TransactionCurrency'} }
_ProjCstLineItm.AmountInTransactionCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.CompanyCodeCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
_ProjCstLineItm.AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
_ProjCstLineItm.GlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency,
@Semantics.currencyCode: true
_ProjCstLineItm.FunctionalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FunctionalCurrency'} }
_ProjCstLineItm.AmountInFunctionalCurrency as ActualAmountInFunctionalCrcy,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7,
@Semantics.currencyCode:true
_ProjCstLineItm.FreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
_ProjCstLineItm.AmountInGlobalCurrency as ActualAmountInGlobalCurrency,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'ControllingObjectCurrency'} }
_ProjCstLineItm.AmountInObjectCurrency as ActlCostInProjCrcy,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency1 as ActualAmountInFreeDfndCrcy1,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency2 as ActualAmountInFreeDfndCrcy2,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency3 as ActualAmountInFreeDfndCrcy3,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency4 as ActualAmountInFreeDfndCrcy4,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency5 as ActualAmountInFreeDfndCrcy5,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency6 as ActualAmountInFreeDfndCrcy6,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency7 as ActualAmountInFreeDfndCrcy7,
@Aggregation.default: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
_ProjCstLineItm.AmountInFreeDefinedCurrency8 as ActualAmountInFreeDfndCrcy8,
_ProjCstLineItm.SourceReferenceDocumentType,
_ProjCstLineItm.SourceLogicalSystem,
_ProjCstLineItm.SourceReferenceDocumentCntxt,
_ProjCstLineItm.SourceReferenceDocument,
_ProjCstLineItm.SourceReferenceDocumentItem,
_ProjCstLineItm.SourceReferenceDocSubitem,
_ProjCstLineItm.IsCommitment,
_ProjCstLineItm.PartnerProfitCenter,
_ProjCstLineItm.PartnerCompanyCode,
cast('X' as boolean) as IsSettled,
// cast(' ' as boolean) as IsSettled,
cast( cast( 'ACT01' 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,
cast( 'IO' as ps_s4_projselobj ) as ProjectSelectedObject,
InternalOrder.ProfitCenter as ProjectObjectProfitCenter,
InternalOrder.InternalOrderDescription as ProjectObjectDescription,
InternalOrder.ControllingObject as ProjectObjectNode,
InternalOrder._WBSElementBasicData._Project.ProjectObject as ProjectObjectRootNode,
InternalOrder.ResponsibleCostCenter as ResponsibleCostCenter,
cast( '' as ps_prart ) as ProjectType,
InternalOrder.OrderType as OrderType,
_VirtualPlanningCategory,
_WBSElement,
_ProjectNetwork,
_NetworkActivity,
_PMOrder,
_InternalOrder
}
//where
// _ProjCstLineItm.BusinessTransactionType <> 'TBRR'