P_RSHWCCapacityPerDay
P_RSHWCCapacityPerDay is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (P_RSHWCCapacityWithNights, I_CalendarDate) and exposes 21 fields with key fields CapacityInternalID, CalendarDate.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_RSHWCCapacityWithNights | CapacityPerShift | from |
| I_CalendarDate | date_series | inner |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PRSHWCCAPPERDAY | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (21)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | CapacityInternalID | ||
| KEY | CalendarDate | CalendarDate | ||
| WorkCenterInternalID | WorkCenterInternalID | |||
| WorkCenter | WorkCenter | |||
| WorkCenterCategoryCode | WorkCenterCategoryCode | |||
| WorkCenterTypeCode | WorkCenterTypeCode | |||
| Plant | Plant | |||
| WeekDay | P_RSHWCCapacityWithNights | WeekDay | ||
| AvailableCapacityShift | AvailableCapacityShift | |||
| CapacityStartTime | CapacityStartTime | |||
| NightSplitDate | NightSplitDate | |||
| AvailableCapacityIntervalDurn | AvailableCapacityIntervalDurn | |||
| WorkDayRule | WorkDayRule | |||
| CapacityEndTime | CapacityEndTime | |||
| TotOperatingDurationInSeconds | TotOperatingDurationInSeconds | |||
| OperatingDurationInSeconds | OperatingDurationInSeconds | |||
| CapacityNumberOfCapacities | CapacityNumberOfCapacities | |||
| CapacityPlanUtilizationPercent | CapacityPlanUtilizationPercent | |||
| FactoryCalendar | FactoryCalendar | |||
| YearWeek | YearWeek | |||
| CapacityBreakDuration | CapacityBreakDuration |
@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":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA