P_WorkCenterCapacityShiftCalc
Work Center Capacity Shift Calculations
P_WorkCenterCapacityShiftCalc is a Composite CDS View that provides data about "Work Center Capacity Shift Calculations" in SAP S/4HANA. It reads from 4 data sources (P_CapacityHeader, I_WorkCenterCapacityInterval_2, P_WrkCtrAvailableCapShift, P_WorkCenterShiftDefinition) and exposes 13 fields with key fields CapacityInternalID, CapacityActiveVersion, CapacityEndDateendasValidityEndDate, WeekDay, AvailableCapacityShift. Part of development package ODATA_PP_WORKCENTER_API.
Data Sources (4)
| Source | Alias | Join Type |
|---|---|---|
| P_CapacityHeader | _Header | inner |
| I_WorkCenterCapacityInterval_2 | _Interval | from |
| P_WrkCtrAvailableCapShift | _Shift | left_outer |
| P_WorkCenterShiftDefinition | _ShiftDef | left_outer |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (13)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | I_WorkCenterCapacityInterval_2 | CapacityInternalID | Capacity ID |
| KEY | CapacityActiveVersion | I_WorkCenterCapacityInterval_2 | CapacityActiveVersion | |
| KEY | CapacityEndDateendasValidityEndDate | |||
| KEY | WeekDay | |||
| KEY | AvailableCapacityShift | P_WrkCtrAvailableCapShift | AvailableCapacityShift | Capacity Shift |
| CapacityStartDateendasValidityStartDate | ||||
| WorkDayRule | P_WrkCtrAvailableCapShift | WorkDayRule | Recurrence Weekdays | |
| ShiftDefinition | P_WrkCtrAvailableCapShift | ShiftDefinition | ||
| ShiftGroup | P_CapacityHeader | ShiftGroup | Shift Grouping | |
| timsendasShiftStartTime | ||||
| timsendasShiftEndTime | ||||
| CapacityStartDateendasShiftStartDate | ||||
| CapacityEndDateendasShiftEndDate |
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_WorkCenterCapacityShiftCalc.
-- 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_WorkCenterCapacityShiftCalc AS
SELECT
_Interval.CapacityInternalID AS CapacityInternalID,
_Interval.CapacityActiveVersion AS CapacityActiveVersion,
case when (_ShiftDef.ShiftDefinition is not null) then case when _ShiftDef.ShiftEndDate < _Interval.IntervalEndDate then _ShiftDef.ShiftEndDate else _Interval.IntervalEndDate end else coalesce( _Interval.IntervalEndDate, _Shift.CapacityEndDate ) end as ValidityEndDate AS CapacityEndDateendasValidityEndDate,
coalesce(_Shift.WeekDay,'1') AS WeekDay,
_Shift.AvailableCapacityShift AS AvailableCapacityShift,
case when (_ShiftDef.ShiftDefinition is not null) then case when _ShiftDef.ShiftStartDate > _Interval.IntervalStartDate then _ShiftDef.ShiftStartDate else _Interval.IntervalStartDate end else coalesce( _Interval.IntervalStartDate, _Shift.CapacityStartDate ) end as ValidityStartDate AS CapacityStartDateendasValidityStartDate,
_Shift.WorkDayRule AS WorkDayRule,
_Shift.ShiftDefinition AS ShiftDefinition,
_Header.ShiftGroup AS ShiftGroup,
case when (_ShiftDef.ShiftDefinition is not null) then _ShiftDef.ShiftStartTime else cast ( substring( cast ( tstmp_add_seconds( cast ('10010102000000' as abap.dec(15,0)), cast( coalesce( _Shift.CapacityStartTimeID, _Interval._Capacity.CapacityStartTime ) as abap.dec(15,0) ), 'FAIL') as abap.sstring(50)), 9,6) as abap.tims) end as ShiftStartTime AS timsendasShiftStartTime,
case when (_ShiftDef.ShiftDefinition is not null) then _ShiftDef.ShiftEndTime else cast ( substring( cast ( tstmp_add_seconds( cast ('10010102000000' as abap.dec(15,0)), cast( coalesce( _Shift.CapacityEndTimeID, _Interval._Capacity.CapacityEndTime ) as abap.dec(15,0) ), 'FAIL') as abap.sstring(50)), 9,6) as abap.tims) end as ShiftEndTime AS timsendasShiftEndTime,
case when (_ShiftDef.ShiftDefinition is not null) then _ShiftDef.ShiftStartDate else coalesce( _Interval.IntervalStartDate,_Shift.CapacityStartDate ) end as ShiftStartDate AS CapacityStartDateendasShiftStartDate,
case when (_ShiftDef.ShiftDefinition is not null) then _ShiftDef.ShiftEndDate else coalesce( _Interval.IntervalEndDate, _Shift.CapacityEndDate ) end as ShiftEndDate AS CapacityEndDateendasShiftEndDate
FROM I_WorkCenterCapacityInterval_2 AS _Interval
INNER JOIN P_CapacityHeader AS _Header ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_WrkCtrAvailableCapShift AS _Shift ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_WorkCenterShiftDefinition AS _ShiftDef ON /* join condition not captured in parsed metadata */
;
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