P_RSHWCHeaderCapacityDefinitio
P_RSHWCHeaderCapacityDefinitio is a Consumption CDS View in SAP S/4HANA. It reads from 2 data sources (I_Capacity, I_RSHAssignedWorkCenters) and exposes 14 fields with key field CapacityInternalID.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_Capacity | Capacity | from |
| I_RSHAssignedWorkCenters | user_var | inner |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PRSHWCHEADCAPDEF | 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 (14)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | I_Capacity | CapacityInternalID | |
| WorkCenterInternalID | I_RSHAssignedWorkCenters | WorkCenterInternalID | ||
| CapacityStartTime | I_Capacity | CapacityStartTime | ||
| CapacityEndTime | I_Capacity | CapacityEndTime | ||
| CapacityNumberOfCapacities | I_Capacity | CapacityNumberOfCapacities | ||
| CapacityPlanUtilizationPercent | I_Capacity | CapacityPlanUtilizationPercent | ||
| CapacityBreakDuration | I_Capacity | CapacityBreakDuration | ||
| WorkCenter | I_RSHAssignedWorkCenters | WorkCenter | ||
| WorkCenterCategoryCode | I_RSHAssignedWorkCenters | WorkCenterCategoryCode | ||
| WorkCenterTypeCode | I_RSHAssignedWorkCenters | WorkCenterTypeCode | ||
| Plant | I_Capacity | Plant | ||
| FactoryCalendarendasFactoryCalendar | ||||
| ShiftGroup | I_Capacity | ShiftGroup | ||
| CapacityActiveVersion | I_Capacity | CapacityActiveVersion |
@AbapCatalog.sqlViewName: 'PRSHWCHEADCAPDEF'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
/*
CONTRACT**********************************************************************************************************************
Name: Work Center Header Capacity Definition
Specification: The view is to calculate the opening hours without break of the work center
so this can be used in the higher views to calculate the capacity from header
Requires: NA
Ensures: Work Center Header Capacity without breaks is returned for all assigned work centers.
Factory Calendar is derived from Capacity resp. Plant.
Owners: CK
Contributors: AN
Unit Test required Y/N: Yes
Additional comments None
END OF CONTRACT***************************************************************************************************************
*/
define view P_RSHWCHeaderCapacityDefinitio
as select from I_Capacity as Capacity
inner join I_RSHAssignedWorkCenters as user_var on user_var.CapacityInternalID = Capacity.CapacityInternalID
{
key Capacity.CapacityInternalID as CapacityInternalID,
user_var.WorkCenterInternalID as WorkCenterInternalID,
Capacity.CapacityStartTime as CapacityStartTime,
Capacity.CapacityEndTime as CapacityEndTime,
Capacity.CapacityNumberOfCapacities as CapacityNumberOfCapacities,
Capacity.CapacityPlanUtilizationPercent as CapacityPlanUtilizationPercent,
Capacity.CapacityBreakDuration as CapacityBreakDuration,
// Pass maximum opening hours
case when CapacityEndTime > CapacityStartTime or CapacityStartTime = 0 // change here!!!!
// Normal shift, operating duration without break
then CapacityEndTime - CapacityStartTime
// Night shift, add 24 hours
else CapacityEndTime - CapacityStartTime + (24*3600)
end as OperatingDurationWithoutBreak,
user_var.WorkCenter as WorkCenter,
user_var.WorkCenterCategoryCode as WorkCenterCategoryCode,
user_var.WorkCenterTypeCode as WorkCenterTypeCode,
Capacity.Plant as Plant,
// Derive the factory calendar. Fall back to factory calandar of plant,
// if factory calendar at work center level is not maintained
case when Capacity.FactoryCalendar = ''
then Capacity._Plant.FactoryCalendar
else Capacity.FactoryCalendar end as FactoryCalendar,
Capacity.ShiftGroup as ShiftGroup,
Capacity.CapacityActiveVersion as CapacityActiveVersion
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CAPACITY",
"I_PLANT",
"I_RSHASSIGNEDWORKCENTERS"
],
"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