P_RSHWCCAPACITYPERDAY

CDS View

P_RSHWCCAPACITYPERDAY is a CDS View in S/4HANA. It contains 6 fields. 4 CDS views read from this table.

CDS Views using this table (4)

ViewTypeJoinVDMDescription
P_RSHOrderGanttNonWrkgTmeIntvl view from CONSUMPTION
P_RSHWCCapacityPerWorkDay view from CONSUMPTION
P_RSHWorkCenterNonWrkgTmeIntvl view from CONSUMPTION Non working interval for the work center
P_RSHWorkCenterWrkgTmeIntvl view from CONSUMPTION Working Interval for the work center is returned

Fields (6)

KeyField CDS FieldsUsed in Views
KEY CalendarDate CalendarDate 4
KEY CapacityInternalID CapacityInternalID 4
KEY CapacityStartTime CapacityStartTime 4
KEY WeekDay WeekDay 1
KEY WorkCenterInternalID WorkCenterInternalID 3
KEY WorkCenterTypeCode WorkCenterTypeCode 3
@AbapCatalog.sqlViewName: 'PRSHWCCAPPERDAY'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE

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

Name:                       Capacity Per Day
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:               AN
Unit Test required Y/N:     Yes
Additional comments         None

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


define view P_RSHWCCapacityPerDay

  as select from P_RSHWCCapacityWithNights as CapacityPerShift

    inner join   I_CalendarDate            as date_series on  date_series.CalendarDate       <= ValidityEndDate
                                                          and date_series.CalendarDate       >= ValidityBeginDate
                                                          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_RSHWCCAPACITYWITHNIGHTS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/