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_Manageoperations.
-- 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_Manageoperations AS
SELECT
cast(_OrderOperation.ManufacturingOrder as aufnr preserving type) AS ManufacturingOrder,
_OrderOperation._WorkCenter._Text[1: Language=$session.system_language].WorkCenterText AS WorkCenterText,
_OrderOperation._ProductionSupervisor.ProductionSupervisorName AS ProductionSupervisorName,
_OrderOperation._ProductionPlant.PlantName AS ProductionPlantName,
cast( _OrderOperation._ProductionPlant._OrganizationAddress[AddressRepresentationCode = ''].AddressTimeZone as co_plant_timezone ) AS PlantTimeZone,
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,
cast( case when _OrderOperation.OperationYieldDeviationQty < 0 then ( - 1 * _OrderOperation.OperationYieldDeviationQty ) else 0 end as abap.quan(19,3) ) AS MissingQuantity,
cast( case when _OrderOperation.OperationYieldDeviationQty < 0 then 0 else _OrderOperation.OperationYieldDeviationQty end as abap.quan(13,3) ) AS OverDeliveryQuantity,
case _OrderOperation.OpPlannedTotalQuantity when 0 then 0 else case when _OrderOperation.OperationYieldDeviationQty < 0 then ( cast(( - 1 * _OrderOperation.OperationYieldDeviationQty * 100) as abap.fltp ) / cast(_OrderOperation.OpPlannedTotalQuantity as abap.fltp) ) else 0.0 end end as MissingQuantityInPercent AS 0endendasMissingQuantityInPercent,
case _OrderOperation.OpPlannedTotalQuantity when 0 then 0 else case when _OrderOperation.OperationYieldDeviationQty < 0 then 0.0 else ((cast((_OrderOperation.OperationYieldDeviationQty * 100) as abap.fltp ) / cast(_OrderOperation.OpPlannedTotalQuantity as abap.fltp))) end end as OverdeliveryInPercent AS fltpendendasOverdeliveryInPercent,
case when _OrderShopFloorStatus.StatusCode is not null then 'X' end AS OrderIsShopFloorOrder,
cast('' as mpe_effectivity_parameter_desc) AS EffectivityParameterDesc,
cast('' as abap.sstring( 256 )) AS EffctyTypeCnctntdParamDesc,
cast(_OrderOperation.BillOfOperationsGroup as mpe_rtg_routing_group preserving type ) AS BillOfOperationsGroup,
cast(_OrderOperation.BillOfOperationsVariant as mpe_rtg_routing_variant preserving type) AS BillOfOperationsVariant,
_MfgOrderOperationOrigin._Text[1: Language=$session.system_language].MfgOrderOperationOriginName AS MfgOrderOperationOriginName,
cast( ' ' as abap.char( 255 ) ) AS NetChangeAnalysisPath,
cast( ' ' as boole_d preserving type ) AS ChangeImpactRelevanceFlagIsSet,
cast( ' ' as boole_d preserving type ) AS OperationIsImpacted,
_UserStatus(im_clnt: $session.client).UserStatusText AS UserStatusText,
_UserStatus(im_clnt: $session.client).StatusProfile AS StatusProfile,
_OrderOperation.OrderInternalBillOfOperations AS OrderInternalBillOfOperations,
_OrderOperation.OrderIntBillOfOperationsItem AS OrderIntBillOfOperationsItem,
_OrderOperation.ManufacturingOrderOperation AS ManufacturingOrderOperation,
_OrderOperation.SalesOrder AS SalesOrder,
_OrderOperation.SalesOrderItem AS SalesOrderItem,
_OrderOperation.MfgOrderOperationText AS MfgOrderOperationText,
_OrderOperation.SerialNmbrAssgmtProfileIsAssgd AS SerialNmbrAssgmtProfileIsAssgd,
_OrderOperation.ManufacturingOrderSubOperation AS ManufacturingOrderSubOperation,
_OrderOperation.MaterialName AS MaterialName,
_OrderOperation.Batch AS Batch,
_OrderOperation.Material AS Material,
_OrderOperation.ProdnProcgIsFlexible AS ProdnProcgIsFlexible,
_OrderOperation.ProdnProcgFlexibilityIndName AS ProdnProcgFlexibilityIndName,
_OrderOperation.ManufacturingOrderSequence AS ManufacturingOrderSequence,
_OrderOperation.ProductionPlant AS ProductionPlant,
_OrderOperation.WorkCenterInternalID AS WorkCenterInternalID,
_OrderOperation.WorkCenter AS WorkCenter,
_OrderOperation.WorkCenterTypeCode AS WorkCenterTypeCode,
_OrderOperation.ManufacturingOrderCategory AS ManufacturingOrderCategory,
_OrderOperation.ManufacturingOrderType AS ManufacturingOrderType,
_OrderOperation.ProductionSupervisor AS ProductionSupervisor,
_OrderOperation.MRPController AS MRPController,
_OrderOperation.MRPControllerName AS MRPControllerName,
_OrderOperation.NumberOfConfirmationSlips AS NumberOfConfirmationSlips,
_OrderOperation.OperationImportance AS OperationImportance,
_OrderOperation.NumberOfTimeTickets AS NumberOfTimeTickets,
_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,
_OrderOperation.OpPlannedTotalQuantity AS OpPlannedTotalQuantity,
_OrderOperation.OpTotalConfirmedYieldQty AS OpTotalConfirmedYieldQty,
_OrderOperation.OperationReferenceQuantity AS OperationReferenceQuantity,
_OrderOperation.OpPlannedScrapQuantity AS OpPlannedScrapQuantity,
_OrderOperation.OperationConfirmedReworkQty AS OperationConfirmedReworkQty,
_OrderOperation.OpTotalConfirmedScrapQty AS OpTotalConfirmedScrapQty,
_OrderOperation.OperationUnit AS OperationUnit,
_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,
_OrderOperation.OperationExecutionEndIsLate AS OperationExecutionEndIsLate,
_OrderOperation.OperationExecutionStartIsLate AS OperationExecutionStartIsLate,
_OrderOperation.OperationYieldDeviationQty AS OperationYieldDeviationQty,
_OrderOperation.ExecutionStartLatenessInHours AS ExecutionStartLatenessInHours,
_OrderOperation.ExecutionEndLatenessInHours AS ExecutionEndLatenessInHours,
_OrderOperation.ExecutionStartLatenessInMins AS ExecutionStartLatenessInMins,
_OrderOperation.ExecutionEndLatenessInMinutes AS ExecutionEndLatenessInMinutes,
_OrderOperation.OperationStartDeviationDays AS OperationStartDeviationDays,
_OrderOperation.PlannedEndDateDvtnInDays AS PlannedEndDateDvtnInDays,
_OrderOperation.InspectionLot AS InspectionLot,
_OrderOperation.ProductConfiguration AS ProductConfiguration,
_OrderOperation._WorkCenter AS _WorkCenter,
_OrderOperation._WorkCenterBySemanticKey AS _WorkCenterBySemanticKey,
_OrderOperation._ProductionPlant AS _ProductionPlant,
_OrderOperation._Material AS _Material,
_OrderOperation._OperationUnit AS _OperationUnit,
_OrderOperation.BOOVersionChangeRecordIsRqd AS BOOVersionChangeRecordIsRqd,
_OrderOperation.BillOfOperationsType AS BillOfOperationsType,
_OrderOperation.BillOfOperationsVersion AS BillOfOperationsVersion,
_OrderOperation.MfgOrderOperationOrigin AS MfgOrderOperationOrigin,
_OrderOperation.ManufacturingObject AS ManufacturingObject,
_OrderOperation.Reservation AS Reservation,
_ControlProfile.ConfirmationIsNotPossible AS ConfirmationIsNotPossible,
_latestOp.OpLtstConfirmedScrapQty AS OpLtstConfirmedScrapQty,
_ManufacturingFeatureStatus.ManufacturingFeature AS ManufacturingFeature,
_ManufacturingFeatureStatus.ManufacturingFeatureIsActive AS ManufacturingFeatureIsActive,
_ManufacturingFeatureStatus.MfgFeatureIsActiveInAnyPlant AS MfgFeatureIsActiveInAnyPlant,
_MfgOrder.ProductionUnit AS ProductionUnit,
_OperSequence.SequenceCategory AS MfgOrderSequenceCategory,
_OperSequence.SequenceCategoryName AS SequenceCategoryName,
_OperSequence.MfgOrderSequenceBrnchOperation AS MfgOrderSequenceBrnchOperation,
_OperSequence.MfgOrderSequenceRetOperation AS MfgOrderSequenceRetOperation,
_OperSequence.ReferenceSequence AS ReferenceSequence,
_QualityIssue.InspHasRejectedCharc AS InspHasRejectedCharc,
_QualityIssue.InspHasRejectedInspSubset AS InspHasRejectedInspSubset,
_QualityIssue.InspHasRejectedInspLot AS InspHasRejectedInspLot
FROM I_ManageOperationsTP AS _OrderOperation
LEFT OUTER JOIN I_StatusObjectStatusBasic AS _OrderMarkedForDeletion ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_StatusObjectStatusBasic AS _OrderShopFloorStatus ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_MatlNmbrOfProdnHolds AS _MatlNmbrOfProdnHolds ON _MatlNmbrOfProdnHolds.Material = Material -- association [0..1]
LEFT OUTER JOIN P_MfgOrderNmbrOfOrderHolds AS _MfgOrderNmbrOfOrderHolds ON _MfgOrderNmbrOfOrderHolds.ManufacturingOrder = _OrderOperation.ManufacturingOrder -- association [0..1]
LEFT OUTER JOIN P_OperNmbrOfProdnHolds AS _OperNmbrOfProdnHolds ON _OperNmbrOfProdnHolds.OrderInternalID = OrderInternalBillOfOperations AND _OperNmbrOfProdnHolds.OrderOperationInternalID = OrderIntBillOfOperationsItem -- association [0..1]
LEFT OUTER JOIN P_WrkCtrNmbrOfProdnHolds AS _WrkCtrNmbrOfProdnHolds ON _WrkCtrNmbrOfProdnHolds.WorkCenterInternalID = WorkCenterInternalID AND _WrkCtrNmbrOfProdnHolds.WorkCenterTypeCode = WorkCenterTypeCode -- association [0..1]
LEFT OUTER JOIN P_MfgOrderOpNmbrOfOpActyOnHold AS _MfgOrderOpNmbrOfOpActyOnHold ON _MfgOrderOpNmbrOfOpActyOnHold.OrderInternalID = OrderInternalBillOfOperations AND _MfgOrderOpNmbrOfOpActyOnHold.OrderOperationInternalID = OrderIntBillOfOperationsItem AND _MfgOrderOpNmbrOfOpActyOnHold.OpActyHasHold > 0 AND _MfgOrderOpNmbrOfOpActyOnHold.OpActyWithoutHold = 0 -- association [0..1]
LEFT OUTER JOIN P_Mfgcompsmissaggr AS _Component ON OrderInternalBillOfOperations = _Component.OrderInternalBillOfOperations AND OrderIntBillOfOperationsItem = _Component.OrderIntBillOfOperationsItem -- association [0..1]
LEFT OUTER JOIN I_OperationControlProfile AS _ControlProfile ON OperationControlProfile = _ControlProfile.OperationControlProfile -- association [0..1]
LEFT OUTER JOIN P_MPEInspIssuesByOperation AS _QualityIssue ON OrderInternalBillOfOperations = _QualityIssue.OrderInternalBillOfOperations AND OrderIntBillOfOperationsItem = _QualityIssue.InspPlanOperationInternalID AND InspectionLot = _QualityIssue.InspectionLot -- association [0..1]
LEFT OUTER JOIN I_ManufacturingFeatureStatus AS _ManufacturingFeatureStatus ON ProductionPlant = _ManufacturingFeatureStatus.Plant AND _ManufacturingFeatureStatus.ManufacturingFeature = 'EPO' -- association [0..1]
LEFT OUTER JOIN I_MfgOrderOperationOrigin AS _MfgOrderOperationOrigin ON MfgOrderOperationOrigin = _MfgOrderOperationOrigin.MfgOrderOperationOrigin -- association [0..1]
LEFT OUTER JOIN I_MfgOrderBasic AS _MfgOrder ON ManufacturingOrder = _MfgOrder.ManufacturingOrder AND _MfgOrder.ManufacturingOrderCategory = '10' -- 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]
;