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 C_OrderOperationSchedule.
-- 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 C_OrderOperationSchedule AS
SELECT
_OrderOperation.OrderInternalBillOfOperations AS OrderInternalBillOfOperations,
_OrderOperation.OrderIntBillOfOperationsItem AS OrderIntBillOfOperationsItem,
cast(_OrderOperation.ManufacturingOrder as aufnr preserving type) AS ManufacturingOrder,
_OrderOperation.ManufacturingOrderOperation AS ManufacturingOrderOperation,
_OrderOperation.MfgOrderOperationText AS MfgOrderOperationText,
_OrderOperation.OperationHasLongText AS OperationHasLongText,
_OrderOperation.ManufacturingOrderSubOperation AS ManufacturingOrderSubOperation,
_OperSequence.SequenceCategory AS MfgOrderSequenceCategory,
_OperSequence.SequenceCategoryName AS SequenceCategoryName,
_OperSequence.Sequence AS Sequence,
_OperSequence.MfgOrderSequenceBrnchOperation AS MfgOrderSequenceBrnchOperation,
_OperSequence.MfgOrderSequenceRetOperation AS MfgOrderSequenceRetOperation,
_OperSequence.ReferenceSequence AS ReferenceSequence,
_OperSequence.BranchOperationInternalID AS BranchOperationInternalID,
_OperSequence.ReturnOperationInternalID AS ReturnOperationInternalID,
_OrderOperation._MfgOrder.Material AS Material,
_OrderOperation.ManufacturingOrderSequence AS ManufacturingOrderSequence,
_OrderOperation.ProductionPlant AS ProductionPlant,
_OrderOperation.WorkCenterInternalID AS WorkCenterInternalID,
_OrderOperation.WorkCenter AS WorkCenter,
_OrderOperation._WorkCenter._Text[1: Language=$session.system_language].WorkCenterText AS WorkCenterText,
_OrderOperation.WorkCenterTypeCode AS WorkCenterTypeCode,
_OrderOperation.ManufacturingOrderCategory AS ManufacturingOrderCategory,
_OrderOperation.ManufacturingOrderType AS ManufacturingOrderType,
_OrderOperation.ProductionSupervisor AS ProductionSupervisor,
_OrderOperation._ProductionSupervisor.ProductionSupervisorName AS ProductionSupervisorName,
_OrderOperation.MRPController AS MRPController,
_OrderOperation.MRPControllerName AS MRPControllerName,
_OrderOperation._ProductionPlant.PlantName AS ProductionPlantName,
cast(_OrderOperation._ProductionPlant._Address.AddressTimeZone as co_plant_timezone ) AS PlantTimeZone,
_OrderOperation.OperationControlProfile AS OperationControlProfile,
_OrderOperation.OperationIsClosed AS OperationIsClosed,
_OrderOperation.OperationIsTechlyCompleted AS OperationIsTechlyCompleted,
_OrderOperation.OperationIsDelivered AS OperationIsDelivered,
_OrderOperation.OperationIsPartiallyDelivered AS OperationIsPartiallyDelivered,
_OrderOperation.OperationIsPartiallyConfirmed AS OperationIsPartiallyConfirmed,
_OrderOperation.OperationIsPrinted AS OperationIsPrinted,
_OrderOperation.OperationIsReleased AS OperationIsReleased,
_OrderOperation.OperationIsCreated AS OperationIsCreated,
_OrderOperation.OperationIsScheduled AS OperationIsScheduled,
_OrderOperation.OperationIsConfirmed AS OperationIsConfirmed,
_OrderOperation.OperationIsDeleted AS OperationIsDeleted,
cast( case when _OrderOperation.OperationIsDeleted = 'X' then '10' when _OrderOperation.OperationIsClosed = 'X' then '09' when _OrderOperation.OperationIsTechlyCompleted = 'X' then '08' when _OrderOperation.OperationIsDelivered = 'X' then '07' when _OrderOperation.OperationIsPartiallyDelivered = 'X' then '06' when _OrderOperation.OperationIsConfirmed = 'X' then '05' when _OrderOperation.OperationIsPartiallyConfirmed = 'X' then '04' when _OrderOperation.OperationIsReleased = 'X' then '03' when _OrderOperation.OperationIsScheduled = 'X' then '02' when _OrderOperation.OperationIsCreated = 'X' then '01' end as abap.numc(2)) as OperationStatusInternalID AS numc2asOperationStatusInternalID,
_OrderOperation.OpPlannedTotalQuantity AS OpPlannedTotalQuantity,
_OrderOperation.OpTotalConfirmedYieldQty AS OpTotalConfirmedYieldQty,
_OrderOperation.OperationReferenceQuantity AS OperationReferenceQuantity,
_OrderOperation.OpPlannedScrapQuantity AS OpPlannedScrapQuantity,
_OrderOperation.OperationConfirmedReworkQty AS OperationConfirmedReworkQty,
_OrderOperation.OpTotalConfirmedScrapQty AS OpTotalConfirmedScrapQty,
_latestOp.OpLtstConfirmedScrapQty AS OpLtstConfirmedScrapQty,
_OrderOperation.GoodsRecipientName AS GoodsRecipientName,
_OrderOperation.UnloadingPointName AS UnloadingPointName,
_OrderOperation.OpLtstSchedldExecStrtDte AS OpLtstSchedldExecStrtDte,
_OrderOperation.OpLtstSchedldExecStrtTme AS OpLtstSchedldExecStrtTme,
_OrderOperation.OpLtstSchedldExecEndDte AS OpLtstSchedldExecEndDte,
_OrderOperation.OpLtstSchedldExecEndTme AS OpLtstSchedldExecEndTme,
_OrderOperation.OpActualExecutionStartDate AS OpActualExecutionStartDate,
_OrderOperation.OpActualExecutionStartTime AS OpActualExecutionStartTime,
_OrderOperation.OpActualExecutionEndDate AS OpActualExecutionEndDate,
_OrderOperation.OpActualExecutionEndTime AS OpActualExecutionEndTime,
case when _OrderShopFloorStatus.StatusCode is not null then 'X' end AS OrderIsShopFloorOrder,
_OrderOperation._MfgOrder AS _MfgOrder,
_OrderOperation._WorkCenter AS _WorkCenter,
_OrderOperation._WorkCenterBySemanticKey AS _WorkCenterBySemanticKey,
_OrderOperation._ProductionPlant AS _ProductionPlant,
_OrderOperation._MfgOrder._Material AS _Material,
_OrderOperation._OperationUnit AS _OperationUnit,
_ManufacturingFeatureStatus.ManufacturingFeature AS ManufacturingFeature,
_ManufacturingFeatureStatus.ManufacturingFeatureIsActive AS ManufacturingFeatureIsActive,
_ManufacturingFeatureStatus.MfgFeatureIsActiveInAnyPlant AS MfgFeatureIsActiveInAnyPlant,
cast('' as mpe_effectivity_parameter_desc) AS EffectivityParameterDesc,
cast('' as abap.sstring( 256 )) AS EffctyTypeCnctntdParamDesc,
_OrderOperation._MfgOrder._BillOfOperations._BillOfOperationsVersionType.BOOVersionChangeRecordIsRqd AS BOOVersionChangeRecordIsRqd,
_OrderOperation.BillOfOperationsType AS BillOfOperationsType,
cast(_OrderOperation.BillOfOperationsGroup as mpe_rtg_routing_group preserving type ) AS BillOfOperationsGroup,
cast(_OrderOperation.BillOfOperationsVariant as mpe_rtg_routing_variant preserving type) AS BillOfOperationsVariant,
_OrderOperation.BillOfOperationsVersion AS BillOfOperationsVersion,
_OrderOperation.MfgOrderOperationOrigin AS MfgOrderOperationOrigin,
_MfgOrderOperationOrigin._Text[1: Language=$session.system_language].MfgOrderOperationOriginName AS MfgOrderOperationOriginName,
cast( ' ' as boole_d preserving type ) AS ChangeImpactRelevanceFlagIsSet,
cast( ' ' as boole_d preserving type ) AS OperationIsImpacted,
_OrderOperation.ManufacturingObject AS ManufacturingObject,
case when _OrderMarkedForDeletion.StatusCode is not null then 'X' end AS OrderIsMarkedForDeletion,
_UserStatus(im_clnt: $session.client).UserStatusText AS UserStatusText,
_UserStatus(im_clnt: $session.client).StatusProfile AS StatusProfile
FROM P_ManageOperations AS _OrderOperation
LEFT OUTER JOIN I_StatusObjectStatusBasic AS _OrderShopFloorStatus ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_StatusObjectStatusBasic AS _OrderMarkedForDeletion ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_ManufacturingFeatureStatus AS _ManufacturingFeatureStatus ON ProductionPlant = _ManufacturingFeatureStatus.Plant AND _ManufacturingFeatureStatus.ManufacturingFeature = 'EPO' -- association [0..1]
LEFT OUTER JOIN I_OrderItem AS _OrderItem ON ManufacturingOrder = _OrderItem.OrderID AND _OrderItem.OrderItem = '0001' -- association [0..1]
LEFT OUTER JOIN I_MfgOrderOperationOrigin AS _MfgOrderOperationOrigin ON MfgOrderOperationOrigin = _MfgOrderOperationOrigin.MfgOrderOperationOrigin -- association [0..1]
LEFT OUTER JOIN E_OrderOperation AS _Extension ON OrderInternalBillOfOperations = _Extension.OrderInternalID AND OrderIntBillOfOperationsItem = _Extension.OrderOperationInternalID -- association [1..1]
LEFT OUTER JOIN P_OperationSequence AS _OperSequence ON OrderInternalBillOfOperations = _OperSequence.OrderInternalID AND ManufacturingOrderSequence = _OperSequence.Sequence -- association [1..1]
LEFT OUTER JOIN P_MFGOrderOpPRTAssignment AS _ProdnRsceTool ON OrderInternalBillOfOperations = _ProdnRsceTool.MfgOrderInternalID AND OrderIntBillOfOperationsItem = _ProdnRsceTool.OrderOperationInternalID -- association [0..1]
LEFT OUTER JOIN P_Oper_UserStatuses AS _UserStatus ON OrderInternalBillOfOperations = _UserStatus.OrderInternalBillOfOperations AND OrderIntBillOfOperationsItem = _UserStatus.OrderIntBillOfOperationsItem -- association [0..1]
LEFT OUTER JOIN P_LatestOperation AS _latestOp ON OrderInternalBillOfOperations = _latestOp.OrderInternalBillOfOperations -- association [0..1]
;