P_CapacityHeaderDef
Work Center Header Capacity Definition
P_CapacityHeaderDef is a Composite CDS View that provides data about "Work Center Header Capacity Definition" in SAP S/4HANA. It reads from 1 data source (I_Capacity) and exposes 15 fields with key field CapacityInternalID. Part of development package PPH_VDM_CAP_EVAL.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_Capacity | Capacity | from |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (15)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | I_Capacity | CapacityInternalID | |
| Plant | I_Capacity | Plant | ||
| FactoryCalendarendasFactoryCalendar | ||||
| CapacityStartTime | I_Capacity | CapacityStartTime | ||
| CapacityEndTime | I_Capacity | CapacityEndTime | ||
| CapacityNumberOfCapacities | I_Capacity | CapacityNumberOfCapacities | ||
| CapacityPlanUtilizationPercent | I_Capacity | CapacityPlanUtilizationPercent | ||
| CapacityBreakDuration | I_Capacity | CapacityBreakDuration | ||
| CapacityCategoryCode | I_Capacity | CapacityCategoryCode | ||
| CapacityCategoryName | ||||
| Capacity | I_Capacity | Capacity | ||
| CapacityResponsiblePlanner | I_Capacity | CapacityResponsiblePlanner | ||
| ShiftGroup | I_Capacity | ShiftGroup | ||
| CapacityActiveVersion | I_Capacity | CapacityActiveVersion | ||
| CapacityIsPooled | I_Capacity | CapacityIsPooled |
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType:#COMPOSITE
define view entity P_CapacityHeaderDef
// as select from I_WorkCenterCapacity as WorkCenterCapacity
as select from I_Capacity as Capacity
// as select from I_WorkCenterCapAlloc as WorkCenterCapacity
// association [1..1] to I_WorkCenter as _WorkCenter on $projection.WorkCenterTypeCode = _WorkCenter.WorkCenterTypeCode
// and $projection.WorkCenterInternalID = _WorkCenter.WorkCenterInternalID
// association [1..1] to I_Capacity as _Capacity on $projection.CapacityInternalID = _Capacity.CapacityInternalID
// association [1..1] to I_CapacityCategory as _CapacityCategory on $projection.CapacityCategoryCode = _CapacityCategory.CapacityCategoryCode
{
// key WorkCenterCapacity.WorkCenterInternalID as WorkCenterInternalID,
// key WorkCenterCapacity.WorkCenterTypeCode as WorkCenterTypeCode,
// key WorkCenterCapacity.CapacityCategoryAllocation as CapacityCategoryAllocation,
key Capacity.CapacityInternalID as CapacityInternalID,
// _WorkCenter.WorkCenter as WorkCenter,
// _WorkCenter.Plant as Plant,
Capacity.Plant,
// case when Capacity.FactoryCalendar = ''
// then Capacity._Plant.FactoryCalendar
// else Capacity.FactoryCalendar end as FactoryCalendar,
case when Capacity.FactoryCalendar = ''
then Capacity._Plant.FactoryCalendar
when Capacity.FactoryCalendar <> ''
then Capacity.FactoryCalendar
end as FactoryCalendar,
// _WorkCenter.WorkCenterResponsible as WorkCenterResponsible,
// _WorkCenter._Text[1:Language=$session.system_language].WorkCenterText as WorkCenterDesc,
// _WorkCenter.WorkCenterCategoryCode as WorkCenterCategoryCode,
Capacity.CapacityStartTime as CapacityStartTime,
Capacity.CapacityEndTime as CapacityEndTime,
Capacity.CapacityNumberOfCapacities as CapacityNumberOfCapacities,
Capacity.CapacityPlanUtilizationPercent as CapacityPlanUtilizationPercent,
Capacity.CapacityBreakDuration as CapacityBreakDuration,
Capacity.CapacityCategoryCode as CapacityCategoryCode,
Capacity._CapacityCategory._Text[1:Language=$session.system_language].CapacityCategoryName as CapacityCategoryName,
Capacity.Capacity as Capacity,
// WorkCenterCapacity._Capacity._Text[1:Language=$session.system_language].CapacityText as CapacityText,
Capacity.CapacityResponsiblePlanner as CapacityResponsiblePlanner,
// // Pass maximum opening hours
// case when Capacity.CapacityEndTime > Capacity.CapacityStartTime or Capacity.CapacityStartTime = 0
// // Normal shift, operating duration without break
// then Capacity.CapacityEndTime - Capacity.CapacityStartTime
// // Night shift, add 24 hours
// else Capacity.CapacityEndTime - Capacity.CapacityStartTime + (24*3600)
// end as OperatingDurationWithoutBreak,
// Pass maximum opening hours
case when Capacity.CapacityEndTime > Capacity.CapacityStartTime or Capacity.CapacityStartTime = 0
// Normal shift, operating duration without break
then Capacity.CapacityEndTime - Capacity.CapacityStartTime
// Night shift, add 24 hours
when Capacity.CapacityEndTime <= Capacity.CapacityStartTime
then Capacity.CapacityEndTime - Capacity.CapacityStartTime + (24*3600)
end as OperatingDurationWithoutBreak,
// Derive the factory calendar. Fall back to factory calandar of plant,
// if factory calendar at work center level is not maintained
Capacity.ShiftGroup as ShiftGroup,
Capacity.CapacityActiveVersion as CapacityActiveVersion,
Capacity.CapacityIsPooled as CapacityIsPooled
}
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