P_MPEProdnOrderPover is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_MfgOrder) and exposes 71 fields with key field ManufacturingOrder. It has 5 associations to related views.
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_MPEProdnOrderPover.-- 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_MPEProdnOrderPover ASSELECT
mfgorder.ManufacturingOrder AS ManufacturingOrder,
mfgorder.OrderInternalBillOfOperations AS OrderInternalBillOfOperations,
mfgorder.ManufacturingOrderCategory AS ManufacturingOrderCategory,
mfgorder.ProductionPlant AS ProductionPlant,
mfgorder.Material AS Material,
mfgorder._Material._Text[1: Language = $session.system_language].MaterialName AS MaterialName,
_OrdData.OrderStatus AS OrderStatus,
mfgorder.ManufacturingOrderImportance AS ManufacturingOrderImportance,
mfgorder.ManufacturingOrderType AS ManufacturingOrderType,
mfgorder._MfgOrderType._Text[1: Language = $session.system_language].ManufacturingOrderTypeName AS ManufacturingOrderTypeName,
mfgorder.MfgOrderScheduledReleaseDate AS MfgOrderScheduledReleaseDate,
mfgorder.MfgOrderPlannedStartDate AS MfgOrderPlannedStartDate,
mfgorder.MfgOrderPlannedStartTime AS MfgOrderPlannedStartTime,
mfgorder.MfgOrderPlannedEndDate AS MfgOrderPlannedEndDate,
mfgorder.MfgOrderPlannedEndTime AS MfgOrderPlannedEndTime,
mfgorder.MfgOrderScheduledStartDate AS MfgOrderScheduledStartDate,
mfgorder.MfgOrderActualStartDate AS MfgOrderActualStartDate,
mfgorder.MfgOrderActualStartTime AS MfgOrderActualStartTime,
mfgorder.MfgOrderActualEndDate AS MfgOrderActualEndDate,
_OrdData.MaterialGoodsReceiptDuration AS MaterialGoodsReceiptDuration,
mfgorder.ProductionUnit AS ProductionUnit,
mfgorder.MfgOrderPlannedTotalQty AS MfgOrderPlannedTotalQty,
mfgorder.MfgOrderPlannedScrapQty AS MfgOrderPlannedScrapQty,
mfgorder.ActualDeliveredQuantity AS ActualDeliveredQuantity,
mfgorder.ExpectedDeviationQuantity * (-1) AS ExpectedDeviationQuantity,
cast( casewhen IsCompletelyDelivered = 'X' then 0 when MfgOrderPlannedTotalQty - MfgOrderPlannedScrapQty - ActualDeliveredQuantity - ExpectedDeviationQuantity < 0 then 0 else MfgOrderPlannedTotalQty - MfgOrderPlannedScrapQty - ActualDeliveredQuantity - ExpectedDeviationQuantity endas abap.quan(17,3) ) as OpenQuantity AS quan173asOpenQuantity,
mfgorder.IsCompletelyDelivered AS IsCompletelyDelivered,
mfgorder.ProductionVersion AS ProductionVersion,
mfgorder._ProductionVersion.ProductionVersionText AS ProductionVersionText,
mfgorder._ProductionVersion.Plant AS Plant,
mfgorder._ProductionVersion.ProductionLine AS ProductionLine,
mfgorder._ProductionVersion._ProductionLine._WorkCenterTextBySemanticKey[ 1: Language = $session.system_language ].WorkCenterText AS WorkCenterText,
mfgorder.MRPPlant AS MRPPlant,
mfgorder.MRPController AS MRPController,
mfgorder._MRPController.MRPControllerName AS MRPControllerName,
mfgorder.ProductionSupervisor AS ProductionSupervisor,
mfgorder._ProductionSupervisor.ProductionSupervisorName AS ProductionSupervisorName,
_LeadingMfgOrder.Material AS LeadingMfgOrderMaterial,
_LeadingMfgOrder._Material._Text[1: Language = $session.system_language].MaterialName AS LeadingMfgOrderMaterialName,
mfgorder.LeadingOrder AS LeadingOrder,
_SalesDocumentItem.SalesDocument AS SlsDoc,
_SalesDocumentItem.SalesDocumentItem AS SlsDocItm,
_SalesDocumentItem.SDDocumentCategory AS SlsDocCat,
_SalesDocumentItem._SDDocumentCategory._Text[1: Language = $session.system_language].SDDocumentCategoryName AS SlsDocCatName,
coalesce( _SalesDocumentItem.SalesDocument, mfgorder.SalesOrder ) AS SDDocument,
coalesce( _SalesDocumentItem.SalesDocumentItem, mfgorder.SalesOrderItem ) AS SDDocumentItem,
coalesce( _SalesDocumentItem.SDDocumentCategory, mfgorder._SalesDocumentItem.SDDocumentCategory ) AS SDDocumentCategory,
mfgorder.SalesOrder AS ReferenceSDDocument,
mfgorder.SalesOrderItem AS ReferenceSDDocumentItem,
mfgorder._SalesDocument.SoldToParty AS SoldToParty,
mfgorder._SalesDocument._SoldToParty.CustomerName AS CustomerName,
mfgorder._SalesDocument._SoldToParty.AuthorizationGroup AS AuthorizationGroup,
_WBSElement.WBSElement AS WBSElement,
_WBSElement.WBSDescription AS WBSDescription,
_WBSElement._Project.Project AS Project,
_WBSElement._Project.ProjectDescription AS ProjectDescription,
mfgorder.InspectionLot AS InspectionLot,
dats_tims_to_tstmp( mfgorder.LastChangeDate, mfgorder.LastChangeTime, abap_system_timezone( $session.client,'NULL' ), $session.client,'NULL' ) as LastChangeDateTime AS clientNULLasLastChangeDateTime,
mfgorder.WBSElementInternalID AS WBSElementInternalID,
mfgorder._SalesDocument._SoldToParty AS _SoldToParty
FROM I_MfgOrder AS mfgorder
LEFTOUTERJOIN I_SalesDocumentItem AS _SalesDocumentItem ON _SalesDocumentItem.ReferenceSDDocument = ReferenceSDDocument AND _SalesDocumentItem.ReferenceSDDocumentItem = ReferenceSDDocumentItem AND _SalesDocumentItem.ReferenceSDDocumentCategory = 'B' -- association [0..1]LEFTOUTERJOIN P_MPEProdnOrdItmDvtnDurn AS _OrdData ON ManufacturingOrder = _OrdData.ManufacturingOrder -- association [0..1]LEFTOUTERJOIN I_StatusCodeText AS _StatusText ON _StatusText.StatusCode = orderstatus AND _StatusText.StatusProfile = '' AND _StatusText.Language = $session.system_language -- association [0..1]LEFTOUTERJOIN I_MfgOrder AS _LeadingMfgOrder ON LeadingOrder = _LeadingMfgOrder.ManufacturingOrder -- association [0..1]LEFTOUTERJOIN I_WBSElement AS _WBSElement2 ON WBSElementInternalID = _WBSElement2.WBSElementInternalID -- association [0..1]
;