P_RSHWCCapacityWithNight_Cache

DDL: P_RSHWCCAPACITYWITHNIGHT_CACHE SQL: PRSHWCCAPWNIGHTC Type: view CONSUMPTION Package: RSH_CDS_WC_CAPACITY

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)

SourceAliasJoin Type
P_RSHWCCapacityDefinitio_Cache CapaDef from

Annotations (7)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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
;