P_CapacityWithNightShift
Work Center Capacity With Night Shift
P_CapacityWithNightShift is a Composite CDS View that provides data about "Work Center Capacity With Night Shift" in SAP S/4HANA. It reads from 1 data source (P_CapacityDefinition) and exposes 20 fields with key fields CapacityInternalID, ValidityEndDateendasValidityEndDate, WeekDayendasWeekDay, AvailableCapacityShift, CapacityActiveVersion. Part of development package PPH_VDM_CAP_EVAL.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_CapacityDefinition | CapaDef | from |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (20)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | P_CapacityDefinition | CapacityInternalID | Capacity ID |
| KEY | ValidityEndDateendasValidityEndDate | |||
| KEY | WeekDayendasWeekDay | |||
| KEY | AvailableCapacityShift | P_CapacityDefinition | AvailableCapacityShift | Capacity Shift |
| KEY | CapacityActiveVersion | P_CapacityDefinition | CapacityActiveVersion | |
| ShiftName | P_CapacityDefinition | ShiftName | ||
| Plant | P_CapacityDefinition | Plant | Valuation Area | |
| FactoryCalendar | P_CapacityDefinition | FactoryCalendar | Factory Calendar | |
| CapacityCategoryCode | P_CapacityDefinition | CapacityCategoryCode | ||
| CapacityCategoryName | P_CapacityDefinition | CapacityCategoryName | ||
| Capacity | P_CapacityDefinition | Capacity | Engine Capacity | |
| CapacityResponsiblePlanner | P_CapacityDefinition | CapacityResponsiblePlanner | ||
| CapacityStartTimeendasCapacityStartTime | ||||
| ValidityBeginDateendasValidityBeginDate | ||||
| NightSplitDateendasNightSplitDate | ||||
| WorkDayRule | P_CapacityDefinition | WorkDayRule | Recurrence Weekdays | |
| CapacityEndTimeendasCapacityEndTime | ||||
| CapacityBreakDuration | P_CapacityDefinition | CapacityBreakDuration | ||
| CapacityNumberOfCapacities | P_CapacityDefinition | CapacityNumberOfCapacities | ||
| CapacityPlanUtilizationPercent | P_CapacityDefinition | CapacityPlanUtilizationPercent |
Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.
-- Derived SQL interpretation of CDS view P_CapacityWithNightShift.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
CREATE VIEW P_CapacityWithNightShift AS
SELECT
CapaDef.CapacityInternalID AS CapacityInternalID,
case when NightSplit.NightSplitDate = 2 and CapaDef.ValidityEndDate < '99991231' then dats_add_days(CapaDef.ValidityEndDate, 1, 'FAIL') else CapaDef.ValidityEndDate end as ValidityEndDate AS ValidityEndDateendasValidityEndDate,
case when NightSplit.NightSplitDate = 2 and CapaDef.AvailableCapacityIntervalDurn = '07' then case CapaDef.WeekDay when '7' then '1' when '6' then '7' when '5' then '6' when '4' then '5' when '3' then '4' when '2' then '3' when '1' then '2' else CapaDef.WeekDay end else CapaDef.WeekDay end as WeekDay AS WeekDayendasWeekDay,
CapaDef.AvailableCapacityShift AS AvailableCapacityShift,
CapaDef.CapacityActiveVersion AS CapacityActiveVersion,
CapaDef.ShiftName AS ShiftName,
CapaDef.Plant AS Plant,
CapaDef.FactoryCalendar AS FactoryCalendar,
CapaDef.CapacityCategoryCode AS CapacityCategoryCode,
CapaDef.CapacityCategoryName AS CapacityCategoryName,
CapaDef.Capacity AS Capacity,
CapaDef.CapacityResponsiblePlanner AS CapacityResponsiblePlanner,
case when NightSplit.NightSplitDate = 2 then 0 else CapaDef.CapacityStartTime end as CapacityStartTime AS CapacityStartTimeendasCapacityStartTime,
case when NightSplit.NightSplitDate = 2 then dats_add_days(CapaDef.ValidityBeginDate, 1, 'FAIL') else CapaDef.ValidityBeginDate end as ValidityBeginDate AS ValidityBeginDateendasValidityBeginDate,
case when NightSplit.NightSplitDate is null then 1 else NightSplit.NightSplitDate end as NightSplitDate AS NightSplitDateendasNightSplitDate,
CapaDef.WorkDayRule AS WorkDayRule,
case when NightSplit.NightSplitDate = 1 then 86400 AS CapacityEndTimeendasCapacityEndTime,
CapaDef.CapacityBreakDuration AS CapacityBreakDuration,
CapaDef.CapacityNumberOfCapacities AS CapacityNumberOfCapacities,
CapaDef.CapacityPlanUtilizationPercent AS CapacityPlanUtilizationPercent
FROM P_CapacityDefinition AS CapaDef
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA