P_CAPACITYHEADER

CDS View

P_CAPACITYHEADER is a CDS View in S/4HANA. It contains 9 fields. 2 CDS views read from this table.

CDS Views using this table (2)

ViewTypeJoinVDMDescription
P_CapacityDefinition view from COMPOSITE
P_WorkCenterCapacityShiftCalc view inner COMPOSITE

Fields (9)

KeyField CDS FieldsUsed in Views
KEY CapacityActiveVersion CapacityActiveVersion 1
KEY CapacityInternalID CapacityInternalID 1
Capacity Capacity 1
CapacityCategoryCode CapacityCategoryCode 1
CapacityCategoryName CapacityCategoryName 1
CapacityResponsiblePlanner CapacityResponsiblePlanner 1
FactoryCalendar FactoryCalendar 1
Plant Plant 1
ShiftGroup ShiftGroup,ShiftGrouping 2
@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'


define view P_CapacityHeader
  as select from 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,

        //        case when 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

        //          else cast((OperatingDurationWithoutBreak - CapacityBreakDuration) as abap.fltp) * cast(CapacityNumberOfCapacities as abap.fltp) * cast(CapacityPlanUtilizationPercent as abap.fltp )/ cast(100 as abap.fltp)

        //        end                                     as OverallCapacity,


        case when 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
                 then cast((OperatingDurationWithoutBreak - CapacityBreakDuration) as abap.fltp) * cast(CapacityNumberOfCapacities as abap.fltp) * cast(CapacityPlanUtilizationPercent as abap.fltp )/ cast(100 as abap.fltp)
              end                               as OverallCapacity,

        //        case when 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

        //        end                                     as SingleCapacity,


        case when 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
             end                                as SingleCapacity,


        //        case when 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

        //          else cast((OperatingDurationWithoutBreak - CapacityBreakDuration) as abap.fltp) *  cast(CapacityPlanUtilizationPercent as abap.fltp )/ cast(100 as abap.fltp)

        //        end                                     as CapacityOperatingDuration,


        case when 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
                 then cast((OperatingDurationWithoutBreak - CapacityBreakDuration) as abap.fltp) *  cast(CapacityPlanUtilizationPercent as abap.fltp )/ cast(100 as abap.fltp)
              end                               as CapacityOperatingDuration,

        Capacity.ShiftGroup                     as ShiftGroup,
        Capacity.CapacityActiveVersion          as CapacityActiveVersion

}