P_RSHWCCAPACITYPERDAYFORPERIOD

CDS View

P_RSHWCCAPACITYPERDAYFORPERIOD is a CDS View in S/4HANA. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
P_RSHWCCapPerWorkDayForPeriod view from CONSUMPTION
@AbapCatalog.sqlViewName: 'PRSHWCCAPPDPER'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE

/*
CONTRACT**********************************************************************************************************************

Name:                       Capacity Per Day with Input Period
Specification:              This view rolls out to capacity shift to calendar days and aggregates the capacity per day.
Requires:                   NA
Ensures:                    Aggregated capacity per calendar days is returned.
Owners:                     PRP
Contributors:               
Unit Test required Y/N:     Yes
Additional comments         The view is similar to P_RSHWCCapacityPerDay. But the difference is that the current view takes   
                            an input period. Based on this input period, the interval/shift details are filtered at lower level

END OF CONTRACT***************************************************************************************************************
*/


define view P_RSHWCCapacityPerDayForPeriod
  with parameters
    P_StartDate : datum,
    P_EndDate   : datum

  as select from P_RSHWCCapWithNightsForPeriod(P_StartDate : $parameters.P_StartDate, P_EndDate : $parameters.P_EndDate) as CapacityPerShift

    inner join   I_CalendarDate            as date_series on  date_series.CalendarDate       <= ValidityEndDate  --$parameters.P_EndDate 
                                                          and date_series.CalendarDate       >= ValidityBeginDate --$parameters.P_StartDate
                                                          and (
                                                             (
                                                               AvailableCapacityIntervalDurn =  '01'
                                                             )     // 1 day shift interval duration

                                                             or(
                                                               AvailableCapacityIntervalDurn =  '07'
                                                               and // 7 day shift interval duration

                                                               date_series.WeekDay           =  CapacityPerShift.WeekDay
                                                             )
                                                           )

{

  key CapacityInternalID,

  key CalendarDate,

      WorkCenterInternalID,
      WorkCenter,
      WorkCenterCategoryCode,
      WorkCenterTypeCode,
      Plant,

      CapacityPerShift.WeekDay,

      AvailableCapacityShift,
      CapacityStartTime,
      NightSplitDate,
      AvailableCapacityIntervalDurn,
      WorkDayRule,
      //      CapacityBreakDuration,

      CapacityEndTime,
      TotOperatingDurationInSeconds,
      OperatingDurationInSeconds,
      CapacityNumberOfCapacities,
      CapacityPlanUtilizationPercent,
      FactoryCalendar,
      YearWeek,

      CapacityBreakDuration,

      case when NightSplitDate = 2
           then dats_add_days(CalendarDate, -1, 'FAIL')
           else CalendarDate
      end               as  FactoryCalendarDate

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CALENDARDATE",
"P_RSHWCCAPWITHNIGHTSFORPERIOD"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/