//@AbapCatalog.sqlViewName: 'PWRKCNTRACT1'
//@AbapCatalog.compiler.compareFilter: true
//@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
//@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true
//define view P_WorkCenterActivity1
define view entity P_WorkCenterActivity1
as select from I_WorkCenter as wrkctr
inner join I_StandardWorkFmlaParamGroup as tc21
on tc21.StandardWorkFormulaParamGroup = wrkctr.StandardWorkFormulaParamGroup
left outer to one join I_WorkCenterCostCenter as costctr1
on costctr1.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr1.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr1.CostCenterAllocation = '0001'
and costctr1.ValidityStartDate <= $session.system_date
and costctr1.ValidityEndDate >= $session.system_date
left outer to one join I_WorkCenterCostCenter as costctr2
on costctr2.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr2.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr2.CostCenterAllocation = '0002'
and costctr2.ValidityStartDate <= $session.system_date
and costctr2.ValidityEndDate >= $session.system_date
left outer to one join I_WorkCenterCostCenter as costctr3
on costctr3.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr3.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr3.CostCenterAllocation = '0003'
and costctr3.ValidityStartDate <= $session.system_date
and costctr3.ValidityEndDate >= $session.system_date
left outer to one join I_WorkCenterCostCenter as costctr4
on costctr4.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr4.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr4.CostCenterAllocation = '0004'
and costctr4.ValidityStartDate <= $session.system_date
and costctr4.ValidityEndDate >= $session.system_date
left outer to one join I_WorkCenterCostCenter as costctr5
on costctr5.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr5.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr5.CostCenterAllocation = '0005'
and costctr5.ValidityStartDate <= $session.system_date
and costctr5.ValidityEndDate >= $session.system_date
left outer to one join I_WorkCenterCostCenter as costctr6
on costctr6.WorkCenterInternalID = wrkctr.WorkCenterInternalID
and costctr6.WorkCenterTypeCode = wrkctr.WorkCenterTypeCode
and costctr6.CostCenterAllocation = '0006'
and costctr6.ValidityStartDate <= $session.system_date
and costctr6.ValidityEndDate >= $session.system_date
{
// Technical key
key wrkctr.WorkCenterInternalID,
key wrkctr.WorkCenterTypeCode,
wrkctr.WorkCenterCategoryCode,
wrkctr.WorkCenter,
wrkctr.Plant,
wrkctr.StandardWorkFormulaParamGroup,
tc21.StandardWorkFormulaParam1,
tc21.StandardWorkFormulaParam2,
tc21.StandardWorkFormulaParam3,
tc21.StandardWorkFormulaParam4,
tc21.StandardWorkFormulaParam5,
tc21.StandardWorkFormulaParam6,
costctr1.CostCenterAllocation as CostCenterAllocation1,
costctr1.ControllingArea as ControllingArea1,
costctr1.CostCtrActivityType as CostCtrActivityType1,
costctr1.ActivityDescOriginType as ActivityDescOriginType1,
costctr1.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID1,
costctr1.ValidityStartDate as ValidityStartDate1,
costctr1.ValidityEndDate as ValidityEndDate1,
costctr2.CostCenterAllocation as CostCenterAllocation2,
costctr2.ControllingArea as ControllingArea2,
costctr2.CostCtrActivityType as CostCtrActivityType2,
costctr2.ActivityDescOriginType as ActivityDescOriginType2,
costctr2.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID2,
costctr2.ValidityStartDate as ValidityStartDate2,
costctr2.ValidityEndDate as ValidityEndDate2,
costctr3.CostCenterAllocation as CostCenterAllocation3,
costctr3.ControllingArea as ControllingArea3,
costctr3.CostCtrActivityType as CostCtrActivityType3,
costctr3.ActivityDescOriginType as ActivityDescOriginType3,
costctr3.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID3,
costctr3.ValidityStartDate as ValidityStartDate3,
costctr3.ValidityEndDate as ValidityEndDate3,
costctr4.CostCenterAllocation as CostCenterAllocation4,
costctr4.ControllingArea as ControllingArea4,
costctr4.CostCtrActivityType as CostCtrActivityType4,
costctr4.ActivityDescOriginType as ActivityDescOriginType4,
costctr4.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID4,
costctr4.ValidityStartDate as ValidityStartDate4,
costctr4.ValidityEndDate as ValidityEndDate4,
costctr5.CostCenterAllocation as CostCenterAllocation5,
costctr5.ControllingArea as ControllingArea5,
costctr5.CostCtrActivityType as CostCtrActivityType5,
costctr5.ActivityDescOriginType as ActivityDescOriginType5,
costctr5.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID5,
costctr5.ValidityStartDate as ValidityStartDate5,
costctr5.ValidityEndDate as ValidityEndDate5,
costctr6.CostCenterAllocation as CostCenterAllocation6,
costctr6.ControllingArea as ControllingArea6,
costctr6.CostCtrActivityType as CostCtrActivityType6,
costctr6.ActivityDescOriginType as ActivityDescOriginType6,
costctr6.CostCenterActivityAltvDescID as CostCenterActivityAltvDescID6,
costctr6.ValidityStartDate as ValidityStartDate6,
costctr6.ValidityEndDate as ValidityEndDate6,
// Associations
wrkctr._WorkCenter,
wrkctr._WorkCenterType,
wrkctr._WorkCenterCategory,
wrkctr._Plant,
wrkctr._StandardWorkFmlaParamGroup
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_STANDARDWORKFMLAPARAMGROUP",
"I_WORKCENTER",
"I_WORKCENTERCOSTCENTER"
],
"ASSOCIATED":
[
"I_PLANT",
"I_STANDARDWORKFMLAPARAMGROUP",
"I_WORKCENTERBYSEMANTICKEY",
"I_WORKCENTERCATEGORY",
"I_WORKCENTERTYPE"
],
"BASE":
[
"I_WORKCENTER"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/