F0_Mmim_Matstockquanvalbydate

DDL: F0_MMIM_MATSTOCKQUANVALBYDATE Type: view_entity Package: MBND_CLOUD_BL

Material Stock Quantity and Value by Key Date

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.

Data Sources (1)

SourceAliasJoin Type
R_MltplMatlStk R_MltplMatlStk from

Parameters (3)

NameTypeDefault
P_Language sylangu
P_EndDate sydate
P_DisplayCurrency nsdm_display_currency

Associations (13)

CardinalityTargetAliasCondition
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_StorageLocation _StorageLocation $projection.Plant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation
[1..1] I_ProductStorageLocation _ProductStorageLocation $projection.Material = _ProductStorageLocation.Product and $projection.Plant = _ProductStorageLocation.Plant and $projection.StorageLocation = _ProductStorageLocation.StorageLocation
[0..1] I_WBSElementBasicData _WBSElement $projection.WBSElementInternalID = _WBSElement.WBSElementInternalID
[1..1] I_InventorySpecialStockType _InventorySpecialStockType $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType
[0..1] F3_Mmim_Supplier_Vh _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] F3_Mmim_Customer_Vh _Customer $projection.Customer = _Customer.Customer
[0..1] I_Batch _BatchPlant $projection.Material = _BatchPlant.Material and $projection.Plant = _BatchPlant.Plant and $projection.Batch = _BatchPlant.Batch
[0..*] I_ResourceBasic _ResourceBasic $projection.ResourceID = _ResourceBasic.ResourceID
[1..1] I_Product _Product $projection.Material = _Product.Product
[1..1] I_ProductPlant _ProductPlant $projection.Material = _ProductPlant.Product and $projection.Plant = _ProductPlant.Plant
[1..1] I_Batch _Batch $projection.Material = _Batch.Material and $projection.Plant = _Batch.Plant and $projection.Batch = _Batch.Batch
[0..1] I_CO2eqFprntAvgRltvBaseUoM _ProductCO2eFootprint $projection.Material = _ProductCO2eFootprint.Product and $projection.Plant = _ProductCO2eFootprint.Plant

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #MIXED view
EndUserText.label Material Stock Quantity and Value by Key Date view

Fields (76)

KeyFieldSource TableSource FieldDescription
KEY SourceConstantId MatlWithStockPostingsCode
KEY Material Vehicle Model
KEY Plant Plant Valuation Area
KEY StorageLocation StorageLocation
KEY ResourceID Vehicle ID
KEY Batch Lot No.
KEY Supplier Supplier
KEY SDDocument SD Document
KEY SDDocumentItem
KEY WBSElementInternalID WBSElementInternalID WBS Internal ID
KEY Customer Sold-to Party
KEY InventorySpecialStockType InventorySpecialStockType Special Stock Type
KEY CompanyCode CompanyCode Receiver Company Code
KEY MaterialBaseUnit MaterialBaseUnit Valuation Unit
KEY Currency Currency Valuation Crcy
KEY DisplayCurrency DisplayCurrency Display Currency
KEY InventoryValuationType Valuation Type
MaterialIsMarkedForDeletion _Product IsMarkedForDeletion Purch.org. data
WarehouseStorageBin _ProductStorageLocation WarehouseStorageBin Storage Bin
MaterialName
MaterialGroup
MaterialGroupName
PlantName _Plant PlantName Plant Name
StorageLocationName _StorageLocation StorageLocationName Storage Loc. Name
InventorySpecialStockTypeName
CustomerName
SupplierName
WBSDescription _WBSElement WBSDescription WBS Element Name
ShelfLifeExpirationDate
ManufactureDate
CurrentStock
QualityInspectionStockQuantity
ReturnsBlockedStockQuantity
TransferStockStorageLocQty
TransferStockPlantQuantity
StockInTransitQuantity Stk in Transit
BlockedStockQuantity
RestrictedStockQuantity
TiedEmptiesStockQuantity
GoodsReceiptBlockedStockQty Val. GR Blocked Stck
CurrentStockValue
QualityInspectionStockValue
ReturnsBlockedStockValue
TransferStockStorageLocValue
TransferStockPlantValue
StockInTransitValue
BlockedStockValue
RestrictedStockValue
TiedEmptiesStockValue
GoodsReceiptBlockedStockValue
CurrentStockCurVal
QualityInspectionStockCurVal
ReturnsBlockedStockCurVal
TransferStockStorageLocCurVal
TransferStockPlantCurVal
StockInTransitCurVal
BlockedStockCurVal
RestrictedStockCurVal
TiedEmptiesStockCurVal
GoodsReceiptBlockedStockCurVal
CrossPlantConfigurableProduct
ProductCharacteristic1
ProductCharacteristic2
ProductCharacteristic3
StockSegment _BatchPlant StockSegment Stock Segment
_ResourceBasic _ResourceBasic
_Plant _Plant
_Supplier _Supplier
_Customer _Customer
_Product _Product
_ProductPlant _ProductPlant
_Batch _Batch
CO2eFootPrintQuantity _ProductCO2eFootprint PFMFootprintQuantity Quantity
PFMFootprintUnitendasFootprintUnit
PFMFootprintUnit _ProductCO2eFootprint PFMFootprintUnit Unit
_UnitOfMeasure _ProductCO2eFootprint _UnitOfMeasure

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_currency

CREATE VIEW F0_Mmim_Matstockquanvalbydate AS
SELECT
  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,
  case when _ProductCO2eFootprint.PFMFootprintUnit is null then cast('KG' as pfmfootprintunit) else _ProductCO2eFootprint.PFMFootprintUnit end as FootprintUnit AS PFMFootprintUnitendasFootprintUnit,
  _ProductCO2eFootprint.PFMFootprintUnit AS PFMFootprintUnit,
  _ProductCO2eFootprint._UnitOfMeasure AS _UnitOfMeasure
FROM R_MltplMatlStk
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant  -- association [1..1]
LEFT OUTER JOIN I_StorageLocation AS _StorageLocation ON Plant = _StorageLocation.Plant AND StorageLocation = _StorageLocation.StorageLocation  -- association [0..1]
LEFT OUTER JOIN I_ProductStorageLocation AS _ProductStorageLocation ON Material = _ProductStorageLocation.Product AND Plant = _ProductStorageLocation.Plant AND StorageLocation = _ProductStorageLocation.StorageLocation  -- association [1..1]
LEFT OUTER JOIN I_WBSElementBasicData AS _WBSElement ON WBSElementInternalID = _WBSElement.WBSElementInternalID  -- association [0..1]
LEFT OUTER JOIN I_InventorySpecialStockType AS _InventorySpecialStockType ON InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType  -- association [1..1]
LEFT OUTER JOIN F3_Mmim_Supplier_Vh AS _Supplier ON Supplier = _Supplier.Supplier  -- association [0..1]
LEFT OUTER JOIN F3_Mmim_Customer_Vh AS _Customer ON Customer = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_Batch AS _BatchPlant ON Material = _BatchPlant.Material AND Plant = _BatchPlant.Plant AND Batch = _BatchPlant.Batch  -- association [0..1]
LEFT OUTER JOIN I_ResourceBasic AS _ResourceBasic ON ResourceID = _ResourceBasic.ResourceID  -- association [0..*]
LEFT OUTER JOIN I_Product AS _Product ON Material = _Product.Product  -- association [1..1]
LEFT OUTER JOIN I_ProductPlant AS _ProductPlant ON Material = _ProductPlant.Product AND Plant = _ProductPlant.Plant  -- association [1..1]
LEFT OUTER JOIN I_Batch AS _Batch ON Material = _Batch.Material AND Plant = _Batch.Plant AND Batch = _Batch.Batch  -- association [1..1]
LEFT OUTER JOIN I_CO2eqFprntAvgRltvBaseUoM AS _ProductCO2eFootprint ON Material = _ProductCO2eFootprint.Product AND Plant = _ProductCO2eFootprint.Plant  -- association [0..1]
;