P_EvaltCapWrkCtrCapOperations

DDL: P_EVALTCAPWRKCTRCAPOPERATIONS Type: view_entity COMPOSITE

P_EvaltCapWrkCtrCapOperations is a Composite CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 55 fields with key fields WorkCenterInternalID, WorkCenterTypeCode, CapacityCategoryCode, CapacityCategoryAllocation, CapacityInternalID. It has 3 associations to related views.

Data Sources (6)

SourceAliasJoin Type
I_LogisticsOrder _Order from
I_PlannedOrder _PlannedOrder union_all
I_SchedCapacityRqmtItemCap CapRqmtItmCap inner
I_SchedCapacityRqmtItemCap CapRqmtItmCap inner
I_WorkCenter workcenter inner
I_WorkCenter workcenter inner

Associations (3)

CardinalityTargetAliasCondition
[1..1] I_WorkCenterCapacity workcenter_capacity CapRqmtItmCap.WorkCenterInternalID = workcenter_capacity.WorkCenterInternalID and CapRqmtItmCap.CapacityInternalID = workcenter_capacity.CapacityInternalID
[0..1] I_PlannedOrder _PlannedOrder $projection.PlannedOrder = _PlannedOrder.PlannedOrder
[1..1] I_CapacityRequirement _CapacityRequirement $projection.CapacityRequirement = _CapacityRequirement.CapacityRequirement

Annotations (4)

NameValueLevelField
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
Metadata.ignorePropagatedAnnotations true view

Fields (55)

KeyFieldSource TableSource FieldDescription
KEY WorkCenterInternalID workcenter_capacity WorkCenterInternalID Work Center
KEY WorkCenterTypeCode workcenter_capacity WorkCenterTypeCode Object Type
KEY CapacityCategoryCode workcenter_capacity CapacityCategoryCode
KEY CapacityCategoryAllocation workcenter_capacity CapacityCategoryAllocation
KEY CapacityInternalID I_SchedCapacityRqmtItemCap CapacityInternalID Capacity ID
KEY OrderID
KEY Operation I_SchedCapacityRqmtItemCap Operation Transaction
KEY CapacityRequirement I_SchedCapacityRqmtItemCap CapacityRequirement Id number
KEY CapacityRequirementItem I_SchedCapacityRqmtItemCap CapacityRequirementItem
Material
ProductGroup
ProductConfiguration
Plant I_LogisticsOrder Plant Valuation Area
MRPController I_LogisticsOrder MRPController MRP Controller
WorkCenter I_WorkCenter WorkCenter Work Center
PlannedOrder I_SchedCapacityRqmtItemCap PlannedOrder Planned Order
CapacityBaseQtyUnit
WorkCenterResponsible I_WorkCenter WorkCenterResponsible Responsible
WorkCenterCategoryCode I_WorkCenter WorkCenterCategoryCode Work Center Category
CapacityRequirementOrigin
OrderInternalID I_SchedCapacityRqmtItemCap OrderInternalID Plan No.f.Oper.
OrderType I_LogisticsOrder OrderType Order Type
OrderCategory
OrderPlannedTotalQty I_LogisticsOrder OrderPlannedTotalQty Target Quantity
ProductionVersion I_PlannedOrder ProductionVersion Version ID
BaseUnit I_LogisticsOrder BaseUnit Unit of Measure
OperationLatestStartDate I_SchedCapacityRqmtItemCap OperationLatestStartDate Ltst Start Date
OperationLatestStartTime I_SchedCapacityRqmtItemCap OperationLatestStartTime Ltst Start Time
OperationLatestEndDate I_SchedCapacityRqmtItemCap OperationLatestEndDate Ltst End Date
OperationLatestEndTime I_SchedCapacityRqmtItemCap OperationLatestEndTime Ltst End Time
OpLtstSchedldProcgStrtDte _OrderOperation OpLtstSchedldProcgStrtDte
OpLtstSchedldProcgStrtTme _OrderOperation OpLtstSchedldProcgStrtTme
OpLtstSchedldTrdwnStrtDte _OrderOperation OpLtstSchedldTrdwnStrtDte
OpLtstSchedldTrdwnStrtTme _OrderOperation OpLtstSchedldTrdwnStrtTme
int4endasOpLtstSchedldExecStrtTme
int4endasOpLtstSchedldExecEndTme
dec163asCapacityRequirementsAreDtmnd
char_man
dec102asRemainingCapReqOpSegSetupDurn
dec102asRemainingCapReqOpSegProcgDurn
dec102asRemainingCapReqOpSegTrdwnDurn
OrderFirmingStatusCode
ScheduledBasicStartDate I_LogisticsOrder ScheduledBasicStartDate Sched. start
ScheduledBasicStartTime I_LogisticsOrder ScheduledBasicStartTime SchedStartTime
ScheduledBasicEndDate I_LogisticsOrder ScheduledBasicEndDate Sched. finish
ScheduledBasicEndTime I_LogisticsOrder ScheduledBasicEndTime Finish time
CurrentDate
Sequence _OrderOperation Sequence Visit Sequence
Customer
SalesOrganization
OrganizationDivision
DistributionChannel
AddressTimeZoneendasPlantTimeZone
StatusCode _OrderOper StatusCode Statuscode
MRPArea

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_EvaltCapWrkCtrCapOperations.
-- 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_EvaltCapWrkCtrCapOperations AS
SELECT
  workcenter_capacity.WorkCenterInternalID AS WorkCenterInternalID,
  workcenter_capacity.WorkCenterTypeCode AS WorkCenterTypeCode,
  workcenter_capacity.CapacityCategoryCode AS CapacityCategoryCode,
  workcenter_capacity.CapacityCategoryAllocation AS CapacityCategoryAllocation,
  CapRqmtItmCap.CapacityInternalID AS CapacityInternalID,
  cast( _Order.OrderID as abap.char(12)) AS OrderID,
  CapRqmtItmCap.Operation AS Operation,
  CapRqmtItmCap.CapacityRequirement AS CapacityRequirement,
  CapRqmtItmCap.CapacityRequirementItem AS CapacityRequirementItem,
  _Order._OrderMainItem.Material AS Material,
  _Order._OrderMainItem._Product.ProductGroup AS ProductGroup,
  _Order._OrderMainItem.ProductConfiguration AS ProductConfiguration,
  _Order.Plant AS Plant,
  _Order.MRPController AS MRPController,
  workcenter.WorkCenter AS WorkCenter,
  CapRqmtItmCap.PlannedOrder AS PlannedOrder,
  workcenter_capacity._Capacity.CapacityBaseQtyUnit AS CapacityBaseQtyUnit,
  workcenter.WorkCenterResponsible AS WorkCenterResponsible,
  workcenter.WorkCenterCategoryCode AS WorkCenterCategoryCode,
  cast ('1' as capacityrequirementorigin) AS CapacityRequirementOrigin,
  CapRqmtItmCap.OrderInternalID AS OrderInternalID,
  _Order.OrderType AS OrderType,
  cast( _Order.OrderCategory as pph_cfs_sch_ordercategory) AS OrderCategory,
  _Order.OrderPlannedTotalQty AS OrderPlannedTotalQty,
  _PlannedOrder.ProductionVersion AS ProductionVersion,
  _Order.BaseUnit AS BaseUnit,
  CapRqmtItmCap.OperationLatestStartDate AS OperationLatestStartDate,
  CapRqmtItmCap.OperationLatestStartTime AS OperationLatestStartTime,
  CapRqmtItmCap.OperationLatestEndDate AS OperationLatestEndDate,
  CapRqmtItmCap.OperationLatestEndTime AS OperationLatestEndTime,
  _OrderOperation.OpLtstSchedldProcgStrtDte AS OpLtstSchedldProcgStrtDte,
  _OrderOperation.OpLtstSchedldProcgStrtTme AS OpLtstSchedldProcgStrtTme,
  _OrderOperation.OpLtstSchedldTrdwnStrtDte AS OpLtstSchedldTrdwnStrtDte,
  _OrderOperation.OpLtstSchedldTrdwnStrtTme AS OpLtstSchedldTrdwnStrtTme,
  case when _Order.OrderCategory <> '30' then cast( cast( substring( _OrderOperation.OpLtstSchedldExecStrtTme, 1, 2) as abap.numc(2) ) as abap.int4 ) * 3600 + cast( cast( substring( _OrderOperation.OpLtstSchedldExecStrtTme, 3, 2) as abap.numc(2) ) as abap.int4 ) * 60 + cast( cast( substring( _OrderOperation.OpLtstSchedldExecStrtTme, 5, 2) as abap.numc(2) ) as abap.int4 ) when _Order.OrderCategory = '30' then cast( cast( substring( CapRqmtItmCap.OperationLatestStartTime, 1, 2) as abap.numc(2) ) as abap.int4 ) * 3600 + cast( cast( substring( CapRqmtItmCap.OperationLatestStartTime, 3, 2) as abap.numc(2) ) as abap.int4 ) * 60 + cast( cast( substring( CapRqmtItmCap.OperationLatestStartTime, 5, 2) as abap.numc(2) ) as abap.int4 ) end as OpLtstSchedldExecStrtTme AS int4endasOpLtstSchedldExecStrtTme,
  case when _Order.OrderCategory <> '30' then cast( cast( substring( _OrderOperation.LatestScheduledWaitEndTime, 1, 2) as abap.numc(2) ) as abap.int4 ) * 3600 + cast( cast( substring( _OrderOperation.LatestScheduledWaitEndTime, 3, 2) as abap.numc(2) ) as abap.int4 ) * 60 + cast( cast( substring( _OrderOperation.LatestScheduledWaitEndTime, 5, 2) as abap.numc(2) ) as abap.int4 ) when _Order.OrderCategory = '30' then cast( cast( substring( CapRqmtItmCap. OperationLatestEndTime, 1, 2) as abap.numc(2) ) as abap.int4 ) * 3600 + cast( cast( substring(CapRqmtItmCap. OperationLatestEndTime, 3, 2) as abap.numc(2) ) as abap.int4 ) * 60 + cast( cast( substring( CapRqmtItmCap. OperationLatestEndTime, 5, 2) as abap.numc(2) ) as abap.int4 ) end as OpLtstSchedldExecEndTme AS int4endasOpLtstSchedldExecEndTme,
  cast( case when CapRqmtItmCap.OperationIsPhase = '1' then ProcOpDurn.TotRemCapReqOpSegProcgDurn when CapRqmtItmCap.OperationIsPhase <> '1' then (( CapRqmtItmCap.RemainingCapReqOpSegSetupDurn + CapRqmtItmCap.RemainingCapReqOpSegTrdwnDurn + CapRqmtItmCap.RemainingCapReqOpSegProcgDurn ) ) end as abap.dec(16,3) ) as CapacityRequirementsAreDtmnd AS dec163asCapacityRequirementsAreDtmnd,
  cast('H' as char1) AS char_man,
  cast( case when CapRqmtItmCap.RemainingCapReqOpSegSetupDurn > 99999999 then fltp_to_dec(99999999.99 as abap.dec( 10,2)) when CapRqmtItmCap.RemainingCapReqOpSegSetupDurn <= 99999999 then fltp_to_dec(CapRqmtItmCap.RemainingCapReqOpSegSetupDurn as abap.dec( 10,2)) end as abap.dec(10,2) ) as RemainingCapReqOpSegSetupDurn AS dec102asRemainingCapReqOpSegSetupDurn,
  cast( case when CapRqmtItmCap.OperationIsPhase = '1' and ProcOpDurn.TotRemCapReqOpSegProcgDurn > 99999999 then fltp_to_dec(99999999.99 as abap.dec( 10,2)) when CapRqmtItmCap.OperationIsPhase = '1' and ProcOpDurn.TotRemCapReqOpSegProcgDurn <= 99999999 then fltp_to_dec(ProcOpDurn.TotRemCapReqOpSegProcgDurn as abap.dec( 10,2)) when CapRqmtItmCap.OperationIsPhase <> '1' and ProcOpDurn.TotRemCapReqOpSegProcgDurn > 99999999 then fltp_to_dec(99999999.99 as abap.dec( 10,2)) when CapRqmtItmCap.OperationIsPhase <> '1' and ProcOpDurn.TotRemCapReqOpSegProcgDurn <= 99999999 then fltp_to_dec(CapRqmtItmCap.RemainingCapReqOpSegProcgDurn as abap.dec( 10,2)) end as abap.dec(10,2) ) as RemainingCapReqOpSegProcgDurn AS dec102asRemainingCapReqOpSegProcgDurn,
  cast( case when CapRqmtItmCap.RemainingCapReqOpSegTrdwnDurn > 99999999 then fltp_to_dec(99999999.99 as abap.dec( 10,2)) when CapRqmtItmCap.RemainingCapReqOpSegTrdwnDurn <= 99999999 then fltp_to_dec(CapRqmtItmCap.RemainingCapReqOpSegTrdwnDurn as abap.dec( 10,2)) end as abap.dec(10,2) ) as RemainingCapReqOpSegTrdwnDurn AS dec102asRemainingCapReqOpSegTrdwnDurn,
  cast('0' as char1) AS OrderFirmingStatusCode,
  _Order.ScheduledBasicStartDate AS ScheduledBasicStartDate,
  _Order.ScheduledBasicStartTime AS ScheduledBasicStartTime,
  _Order.ScheduledBasicEndDate AS ScheduledBasicEndDate,
  _Order.ScheduledBasicEndTime AS ScheduledBasicEndTime,
  $session.system_date AS CurrentDate,
  _OrderOperation.Sequence AS Sequence,
  _Order._SalesOrder.SoldToParty AS Customer,
  _Order._SalesOrder.SalesOrganization AS SalesOrganization,
  _Order._SalesOrder.OrganizationDivision AS OrganizationDivision,
  _Order._SalesOrder.DistributionChannel AS DistributionChannel,
  case when workcenter._Plant._OrganizationAddress[1: AddressRepresentationCode = '' ].AddressTimeZone is null or workcenter._Plant._OrganizationAddress[1: AddressRepresentationCode = '' ].AddressTimeZone is initial then abap_system_timezone($session.client, 'NULL') when workcenter._Plant._OrganizationAddress[1: AddressRepresentationCode = '' ].AddressTimeZone is not null then workcenter._Plant._OrganizationAddress[1: AddressRepresentationCode = '' ].AddressTimeZone end as PlantTimeZone AS AddressTimeZoneendasPlantTimeZone,
  _OrderOper.StatusCode AS StatusCode,
  cast( _Ordermainitem.MRPArea as berid) AS MRPArea
FROM I_LogisticsOrder AS _Order
INNER JOIN I_SchedCapacityRqmtItemCap AS CapRqmtItmCap ON /* join condition not captured in parsed metadata */
INNER JOIN I_WorkCenter AS workcenter ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_WorkCenterCapacity AS workcenter_capacity ON CapRqmtItmCap.WorkCenterInternalID = workcenter_capacity.WorkCenterInternalID AND CapRqmtItmCap.CapacityInternalID = workcenter_capacity.CapacityInternalID  -- association [1..1]
LEFT OUTER JOIN I_PlannedOrder AS _PlannedOrder ON PlannedOrder = _PlannedOrder.PlannedOrder  -- association [0..1]
LEFT OUTER JOIN I_CapacityRequirement AS _CapacityRequirement ON CapacityRequirement = _CapacityRequirement.CapacityRequirement  -- association [1..1]
-- UNION ALL with additional select branch(es): I_PlannedOrder
;