@AbapCatalog.sqlViewName: 'PCAPACITYHDR'
@AbapCatalog.compiler.compareFilter: true@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM: {
private: true,
viewType: #COMPOSITE
}@ClientHandling.algorithm: #SESSION_VARIABLE@AbapCatalog.preserveKey:true//@EndUserText.label: 'Work Center Header Capacity'
defineview P_CapacityHeader
asselectfrom P_CapacityHeaderDef as Capacity
{
//key Capacity.WorkCenterInternalID as WorkCenterInternalID,
//key Capacity.WorkCenterTypeCode as WorkCenterTypeCode,
//key Capacity.CapacityCategoryAllocation as CapacityCategoryAllocation,
key Capacity.CapacityInternalID as CapacityInternalID,
// Capacity.WorkCenter as WorkCenter,
Capacity.Plant as Plant,
Capacity.FactoryCalendar as FactoryCalendar,
// Capacity.WorkCenterResponsible as WorkCenterResponsible,
// Capacity.WorkCenterDesc as WorkCenterDesc,
// Capacity.WorkCenterCategoryCode as WorkCenterCategoryCode,
cast('00010102' as dats) as ValidityBeginDate,
cast('99991231' as dats) as ValidityEndDate,
Capacity.CapacityEndTime as CapacityEndTime,
Capacity.CapacityStartTime as CapacityStartTime,
Capacity.CapacityNumberOfCapacities as CapacityNumberOfCapacities,
Capacity.CapacityPlanUtilizationPercent as CapacityPlanUtilizationPercent,
Capacity.CapacityBreakDuration as CapacityBreakDuration,
Capacity.CapacityCategoryCode as CapacityCategoryCode,
Capacity.CapacityCategoryName as CapacityCategoryName,
Capacity.Capacity as Capacity,
// Capacity.CapacityText as CapacityText,
Capacity.CapacityResponsiblePlanner as CapacityResponsiblePlanner,
// casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
// -- if the break is longer or equal to the opening hours, we have 0 capacity
// then 0
// -- Calculate the capacity, based on Capacity Start Date, End Date , Break down Duration, number of Capacities and plan utilization percent
// elsecast((OperatingDurationWithoutBreak - CapacityBreakDuration) asabap.fltp) * cast(CapacityNumberOfCapacities asabap.fltp) * cast(CapacityPlanUtilizationPercent asabap.fltp )/ cast(100 asabap.fltp)
// endas OverallCapacity,
casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
-- if the break is longer or equal to the opening hours, we have 0 capacity
then 0
-- Calculate the capacity, based on Capacity Start Date, End Date , Break down Duration, number of Capacities and plan utilization percent
when OperatingDurationWithoutBreak > CapacityBreakDuration
thencast((OperatingDurationWithoutBreak - CapacityBreakDuration) asabap.fltp) * cast(CapacityNumberOfCapacities asabap.fltp) * cast(CapacityPlanUtilizationPercent asabap.fltp )/ cast(100 asabap.fltp)
endas OverallCapacity,
// casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
// -- if the break is longer or equal to the opening hours, we have 0 capacity
// then 0
// -- Calculate the Single capacity based on Capacity StartTime, EndTime and Break Duration
// else OperatingDurationWithoutBreak - CapacityBreakDuration
// endas SingleCapacity,
casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
-- if the break is longer or equal to the opening hours, we have 0 capacity
then 0
-- Calculate the Single capacity based on Capacity StartTime, EndTime and Break Duration
when OperatingDurationWithoutBreak > CapacityBreakDuration
then OperatingDurationWithoutBreak - CapacityBreakDuration
endas SingleCapacity,
// casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
// -- if the break is longer or equal to the opening hours, we have 0 capacity
// then 0
// -- Calculate the capacity, based on Capacity Start Date, End Date and plan utilization percent
// elsecast((OperatingDurationWithoutBreak - CapacityBreakDuration) asabap.fltp) * cast(CapacityPlanUtilizationPercent asabap.fltp )/ cast(100 asabap.fltp)
// endas CapacityOperatingDuration,
casewhen OperatingDurationWithoutBreak <= CapacityBreakDuration
-- if the break is longer or equal to the opening hours, we have 0 capacity
then 0
-- Calculate the capacity, based on Capacity Start Date, End Date and plan utilization percent
when OperatingDurationWithoutBreak > CapacityBreakDuration
thencast((OperatingDurationWithoutBreak - CapacityBreakDuration) asabap.fltp) * cast(CapacityPlanUtilizationPercent asabap.fltp )/ cast(100 asabap.fltp)
endas CapacityOperatingDuration,
Capacity.ShiftGroup as ShiftGroup,
Capacity.CapacityActiveVersion as CapacityActiveVersion
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"P_CAPACITYHEADERDEF"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/