P_RSHWCCapacityWithNight_Cache
WC Capacity from day and night shifts
P_RSHWCCapacityWithNight_Cache is a Consumption CDS View that provides data about "WC Capacity from day and night shifts" in SAP S/4HANA. It reads from 1 data source (P_RSHWCCapacityDefinitio_Cache) and exposes 15 fields with key fields CapacityInternalID, WeekDayendasWeekDay, AvailableCapacityShift. Part of development package RSH_CDS_WC_CAPACITY.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_RSHWCCapacityDefinitio_Cache | CapaDef | from |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PRSHWCCAPWNIGHTC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #CONSUMPTION | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.preserveKey | true | view |
Fields (15)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CapacityInternalID | P_RSHWCCapacityDefinitio_Cache | CapacityInternalID | Capacity ID |
| KEY | WeekDayendasWeekDay | |||
| KEY | AvailableCapacityShift | P_RSHWCCapacityDefinitio_Cache | AvailableCapacityShift | Capacity Shift |
| AvailableCapacityIntervalDurn | P_RSHWCCapacityDefinitio_Cache | AvailableCapacityIntervalDurn | ||
| WorkDayRule | P_RSHWCCapacityDefinitio_Cache | WorkDayRule | Recurrence Weekdays | |
| fltpendendasOperatingDurationInSeconds | ||||
| fltpendendasCapacityBreakDuration | ||||
| CapacityNumberOfCapacities | P_RSHWCCapacityDefinitio_Cache | CapacityNumberOfCapacities | ||
| CapacityPlanUtilizationPercent | P_RSHWCCapacityDefinitio_Cache | CapacityPlanUtilizationPercent | ||
| WorkCenterInternalID | P_RSHWCCapacityDefinitio_Cache | WorkCenterInternalID | Work Center | |
| WorkCenter | P_RSHWCCapacityDefinitio_Cache | WorkCenter | Work Center | |
| WorkCenterCategoryCode | P_RSHWCCapacityDefinitio_Cache | WorkCenterCategoryCode | ||
| WorkCenterTypeCode | P_RSHWCCapacityDefinitio_Cache | WorkCenterTypeCode | Object Type | |
| Plant | P_RSHWCCapacityDefinitio_Cache | Plant | Valuation Area | |
| FactoryCalendar | P_RSHWCCapacityDefinitio_Cache | FactoryCalendar | Factory Calendar |
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_RSHWCCapacityWithNight_Cache.
-- 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.
-- SQL view name: PRSHWCCAPWNIGHTC
CREATE VIEW P_RSHWCCapacityWithNight_Cache AS
SELECT
CapaDef.CapacityInternalID AS CapacityInternalID,
case when NightSplitDate = 2 and AvailableCapacityIntervalDurn = '07' then case CapaDef.WeekDay when '1' then '2' when '2' then '3' when '3' then '4' when '4' then '5' when '5' then '6' when '6' then '7' when '7' then '1' end else CapaDef.WeekDay end as WeekDay AS WeekDayendasWeekDay,
CapaDef.AvailableCapacityShift AS AvailableCapacityShift,
CapaDef.AvailableCapacityIntervalDurn AS AvailableCapacityIntervalDurn,
CapaDef.WorkDayRule AS WorkDayRule,
case when OperatingDurationInSeconds = 0 or NightSplitDate is null then OperatingDurationInSeconds else case when NightSplit.NightSplitDate = 1 then cast( 86400 - CapacityStartTime as abap.fltp) / ( cast ( 86400 - CapacityStartTime + CapacityEndTime as abap.fltp )) * cast(OperatingDurationInSeconds as abap.fltp) else cast(CapacityEndTime as abap.fltp) / ( cast ( 86400 - CapacityStartTime + CapacityEndTime as abap.fltp ) ) * cast(OperatingDurationInSeconds as abap.fltp) end end as OperatingDurationInSeconds AS fltpendendasOperatingDurationInSeconds,
case when NightSplitDate is null or CapacityBreakDuration = 0 or OperatingDurationInSeconds = 0 then CapacityBreakDuration else case when NightSplitDate = 1 then cast( 86400 - CapacityStartTime as abap.fltp) / ( cast( ( 86400 - CapacityStartTime + CapacityEndTime ) as abap.fltp ) ) * cast(CapacityBreakDuration as abap.fltp) else cast(CapacityEndTime as abap.fltp) / ( cast ( ( 86400 - CapacityStartTime + CapacityEndTime ) as abap.fltp ) ) * cast(CapacityBreakDuration as abap.fltp) end end as CapacityBreakDuration AS fltpendendasCapacityBreakDuration,
CapaDef.CapacityNumberOfCapacities AS CapacityNumberOfCapacities,
CapaDef.CapacityPlanUtilizationPercent AS CapacityPlanUtilizationPercent,
CapaDef.WorkCenterInternalID AS WorkCenterInternalID,
CapaDef.WorkCenter AS WorkCenter,
CapaDef.WorkCenterCategoryCode AS WorkCenterCategoryCode,
CapaDef.WorkCenterTypeCode AS WorkCenterTypeCode,
CapaDef.Plant AS Plant,
CapaDef.FactoryCalendar AS FactoryCalendar
FROM P_RSHWCCapacityDefinitio_Cache 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