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_QualityControlChart.
-- 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_QualityControlChart AS
SELECT
_QualityControlChart.QualityControlChart AS QualityControlChart,
_QualityControlChartResults.InspectionLot AS InspectionLot,
_QualityControlChartResults.InspPlanOperationInternalID AS InspPlanOperationInternalID,
_QualityControlChartResults.InspectionSubsetInternalID AS InspectionSubsetInternalID,
cast (_QualityControlChart.QualityControlChartType as vdm_qmcharttype preserving type ) AS QualityControlChartType,
_QualityControlChart._QualityControlChartType._Text[1:Language=$session.system_language].QualityControlChartTypeText AS QualityControlChartTypeText,
_QualityControlChartResults.InspectionCharacteristic AS InspectionCharacteristic,
_QualityControlChartResults.InspectionSpecificationText AS InspectionSpecificationText,
_QualityControlChart.QualityControlChartStatus AS QualityControlChartStatus,
_QualityControlChart._QualityControlChartStatus._Text[1:Language=$session.system_language].QualityControlChartStatusText AS QualityControlChartStatusText,
_QualityControlChart.WorkCenter AS ControlChartWorkCenter,
_QualityControlChart._WorkCenter._WorkCenterTextBySemanticKey[1:Language=$session.system_language].WorkCenterText AS ControlChartWorkCenterText,
_QualityControlChart.Plant AS Plant,
_QualityControlChart._Plant.PlantName AS PlantName,
_QualityControlChart.Material AS ControlChartMaterial,
_QualityControlChart._Material._Text[1:Language=$session.system_language].MaterialName AS ControlChartMaterialText,
_QualityControlChart._InspectionLot.Material AS Material,
_QualityControlChart._InspectionLot._Material._Text[1:Language=$session.system_language].MaterialName AS MaterialName,
_QualityControlChartResults.WorkCenter AS WorkCenter,
_QualityControlChartResults.WorkCenterText AS WorkCenterText,
_QualityControlChart.QltyCtrlChartAggrgnCriterion AS QltyCtrlChartAggrgnCriterion,
_QualityControlChart._QltyCtrlChartAggrgnCriterion._Text[1:Language=$session.system_language].QltyCtrlChtAggrgnCriterionTxt AS QltyCtrlChtAggrgnCriterionTxt,
_QltyCtrlChtCalc.QltyCtrlChtDvtnSts AS QltyCtrlChtDvtnSts,
_QltyCtrlChtCalc._QltyCtrlChtDvtnSts._QltyCtrlChtDvtnStsTxt[1:Language=$session.system_language].QltyCtrlChtDvtnStsTxt AS QltyCtrlChtDvtnStsTxt,
_QualityControlChart.InspectionSpecification AS InspectionSpecification,
_QualityControlChartResults.BillOfOperationsType AS BillOfOperationsType,
_QualityControlChartResults.BillOfOperationsGroup AS BillOfOperationsGroup,
_QualityControlChartResults.BillOfOperationsVariant AS BillOfOperationsVariant,
_QualityControlChart.InspectionSpecificationPlant AS InspectionSpecificationPlant,
_QualityControlChart.MainWorkCenterPlant AS MainWorkCenterPlant,
_QualityControlChart.Equipment AS Equipment,
_QualityControlChart.FunctionalLocation AS FunctionalLocation,
_QualityControlChartResults.Supplier AS InspLotSelectionSupplier,
_QualityControlChart._InspectionLot.Customer AS Customer,
_QualityControlChart._InspectionLot.InspectionLotOrigin AS InspectionLotOrigin,
_QualityControlChart._InspectionLot.InspectionLotType AS InspectionLotType,
_QualityControlChart._InspectionLot._InspectionLotType._Text[1:Language=$session.system_language].InspectionLotTypeText AS InspectionLotTypeText,
_QualityControlChart._InspectionLot.Manufacturer AS Manufacturer,
_QualityControlChart.QualityControlChartText AS QualityControlChartText,
_QualityControlChart._QualityControlChartType.ControlChartAxisType AS ControlChartAxisType,
_QualityControlChart.InspSpecUpperLimit AS InspSpecUpperLimit,
_QualityControlChart.InspSpecHasUpperLimit AS InspSpecHasUpperLimit,
_QualityControlChart.InspSpecLowerLimit AS InspSpecLowerLimit,
_QualityControlChart.InspSpecHasLowerLimit AS InspSpecHasLowerLimit,
_QltyCtrlChtCalc.QualityControlChartTracks AS QualityControlChartTracks,
cast( 0 as vdm_qmsmplsize ) AS InspectionSampleSize,
cast( 0 as qvarianz ) AS InspResultVariance,
_QualityControlChartResults.InspectionValuationResult AS InspectionValuationResult,
_QualityControlChartResults.InspSubsetResultValuation AS InspSubsetResultValuation,
cast ( _QualityControlChartResults.InspectionEndDate as vdm_qpruefdatb preserving type ) AS InspectionEndDate,
cast ( _QualityControlChartResults.InspectionEndTime as qpruefztb preserving type ) AS InspectionEndTime,
cast( '' as vdm_qqrkcpc ) AS CtrlChartProcessCapability,
cast( '' as vdm_qqrkcpkc ) AS CtrlChartMeanProcessCapability,
cast( '' as qqrkpc ) AS InspectionNonconformingRatio,
cast( 0 as qanzstipro ) AS InspectionPartialSampleSize,
cast( _QltyCtrlChtTrack1.CtrlChartLowerActionLimit as vdm_qqrkueg1 preserving type ) AS CtrlChartLowerActionLimit,
cast( _QltyCtrlChtTrack1.CtrlChartLowerWarningLimit as vdm_qqrkuwg1 preserving type ) AS CtrlChartLowerWarningLimit,
cast( _QltyCtrlChtTrack1.CtrlChartMeanValue as vdm_qqrkmil1 preserving type ) AS CtrlChartMeanValue,
cast( _QltyCtrlChtTrack1.CtrlChartUpperActionLimit as vdm_qqrkoeg1 preserving type ) AS CtrlChartUpperActionLimit,
cast( _QltyCtrlChtTrack1.CtrlChartUpperWarningLimit as vdm_qqrkowg1 preserving type ) AS CtrlChartUpperWarningLimit,
_QualityControlChart.BillOfOperationsType AS CtrlChartBillOfOperationsType,
_QualityControlChart._BillOfOperationsType._Text[1:Language=$session.system_language].BillOfOperationsTypeName AS BillOfOperationsTypeName,
_QualityControlChart.BillOfOperationsGroup AS CtrlChartBillOfOperationsGroup,
_QualityControlChart.BillOfOperationsVariant AS CtrlChtBillOfOperationsVariant,
_QualityControlChart.QltyCtrlChartCreatedByUser AS QltyCtrlChartCreatedByUser,
cast( _QualityControlChart.QltyCtrlChartCreationDate as vdm_erdat preserving type ) AS QltyCtrlChartCreationDate,
_QualityControlChart.QltyCtrlChartCreationTime AS QltyCtrlChartCreationTime,
_QualityControlChart.QltyCtrlChartLastChangedByUser AS QltyCtrlChartLastChangedByUser,
_QualityControlChart.QltyCtrlChartLastChangedDate AS QltyCtrlChartLastChangedDate,
_QualityControlChart.QltyCtrlChartLastChangedTime AS QltyCtrlChartLastChangedTime,
_QltyCtrlChtCalc.LastCtrlChtInspectionLot AS LastCtrlChtInspectionLot,
_QltyCtrlChtCalc.LastCtrlChtInspPlanOplIntID AS LastCtrlChtInspPlanOplIntID,
_QltyCtrlChtCalc.LastCtrlChtInspCharacteristic AS LastCtrlChtInspCharacteristic,
_QltyCtrlChtCalc.LastCtrlChtInspSbstIntID AS LastCtrlChtInspSbstIntID,
_QualityControlChartResults.Supplier AS Supplier,
_QualityControlChart._QualityControlChartStatus AS _QualityControlChartStatus,
_QualityControlChart._WorkCenter AS _WorkCenter,
_QualityControlChart._QltyCtrlChartAggrgnCriterion AS _QltyCtrlChartAggrgnCriterion,
_QualityControlChart._Material AS _Material,
_QualityControlChart._MainWorkCenterPlant AS _MainWorkCenterPlant,
_QualityControlChart._InspectionLot._Customer AS _Customer,
_QualityControlChart._InspectionLot._InspectionLotType AS _InspectionLotType,
_QualityControlChart._InspectionLot._InspectionLotOrigin AS _InspectionLotOrigin,
_QualityControlChart._InspectionLot._Manufacturer AS _Manufacturer,
_QualityControlChart._Supplier.IsBusinessPurposeCompleted AS IsBusinessPurposeCompleted,
_QualityControlChart._Supplier.AuthorizationGroup AS AuthorizationGroup
FROM I_QualityCtrlChartTP AS _QualityControlChart
LEFT OUTER JOIN P_QualityControlChartResults AS _QualityControlChartResults ON QualityControlChart = _QualityControlChartResults.QualityControlChart -- association [0..*]
LEFT OUTER JOIN P_InspCharcSmplSizeAggrgn AS _InspCharcSmplSizeAggrgn ON QualityControlChart = _InspCharcSmplSizeAggrgn.QualityControlChart -- association [1..1]
LEFT OUTER JOIN C_QltyCtrlChtCalc AS _QltyCtrlChtCalc ON QualityControlChart = _QltyCtrlChtCalc.QualityControlChart -- association [1..1]
LEFT OUTER JOIN C_QltyCtrlChtCharcs AS _QltyCtrlChtCharcs ON LastCtrlChtInspectionLot = _QltyCtrlChtCharcs.InspectionLot AND LastCtrlChtInspPlanOplIntID = _QltyCtrlChtCharcs.InspPlanOperationInternalID AND LastCtrlChtInspCharacteristic = _QltyCtrlChtCharcs.InspectionCharacteristic AND LastCtrlChtInspSbstIntID = _QltyCtrlChtCharcs.InspectionSubsetInternalID -- association [0..1]
LEFT OUTER JOIN C_QualityControlChartTrack AS _ControlChartTrack ON QualityControlChart = _ControlChartTrack.QualityControlChart -- association [0..*]
LEFT OUTER JOIN C_QualityControlChartTrack AS _QltyCtrlChtTrack1 ON QualityControlChart = _QltyCtrlChtTrack1.QualityControlChart AND _QltyCtrlChtTrack1.QualityControlChartTrack = '1' -- association [0..1]
LEFT OUTER JOIN I_UserContactCard AS _CreatedByUserContactCard ON QltyCtrlChartCreatedByUser = _CreatedByUserContactCard.ContactCardID -- association [0..1]
LEFT OUTER JOIN I_UserContactCard AS _LastChangedByUserContactCard ON QltyCtrlChartLastChangedByUser = _LastChangedByUserContactCard.ContactCardID -- association [0..1]
LEFT OUTER JOIN C_QltyCtrlExcdLmtVislFltr AS _QltyCtrlExcdLmtVislFltr ON QualityControlChart = _QltyCtrlExcdLmtVislFltr.QualityControlChart -- association [1..1]
LEFT OUTER JOIN C_QltyCtrlChartWrkCtrVislFltr AS _QltyCtrlChartWrkCtrVislFltr ON QualityControlChart = _QltyCtrlChartWrkCtrVislFltr.QualityControlChart -- association [1..1]
LEFT OUTER JOIN C_QltyCtrlDvtnMatlVislFltr AS _QltyCtrlDvtnMatlVislFltr ON QualityControlChart = _QltyCtrlDvtnMatlVislFltr.QualityControlChart -- association [1..1]
LEFT OUTER JOIN C_QltyCtrlNonActvVislFltr AS _QltyCtrlNonActvVislFltr ON QualityControlChart = _QltyCtrlNonActvVislFltr.QualityControlChart -- association [1..1]
;