F0_Mmim_Matstockquanvalbydate is a CDS View that provides data about "Material Stock Quantity and Value by Key Date" in SAP S/4HANA. It reads from 1 data source (R_MltplMatlStk) and exposes 76 fields with key fields SourceConstantId, Material, Plant, StorageLocation, ResourceID. It has 13 associations to related views. Part of development package MBND_CLOUD_BL.
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 F0_Mmim_Matstockquanvalbydate.-- 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.-- Parameters: P_Language : sylangu, P_EndDate : sydate, P_DisplayCurrency : nsdm_display_currencyCREATE VIEW F0_Mmim_Matstockquanvalbydate ASSELECT
MatlWithStockPostingsCode AS SourceConstantId,
cast( Material as matnr preserving type ) AS Material,
Plant,
cast( StorageLocation as lgort_d preserving type ) AS StorageLocation,
cast( ResourceID as nsdm_resourcename preserving type ) AS ResourceID,
cast( Batch as charg_d preserving type ) AS Batch,
cast( Supplier as mmim_supplier preserving type ) AS Supplier,
cast( SDDocument as mmim_sales_order preserving type ) AS SDDocument,
cast( SDDocumentItem as mmim_sales_order_item_numc preserving type ) AS SDDocumentItem,
WBSElementInternalID,
cast( Customer as kunnr preserving type ) AS Customer,
InventorySpecialStockType,
CompanyCode,
MaterialBaseUnit,
Currency,
DisplayCurrency,
cast( InventoryValuationType as mmim_valuation_type preserving type ) AS InventoryValuationType,
_Product.IsMarkedForDeletion AS MaterialIsMarkedForDeletion,
_ProductStorageLocation.WarehouseStorageBin AS WarehouseStorageBin,
cast( _Product._Text[1: Language=$parameters.P_Language].ProductName as maktx preserving type ) AS MaterialName,
cast( _Product.ProductGroup as matkl preserving type ) AS MaterialGroup,
cast( _Product._ProductGroup._Text[1: Language=$parameters.P_Language].MaterialGroupName as nsdm_wgbez preserving type ) AS MaterialGroupName,
_Plant.PlantName AS PlantName,
_StorageLocation.StorageLocationName AS StorageLocationName,
cast( _InventorySpecialStockType._Text[1: Language=$parameters.P_Language].InventorySpecialStockTypeName as mmim_sobkz_description preserving type ) AS InventorySpecialStockTypeName,
cast( _Customer.CustomerName as mmim_customer_name preserving type ) AS CustomerName,
cast( _Supplier.SupplierName as mmim_supplier_name preserving type ) AS SupplierName,
_WBSElement.WBSDescription AS WBSDescription,
cast(coalesce( _BatchPlant.ShelfLifeExpirationDate, '00000000') as mmim_shelf_life_exp_date preserving type ) AS ShelfLifeExpirationDate,
cast(coalesce( _BatchPlant.ManufactureDate, '00000000') as mmim_production_date preserving type ) AS ManufactureDate,
cast( VltdUnrestrictedUseStkQty as mmim_labst preserving type ) AS CurrentStock,
cast( QualityInspectionStockQuantity as mmim_insme preserving type ) AS QualityInspectionStockQuantity,
cast( ReturnsBlockedStockQuantity as mmim_retme preserving type ) AS ReturnsBlockedStockQuantity,
cast( TransferStockStorageLocQty as mmim_umlmd preserving type ) AS TransferStockStorageLocQty,
cast( TransferStockPlantQuantity as mmim_umlme preserving type ) AS TransferStockPlantQuantity,
cast( StockInTransitQuantity as mmim_trame preserving type ) AS StockInTransitQuantity,
cast( BlockedStockQuantity as mmim_speme preserving type ) AS BlockedStockQuantity,
cast( RestrictedStockQuantity as mmim_einme preserving type ) AS RestrictedStockQuantity,
cast( TiedEmptiesStockQuantity as mmim_glgmg preserving type ) AS TiedEmptiesStockQuantity,
cast( GoodsReceiptBlockedStockQty as mmim_bwesb preserving type ) AS GoodsReceiptBlockedStockQty,
cast( CurrentStockValue as mmim_currentstockval preserving type ) AS CurrentStockValue,
cast( QualityInspectionStockValue as mmim_qualityinspectionstval preserving type ) AS QualityInspectionStockValue,
cast( ReturnsBlockedStockValue as mmim_returnsblockedstockval preserving type ) AS ReturnsBlockedStockValue,
cast( TransferStockStorageLocValue as mmim_transferststorlocval preserving type ) AS TransferStockStorageLocValue,
cast( TransferStockPlantValue as mmim_transferstockplantval preserving type ) AS TransferStockPlantValue,
cast( StockInTransitValue as mmim_stockintransitval preserving type ) AS StockInTransitValue,
cast( BlockedStockValue as mmim_blockedstockval preserving type ) AS BlockedStockValue,
cast( RestrictedStockValue as mmim_restrictedstockval preserving type ) AS RestrictedStockValue,
cast( TiedEmptiesStockValue as mmim_tiedemptiesstockval preserving type ) AS TiedEmptiesStockValue,
cast( GoodsReceiptBlockedStockValue as mmim_goodsreceiptblockstval preserving type ) AS GoodsReceiptBlockedStockValue,
cast( CurrentStockCurVal as mmim_currentstockcurval preserving type ) AS CurrentStockCurVal,
cast( QualityInspectionStockCurVal as mmim_qualityinspectionstcurval preserving type ) AS QualityInspectionStockCurVal,
cast( ReturnsBlockedStockCurVal as mmim_returnsblockedstockcurval preserving type ) AS ReturnsBlockedStockCurVal,
cast( TransferStockStorageLocCurVal as mmim_transferststorloccurval preserving type ) AS TransferStockStorageLocCurVal,
cast( TransferStockPlantCurVal as mmim_transferstockplantcurval preserving type ) AS TransferStockPlantCurVal,
cast( StockInTransitCurVal as mmim_stockintransitcurval preserving type ) AS StockInTransitCurVal,
cast( BlockedStockCurVal as mmim_blockedstockcurval preserving type ) AS BlockedStockCurVal,
cast( RestrictedStockCurVal as mmim_restrictedstockcurval preserving type ) AS RestrictedStockCurVal,
cast( TiedEmptiesStockCurVal as mmim_tiedemptiesstockcurval preserving type ) AS TiedEmptiesStockCurVal,
cast( GoodsReceiptBlockedStockCurVal as mmim_goodsreceiptblockstcurval preserving type ) AS GoodsReceiptBlockedStockCurVal,
cast( _Product.CrossPlantConfigurableProduct as mmim_cross_plant_conf_product preserving type ) AS CrossPlantConfigurableProduct,
cast( _Product.ProductCharacteristic1 as mmim_product_characteristic1 preserving type ) AS ProductCharacteristic1,
cast( _Product.ProductCharacteristic2 as mmim_product_characteristic2 preserving type ) AS ProductCharacteristic2,
cast( _Product.ProductCharacteristic3 as mmim_product_characteristic3 preserving type ) AS ProductCharacteristic3,
_BatchPlant.StockSegment AS StockSegment,
_ProductCO2eFootprint.PFMFootprintQuantity AS CO2eFootPrintQuantity,
casewhen _ProductCO2eFootprint.PFMFootprintUnit isnullthencast('KG' as pfmfootprintunit) else _ProductCO2eFootprint.PFMFootprintUnit endas FootprintUnit AS PFMFootprintUnitendasFootprintUnit,
_ProductCO2eFootprint.PFMFootprintUnit AS PFMFootprintUnit,
_ProductCO2eFootprint._UnitOfMeasure AS _UnitOfMeasure
FROM R_MltplMatlStk
LEFTOUTERJOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [1..1]LEFTOUTERJOIN I_StorageLocation AS _StorageLocation ON Plant = _StorageLocation.Plant AND StorageLocation = _StorageLocation.StorageLocation -- association [0..1]LEFTOUTERJOIN I_ProductStorageLocation AS _ProductStorageLocation ON Material = _ProductStorageLocation.Product AND Plant = _ProductStorageLocation.Plant AND StorageLocation = _ProductStorageLocation.StorageLocation -- association [1..1]LEFTOUTERJOIN I_WBSElementBasicData AS _WBSElement ON WBSElementInternalID = _WBSElement.WBSElementInternalID -- association [0..1]LEFTOUTERJOIN I_InventorySpecialStockType AS _InventorySpecialStockType ON InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType -- association [1..1]LEFTOUTERJOIN F3_Mmim_Supplier_Vh AS _Supplier ON Supplier = _Supplier.Supplier -- association [0..1]LEFTOUTERJOIN F3_Mmim_Customer_Vh AS _Customer ON Customer = _Customer.Customer -- association [0..1]LEFTOUTERJOIN I_Batch AS _BatchPlant ON Material = _BatchPlant.Material AND Plant = _BatchPlant.Plant AND Batch = _BatchPlant.Batch -- association [0..1]LEFTOUTERJOIN I_ResourceBasic AS _ResourceBasic ON ResourceID = _ResourceBasic.ResourceID -- association [0..*]LEFTOUTERJOIN I_Product AS _Product ON Material = _Product.Product -- association [1..1]LEFTOUTERJOIN I_ProductPlant AS _ProductPlant ON Material = _ProductPlant.Product AND Plant = _ProductPlant.Plant -- association [1..1]LEFTOUTERJOIN I_Batch AS _Batch ON Material = _Batch.Material AND Plant = _Batch.Plant AND Batch = _Batch.Batch -- association [1..1]LEFTOUTERJOIN I_CO2eqFprntAvgRltvBaseUoM AS _ProductCO2eFootprint ON Material = _ProductCO2eFootprint.Product AND Plant = _ProductCO2eFootprint.Plant -- association [0..1]
;