P_WorkCenterAvailableCapacity

DDL: P_WORKCENTERAVAILABLECAPACITY SQL: PWRKCTRAVAILCAP Type: view COMPOSITE Package: PPH_VDM_CAP_EVAL

Total Available Capacity of Work Center

P_WorkCenterAvailableCapacity is a Composite CDS View that provides data about "Total Available Capacity of Work Center" in SAP S/4HANA. It reads from 3 data sources (P_CapacityDefinition, I_WorkCenterCapacity, P_WrkCtrWorkDays) and exposes 34 fields with key fields WorkCenterInternalID, WorkCenterTypeCode, CapacityCategoryAllocation, CapacityInternalID, CapacityActiveVersion. Part of development package PPH_VDM_CAP_EVAL.

Data Sources (3)

SourceAliasJoin Type
P_CapacityDefinition CapacityPerShift inner
I_WorkCenterCapacity WorkCenterCapacity from
P_WrkCtrWorkDays WorkDays inner

Annotations (6)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.sqlViewName PWRKCTRAVAILCAP view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY WorkCenterInternalID I_WorkCenterCapacity WorkCenterInternalID Work Center
KEY WorkCenterTypeCode I_WorkCenterCapacity WorkCenterTypeCode Object Type
KEY CapacityCategoryAllocation I_WorkCenterCapacity CapacityCategoryAllocation
KEY CapacityInternalID I_WorkCenterCapacity CapacityInternalID Capacity ID
KEY CapacityActiveVersion P_CapacityDefinition CapacityActiveVersion
KEY ValidityEndDate P_CapacityDefinition ValidityEndDate ValidTo
KEY WeekDay
KEY AvailableCapacityShift P_CapacityDefinition AvailableCapacityShift Capacity Shift
KEY CalendarDate P_WrkCtrWorkDays CalendarDate Calendar Date
ShiftStartDate P_CapacityDefinition ShiftStartDate
ShiftStartTime P_CapacityDefinition ShiftStartTime
ShiftEndDate P_CapacityDefinition ShiftEndDate
ShiftEndTime P_CapacityDefinition ShiftEndTime
CapacityBreakDuration
WorkCenterCapacityUnit
WorkCenterUtilizationUnit
ValidityBeginDate P_CapacityDefinition ValidityBeginDate
CalendarMonth P_WrkCtrWorkDays CalendarMonth Calendar Month
CalendarYear P_WrkCtrWorkDays CalendarYear Year
CalendarWeek P_WrkCtrWorkDays CalendarWeek Calendar Week
workdays P_WrkCtrWorkDays workdays
WorkCenterPlant P_CapacityDefinition Plant Valuation Area
CapacityCategoryCode P_CapacityDefinition CapacityCategoryCode
ShiftNameendasShiftName
ShiftDefinition P_CapacityDefinition ShiftDefinition
ShiftGrouping P_CapacityDefinition ShiftGrouping Shift Grouping
WorkDayRule P_CapacityDefinition WorkDayRule Recurrence Weekdays
FactoryCalendar P_CapacityDefinition FactoryCalendar Factory Calendar
CapacityStartTime P_CapacityDefinition CapacityStartTime
CapacityEndTime P_CapacityDefinition CapacityEndTime
CapacityNumberOfCapacities P_CapacityDefinition CapacityNumberOfCapacities
CapacityPlanUtilizationPercent P_CapacityDefinition CapacityPlanUtilizationPercent
fltpendasTotOperatingDurationInHours
fltpendasCapacityOperatingDuration

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_WorkCenterAvailableCapacity.
-- 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: PWRKCTRAVAILCAP

CREATE VIEW P_WorkCenterAvailableCapacity AS
SELECT
  WorkCenterCapacity.WorkCenterInternalID AS WorkCenterInternalID,
  WorkCenterCapacity.WorkCenterTypeCode AS WorkCenterTypeCode,
  WorkCenterCapacity.CapacityCategoryAllocation AS CapacityCategoryAllocation,
  WorkCenterCapacity.CapacityInternalID AS CapacityInternalID,
  CapacityPerShift.CapacityActiveVersion AS CapacityActiveVersion,
  CapacityPerShift.ValidityEndDate AS ValidityEndDate,
  cast( WorkDays.WeekDay as char1) AS WeekDay,
  CapacityPerShift.AvailableCapacityShift AS AvailableCapacityShift,
  WorkDays.CalendarDate AS CalendarDate,
  CapacityPerShift.ShiftStartDate AS ShiftStartDate,
  CapacityPerShift.ShiftStartTime AS ShiftStartTime,
  CapacityPerShift.ShiftEndDate AS ShiftEndDate,
  CapacityPerShift.ShiftEndTime AS ShiftEndTime,
  cast(CapacityPerShift.CapacityBreakDuration as abap.fltp) / cast(3600 as abap.fltp) AS CapacityBreakDuration,
  cast('H' as unit) AS WorkCenterCapacityUnit,
  cast('%' as unit) AS WorkCenterUtilizationUnit,
  CapacityPerShift.ValidityBeginDate AS ValidityBeginDate,
  WorkDays.CalendarMonth AS CalendarMonth,
  WorkDays.CalendarYear AS CalendarYear,
  WorkDays.CalendarWeek AS CalendarWeek,
  WorkDays.workdays AS workdays,
  CapacityPerShift.Plant AS WorkCenterPlant,
  CapacityPerShift.CapacityCategoryCode AS CapacityCategoryCode,
  case when (CapacityPerShift.ShiftName = '' and CapacityPerShift.AvailableCapacityShift <> '') then concat('SH ', CapacityPerShift.AvailableCapacityShift) when ((CapacityPerShift.ShiftName <> '') or (CapacityPerShift.ShiftName = '' and CapacityPerShift.AvailableCapacityShift = '')) then CapacityPerShift.ShiftName end as ShiftName AS ShiftNameendasShiftName,
  CapacityPerShift.ShiftDefinition AS ShiftDefinition,
  CapacityPerShift.ShiftGrouping AS ShiftGrouping,
  CapacityPerShift.WorkDayRule AS WorkDayRule,
  CapacityPerShift.FactoryCalendar AS FactoryCalendar,
  CapacityPerShift.CapacityStartTime AS CapacityStartTime,
  CapacityPerShift.CapacityEndTime AS CapacityEndTime,
  CapacityPerShift.CapacityNumberOfCapacities AS CapacityNumberOfCapacities,
  CapacityPerShift.CapacityPlanUtilizationPercent AS CapacityPlanUtilizationPercent,
  case when WorkDays.workdays = 0 and CapacityPerShift.WorkDayRule = '' or CapacityPerShift.WorkDayRule = '0' or CapacityPerShift.OperatingDurationInSeconds = 0 then 0 else CapacityPerShift.TotOperatingDurationInSeconds / cast ( 3600 as abap.fltp ) end as TotOperatingDurationInHours AS fltpendasTotOperatingDurationInHours,
  case when WorkDays.workdays = 0 and CapacityPerShift.WorkDayRule = '' or CapacityPerShift.WorkDayRule = '0' or CapacityPerShift.CapacityOperatingDuration = 0 then 0 else CapacityPerShift.CapacityOperatingDuration / cast ( 3600 as abap.fltp ) end as CapacityOperatingDuration AS fltpendasCapacityOperatingDuration
FROM I_WorkCenterCapacity AS WorkCenterCapacity
INNER JOIN P_CapacityDefinition AS CapacityPerShift ON /* join condition not captured in parsed metadata */
INNER JOIN P_WrkCtrWorkDays AS WorkDays ON /* join condition not captured in parsed metadata */
;