F6_MMIM_MATSTOCKQUANVALBYDATE

DDL: F6_MMIM_MATSTOCKQUANVALBYDATE SQL: F6MMIM_MATSTVAL Type: view

Material Stock Quantity and Value by Key Date

F6_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 (Fb_Mmim_Matstockquanvalbydate) and exposes 34 fields.

Data Sources (1)

SourceAliasJoin Type
Fb_Mmim_Matstockquanvalbydate Fb_Mmim_Matstockquanvalbydate from

Parameters (1)

NameTypeDefault
P_EndDate sydate

Annotations (9)

NameValueLevelField
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.sqlViewName F6MMIM_MATSTVAL view
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
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (34)

KeyFieldSource TableSource FieldDescription
Material Material Vehicle Model
Plant Plant Valuation Area
StorageLocation StorageLocation StorageLocation
ResourceId ResourceId Vehicle ID
Batch Batch Lot No.
Supplier Supplier Supplier
SDDocument SDDocument SD Document
SDDocumentItem SDDocumentItem SD Item of Inv.
WBSElementInternalID WBSElementInternalID WBS Internal ID
Customer Customer Sold-to Party
InventoryStockType InventoryStockType Stock Type
InventorySpecialStockType InventorySpecialStockType Special Stock Type
CompanyCode CompanyCode Receiver Company Code
CostEstimate CostEstimate Cost EstimateNo
ValuationArea ValuationArea Valuation Area
InventoryValuationType InventoryValuationType Valuation Type
IsSupplierStockValuation IsSupplierStockValuation Vendor stk val.
InventorySpecialStockValnType InventorySpecialStockValnType Valuation
Currency Currency Valuation Crcy
MaterialBaseUnit MaterialBaseUnit Valuation Unit
MatlWrhsStkQtyInMatlBaseUnit MatlWrhsStkQtyInMatlBaseUnit Quantity
_UnitOfMeasure _UnitOfMeasure
_CompanyCode _CompanyCode
_Plant _Plant
_StorageLocation _StorageLocation
_Supplier _Supplier
_Customer _Customer
_InventoryStockType _InventoryStockType
_InventorySpecialStockType _InventorySpecialStockType
_MaterialStockValueByKeyDate _MaterialStockValueByKeyDate
_MaterialLedgerPrice _MaterialLedgerPrice
_CurrentInvtryPrice _CurrentInvtryPrice
dec232endasStockValue Quantity
dec232asStockCurrentValue Quantity

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 F6_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.
-- SQL view name: F6MMIM_MATSTVAL
-- Parameters: P_EndDate : sydate

CREATE VIEW F6_MMIM_MATSTOCKQUANVALBYDATE AS
SELECT
  Material,
  Plant,
  StorageLocation,
  ResourceId,
  Batch,
  Supplier,
  SDDocument,
  SDDocumentItem,
  WBSElementInternalID,
  Customer,
  InventoryStockType,
  InventorySpecialStockType,
  CompanyCode,
  CostEstimate,
  ValuationArea,
  InventoryValuationType,
  IsSupplierStockValuation,
  InventorySpecialStockValnType,
  Currency,
  MaterialBaseUnit,
  MatlWrhsStkQtyInMatlBaseUnit,
  case when ( InventorySpecialStockType = 'O' or InventorySpecialStockType = 'V' or InventorySpecialStockType = 'W' or InventorySpecialStockType = ' ' or ( ( InventorySpecialStockType = 'E' or InventorySpecialStockType = 'Q' or InventorySpecialStockType = 'T' ) and InventorySpecialStockValnType <> '' ) or ( ( InventorySpecialStockType = 'F' or InventorySpecialStockType = 'R' ) and ( InventorySpecialStockValnType <> '' or IsSupplierStockValuation = 'X' ) ) ) and ( MatlWrhsStkQtyInMatlBaseUnit <> 0 and _MaterialStockValueByKeyDate( P_EndDate: $parameters.P_EndDate).InventoryQty <> 0 ) then cast( round( cast( division( cast(_MaterialStockValueByKeyDate( P_EndDate: $parameters.P_EndDate ).AmountInCompanyCodeCurrency as abap.dec(23,2) ), cast(_MaterialStockValueByKeyDate( P_EndDate: $parameters.P_EndDate ).InventoryQty as abap.dec(23,3) ) , 7 ) as abap.dec(16,7) ) * cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec(21,3) ), 2 ) as abap.dec(23,2) ) when ( InventorySpecialStockType = 'K' or InventorySpecialStockType = 'M' or InventorySpecialStockType = 'B' or InventorySpecialStockType = 'I' or InventorySpecialStockType = 'C' or InventorySpecialStockType = 'J' or InventorySpecialStockType = 'P' or InventorySpecialStockType = 'Y' ) then cast( 0 as abap.dec(23,2 ) ) when ( InventorySpecialStockType = 'O' or InventorySpecialStockType = 'V' or InventorySpecialStockType = 'W' or InventorySpecialStockType = ' ' or ( ( InventorySpecialStockType = 'E' or InventorySpecialStockType = 'Q' or InventorySpecialStockType = 'T' ) and InventorySpecialStockValnType <> '' ) or ( ( InventorySpecialStockType = 'F' or InventorySpecialStockType = 'R' ) and ( InventorySpecialStockValnType <> '' or IsSupplierStockValuation = 'X' ) ) ) and MatlWrhsStkQtyInMatlBaseUnit <> 0 and _MaterialStockValueByKeyDate( P_EndDate: $parameters.P_EndDate).InventoryQty = 0 and _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MaterialPriceControl = 'S' and _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MatPriceUnitInCoCodeCurrency <> 0 then cast( round( cast( division( _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).StandardPriceInCoCodeCrcy, _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MatPriceUnitInCoCodeCurrency, 7 ) as abap.dec(16,7) ) * cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec(21,3) ), 2 ) as abap.dec(23,2) ) when ( InventorySpecialStockType = 'O' or InventorySpecialStockType = 'V' or InventorySpecialStockType = 'W' or InventorySpecialStockType = ' ' or ( ( InventorySpecialStockType = 'E' or InventorySpecialStockType = 'Q' or InventorySpecialStockType = 'T' ) and InventorySpecialStockValnType <> '' ) or ( ( InventorySpecialStockType = 'F' or InventorySpecialStockType = 'R' ) and ( InventorySpecialStockValnType <> '' or IsSupplierStockValuation = 'X' ) ) ) and MatlWrhsStkQtyInMatlBaseUnit <> 0 and _MaterialStockValueByKeyDate( P_EndDate: $parameters.P_EndDate).InventoryQty = 0 and _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MaterialPriceControl = 'V' and _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MatPriceUnitInCoCodeCurrency <> 0 then cast( round( cast( division( _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MovingAveragePriceInCoCodeCrcy, _MaterialLedgerPrice( P_EndDate: $parameters.P_EndDate ).MatPriceUnitInCoCodeCurrency, 7 ) as abap.dec(16,7) ) * cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec(21,3) ), 2 ) as abap.dec(23,2) ) else cast( 0 as abap.dec(23,2 ) ) end as StockValue AS dec232endasStockValue,
  cast( round( division( _CurrentInvtryPrice.InventoryPrice, _CurrentInvtryPrice.MaterialPriceUnitQty, 5 ) * cast(MatlWrhsStkQtyInMatlBaseUnit as abap.dec(21,3) ) , 2 ) as abap.dec(23,2) ) as StockCurrentValue AS dec232asStockCurrentValue
FROM Fb_Mmim_Matstockquanvalbydate
;