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_ProductInformation.
-- 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.
-- SQL view name: CPRODUCTINFO
CREATE VIEW C_ProductInformation AS
SELECT
MaterialInfo.Material AS Material,
MaterialInfo.Plant AS Plant,
MaterialInfo.MRPArea AS MRPArea,
MaterialInfo._Material._Text[1: Language = $session.system_language ].ProductName AS ProductName,
MaterialInfo._Plant.PlantName AS PlantName,
MaterialInfo._MRPArea.MRPAreaText AS MRPAreaText,
MaterialInfo.IsMRPAreaExisting AS IsMRPAreaExisting,
case MaterialInfo.IsMRPAreaExisting when 'X' then case when MaterialInfo.Plant <> MaterialInfo.MRPArea then concat(MaterialInfo._Material._Text[1: Language = $session.system_language ].ProductName, concat_with_space(',', concat_with_space(MaterialInfo._Plant.PlantName, concat('(', concat(MaterialInfo.Plant, concat(')', concat_with_space(',', concat_with_space(MaterialInfo._MRPArea.MRPAreaText, concat('(', concat(MaterialInfo.MRPArea,')')), 2),2)))),2),2)) else concat(MaterialInfo._Material._Text[1: Language = $session.system_language ].ProductName, concat_with_space(',', concat_with_space(MaterialInfo._Plant.PlantName, concat('(', concat(MaterialInfo.Plant,')')),2),2)) end else concat(MaterialInfo._Material._Text[1: Language = $session.system_language ].ProductName, concat_with_space(',', concat_with_space(MaterialInfo._Plant.PlantName, concat('(', concat(MaterialInfo.Plant,')')),2),2)) end as PlantName2 AS Plant22endasPlantName2,
MaterialInfo._Material.ProductType AS ProductType,
MaterialInfo._Material.LowLevelCode AS LowLevelCode,
MaterialInfo._Material.ProductGroup AS ProductGroup,
MRPGroup,
MRPType,
MaterialInfo.MRPController AS MRPController,
LotSizingProcedure,
MinimumLotSizeQuantity,
MaximumLotSizeQuantity,
LotSizeRoundingQuantity,
RoundingProfile,
PlanningTimeFence,
MaterialInfo.TotalReplenishmentLeadDuration AS TotalReplenishmentLeadDuration,
MaterialInfo.MaterialPlannedProductionDurn AS MaterialPlannedProductionDurn,
MaterialInfo.PlannedDeliveryDurationInDays AS PlannedDeliveryDurationInDays,
MaterialInfo.PurchasingGroup AS PurchasingGroup,
MaterialInfo.GoodsReceiptDuration AS GoodsReceiptDuration,
MaterialInfo._Material._BaseUnitOfMeasure.UnitOfMeasureDspNmbrOfDcmls AS UnitOfMeasureDspNmbrOfDcmls,
MaterialInfo._Material._BaseUnitOfMeasure.UnitOfMeasureNumberOfDecimals AS UnitOfMeasureNumberOfDecimals,
MaterialInfo.ProductIsBuffered AS ProductIsBuffered,
_MRPTypeText[1: Language = $session.system_language ].MRPTypeName AS MRPTypeName,
_MRPController._PurchasingGroup.PurchasingGroupName AS PurchasingGroupName,
MaterialInfo._Material._ProductGroupText[1: Language = $session.system_language ].MaterialGroupName AS MaterialGroupName,
MaterialInfo._Material._ProductTypeName[1: Language = $session.system_language ].MaterialTypeName AS MaterialTypeName,
_MRPGroupText[1: Language = $session.system_language ].MRPGroupName AS MRPGroupName,
_LotsizeProcedureText[1: Language = $session.system_language ].MaterialLotSizingProcedureName AS MaterialLotSizingProcedureName,
case when MaterialInfo.ProductIsBuffered = 'X' then _DDRMaterial.BaseUnitofMeasure else MaterialInfo._Material.BaseUnit end as BaseUnitofMeasure AS BaseUnitendasBaseUnitofMeasure,
case when MaterialInfo.ProductIsBuffered = 'X' then _DDRMaterial.ProcurementType else MaterialInfo.ProcurementType end as ProcurementType AS ProcurementTypeendasProcurementType,
_DDRMaterial.NetFlowPositionQuantity AS NetFlowPositionQuantity,
_DDRMaterial.MaterialPlanningPriority AS MaterialPlanningPriority,
_DDRMaterial.MaterialPlanningPriorityStatus AS MaterialPlanningPriorityStatus,
_DDRMaterial.OnHandBufferStatusQuantity AS OnHandBufferStatusQuantity,
_DDRMaterial.OnHandStockStatus AS OnHandStockStatus,
_DDRMaterial.OnHandStockQuantity AS OnHandStockQuantity,
_DDRMaterial.ProposedQuantity AS ProposedQuantity,
_DDRMaterial.DecoupledLeadTime AS DecoupledLeadTime,
_DDProduct.IndividualLeadTime AS IndividualLeadTime,
_DDRMaterial.ProjectedOnHandStockStatus AS ProjectedOnHandStockStatus,
_DDRMaterial.FirstStkOutProjtdStkQty AS FirstStkOutProjtdStkQty,
_DDRMaterial.FirstStkOutProjtdSFTQty AS FirstStkOutProjtdSFTQty,
_DDRMaterial.FirstStkOutProjtdSFTPct AS FirstStkOutProjtdSFTPct,
_DDRMaterial.FirstStkOutFromTodayInDays AS FirstStkOutFromTodayInDays,
cast ( _DDRMaterial.FirstBelowThldDate as dats ) AS FirstBelowThldDate,
_DDRMaterial.FirstBelowThldProjtdStkQty AS FirstBelowThldProjtdStkQty,
_DDRMaterial.FirstBelowThldThldLvlQty AS FirstBelowThldThldLvlQty,
_DDRMaterial.FirstBelowThldProjtdSFTQty AS FirstBelowThldProjtdSFTQty,
_DDRMaterial.FirstBelowThldProjtdSFTPct AS FirstBelowThldProjtdSFTPct,
_DDRMaterial.FirstBelowThldFromTodayInDays AS FirstBelowThldFromTodayInDays,
cast ( _DDRMaterial.FirstBelowSFTDate as dats ) AS FirstBelowSFTDate,
_DDRMaterial.FirstBelowSFTProjtdStkQty AS FirstBelowSFTProjtdStkQty,
_DDRMaterial.FirstBelowSFTProjtdSFTQty AS FirstBelowSFTProjtdSFTQty,
_DDRMaterial.FirstBelowSFTThldLvlQty AS FirstBelowSFTThldLvlQty,
_DDRMaterial.FirstBelowSFTProjtdSFTPct AS FirstBelowSFTProjtdSFTPct,
_DDRMaterial.FirstBelowSFTFromTodayInDays AS FirstBelowSFTFromTodayInDays,
_DDRMaterial.IsWithinDLT AS IsWithinLeadTime,
_DDRMaterial.OrderPlanningStatusText AS OrderPlanningStatusText,
MaterialInfo._Material.AuthorizationGroup AS ProductAuthorizationGroup,
case when _Plant._Address.AddressTimeZone is not initial then tstmp_to_dats( tstmp_current_utctimestamp(), _Plant._Address.AddressTimeZone, $session.client, 'NULL' ) else cast($session.system_date as abap.dats) end as CurrentPlantDate AS datsendasCurrentPlantDate,
_DDRMaterial.PastHorizonDLTMultiplierValue AS PastHorizonDLTMultiplierValue,
_DDRMaterial.FutureHrznDLTMultiplierValue AS FutureHrznDLTMultiplierValue,
MaterialInfo.IsBulkMaterial AS IsBulkMaterial,
MaterialInfo.IsPhantomItem AS IsPhantomItem,
MaterialInfo.MRPMaterialStatus AS MRPMaterialStatus,
MaterialInfo._MatStatus[MRPMaterialStatus = MaterialInfo.MRPMaterialStatus].MRPMaterialStatusName AS MRPMaterialStatusName
FROM I_ProductPlantMRPArea AS MaterialInfo
INNER JOIN I_SDMAreaOfResponsibility AS _SDMAreaOfResponsibility ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_DemandDrivenCalcValues AS _DDRMaterial ON Material = _DDRMaterial.Material AND Plant = _DDRMaterial.Plant AND MRPArea = _DDRMaterial.MRPArea -- association [0..1]
LEFT OUTER JOIN I_MRPController AS _MRPController ON Plant = _MRPController.Plant AND MRPController = _MRPController.MRPController -- association [0..1]
LEFT OUTER JOIN I_MRPTypeText AS _MRPTypeText ON MRPType = _MRPTypeText.MRPType -- association [0..1]
LEFT OUTER JOIN I_MRPGroupText AS _MRPGroupText ON MRPGroup = _MRPGroupText.MRPGroup AND Plant = _MRPGroupText.MRPPlant -- association [0..1]
LEFT OUTER JOIN I_MRPLotSizingProcedureText AS _LotsizeProcedureText ON LotSizingProcedure = _LotsizeProcedureText.MaterialLotSizingProcedure -- association [0..1]
LEFT OUTER JOIN I_MatlProcurementCategoryText AS _MaterialProcurementCategory ON MaterialInfo.ProcurementType = _MaterialProcurementCategory.MaterialProcurementCategory -- association [0..1]
LEFT OUTER JOIN I_DemandDrivenExtdProduct AS _DDProduct ON Material = _DDProduct.Material AND Plant = _DDProduct.Plant AND MRPArea = _DDProduct.MRPArea -- association [0..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [0..1]
LEFT OUTER JOIN E_Product AS _ProductExtension ON Material = _ProductExtension.Product -- association [0..1]
LEFT OUTER JOIN E_Productplant AS _PlantExtension ON Material = _PlantExtension.Product AND Plant = _PlantExtension.Plant -- association [0..1]
;