Fb_Mmim_Matstockquanvalbydat3

DDL: FB_MMIM_MATSTOCKQUANVALBYDAT3 Type: view_entity

Material Stock Quantity and Value by Key Date

Fb_Mmim_Matstockquanvalbydat3 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 (matdoc) and exposes 32 fields with key fields Material, Plant, StorageLocation, ResourceId, Batch. It has 11 associations to related views.

Data Sources (1)

SourceAliasJoin Type
matdoc matdoc from

Parameters (1)

NameTypeDefault
P_EndDate sydate

Associations (11)

CardinalityTargetAliasCondition
[1..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[1..1] I_Plant _Plant $projection.Plant = _Plant.Plant
[0..1] I_StorageLocation _StorageLocation $projection.Plant = _StorageLocation.Plant and $projection.StorageLocation = _StorageLocation.StorageLocation
[0..1] I_Supplier _Supplier $projection.Supplier = _Supplier.Supplier
[0..1] I_Customer _Customer $projection.Customer = _Customer.Customer
[1..1] I_InventoryStockType _InventoryStockType $projection.InventoryStockType = _InventoryStockType.InventoryStockType
[1..1] I_InventorySpecialStockType _InventorySpecialStockType $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType
[1..1] I_UnitOfMeasure _UnitOfMeasure $projection.MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure
[1..1] R_MaterialStockValueByKeyDate _MaterialStockValueByKeyDate $projection.CostEstimate = _MaterialStockValueByKeyDate.CostEstimate and $projection.CompanyCode = _MaterialStockValueByKeyDate.ValuationArea and $projection.Material = _MaterialStockValueByKeyDate.Product and $projection.MaterialBaseUnit = _MaterialStockValueByKeyDate.BaseUnit and matdoc.kalnr <> '000000000000'
[1..1] V_MATERIALLEDGERPRICE _MaterialLedgerPrice $projection.CostEstimate = _MaterialLedgerPrice.CostEstimate and $projection.CompanyCode = _MaterialLedgerPrice.ValuationArea and $projection.Material = _MaterialLedgerPrice.Material and matdoc.kalnr <> '000000000000'
[0..1] I_CurrentMatlPriceByCostEst _CurrentInvtryPrice $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate and $projection.CompanyCode = _CurrentInvtryPrice.ValuationArea and $projection.Material = _CurrentInvtryPrice.Material and matdoc.kalnr <> '000000000000'

Annotations (5)

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

Fields (32)

KeyFieldSource TableSource FieldDescription
KEY Material matbf Stock Mat.
KEY Plant werks Receiving Plant
KEY StorageLocation Stor. Location SID
KEY ResourceId Resource Name
KEY Batch Batch SID
KEY Supplier Supplier SID
KEY SDDocument mat_kdauf SD Doc of Inv.
KEY SDDocumentItem mat_kdpos SD Item of Inv.
KEY WBSElementInternalID mat_pspnr WBSElem of Inv.
KEY Customer Customer SID
KEY InventoryStockType lbbsa_sid Stock Type
KEY InventorySpecialStockType sobkz Special Stock
KEY CompanyCode bukrs Value
KEY CostEstimate kalnr ProdCostEst.No.
KEY ValuationArea _Plant ValuationArea Valuation Area
KEY InventoryValuationType bwtar Valuation Type
KEY IsSupplierStockValuation xobew Vendor stk val.
KEY InventorySpecialStockValnType kzbws Valuation
KEY Currency _CompanyCode Currency Valuation Crcy
KEY MaterialBaseUnit meins Valuation Unit
MatlWrhsStkQtyInMatlBaseUnit
_UnitOfMeasure _UnitOfMeasure
_CompanyCode _CompanyCode
_Plant _Plant
_StorageLocation _StorageLocation
_Supplier _Supplier
_Customer _Customer
_InventoryStockType _InventoryStockType
_InventorySpecialStockType _InventorySpecialStockType
_MaterialStockValueByKeyDate _MaterialStockValueByKeyDate
_MaterialLedgerPrice _MaterialLedgerPrice
_CurrentInvtryPrice _CurrentInvtryPrice

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 Fb_Mmim_Matstockquanvalbydat3.
-- 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_EndDate : sydate

CREATE VIEW Fb_Mmim_Matstockquanvalbydat3 AS
SELECT
  matbf AS Material,
  werks AS Plant,
  cast(lgort_sid as lgort_d) AS StorageLocation,
  cast(resourcename_sid as nsdm_resourcename preserving type ) AS ResourceId,
  cast(charg_sid as charg_d) AS Batch,
  cast(lifnr_sid as md_supplier) AS Supplier,
  mat_kdauf AS SDDocument,
  mat_kdpos AS SDDocumentItem,
  mat_pspnr AS WBSElementInternalID,
  cast(kunnr_sid as kunnr) AS Customer,
  lbbsa_sid AS InventoryStockType,
  sobkz AS InventorySpecialStockType,
  bukrs AS CompanyCode,
  kalnr AS CostEstimate,
  _Plant.ValuationArea AS ValuationArea,
  bwtar AS InventoryValuationType,
  xobew AS IsSupplierStockValuation,
  kzbws AS InventorySpecialStockValnType,
  _CompanyCode.Currency AS Currency,
  meins AS MaterialBaseUnit,
  sum(stock_qty) AS MatlWrhsStkQtyInMatlBaseUnit
FROM matdoc
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode  -- association [1..1]
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_Supplier AS _Supplier ON Supplier = _Supplier.Supplier  -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer  -- association [0..1]
LEFT OUTER JOIN I_InventoryStockType AS _InventoryStockType ON InventoryStockType = _InventoryStockType.InventoryStockType  -- association [1..1]
LEFT OUTER JOIN I_InventorySpecialStockType AS _InventorySpecialStockType ON InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType  -- association [1..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _UnitOfMeasure ON MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure  -- association [1..1]
LEFT OUTER JOIN R_MaterialStockValueByKeyDate AS _MaterialStockValueByKeyDate ON CostEstimate = _MaterialStockValueByKeyDate.CostEstimate AND CompanyCode = _MaterialStockValueByKeyDate.ValuationArea AND Material = _MaterialStockValueByKeyDate.Product AND MaterialBaseUnit = _MaterialStockValueByKeyDate.BaseUnit AND matdoc.kalnr <> '000000000000'  -- association [1..1]
LEFT OUTER JOIN V_MATERIALLEDGERPRICE AS _MaterialLedgerPrice ON CostEstimate = _MaterialLedgerPrice.CostEstimate AND CompanyCode = _MaterialLedgerPrice.ValuationArea AND Material = _MaterialLedgerPrice.Material AND matdoc.kalnr <> '000000000000'  -- association [1..1]
LEFT OUTER JOIN I_CurrentMatlPriceByCostEst AS _CurrentInvtryPrice ON CostEstimate = _CurrentInvtryPrice.CostEstimate AND CompanyCode = _CurrentInvtryPrice.ValuationArea AND Material = _CurrentInvtryPrice.Material AND matdoc.kalnr <> '000000000000'  -- association [0..1]
;