I_MaterialStock
Material Stock Calculation
I_MaterialStock is a Composite CDS View (Cube) that provides data about "Material Stock Calculation" in SAP S/4HANA. It reads from 1 data source (I_MaterialStock_Aggr) and exposes 34 fields with key fields Material, Plant, StorageLocation, Batch, Supplier. It has 13 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialStock_Aggr | I_MaterialStock_Aggr | from |
Associations (13)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_Material | _Material | $projection.Material = _Material.Material |
| [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 |
| [0..1] | I_Supplier | _SpecialStockIdfgStockOwner | $projection.SpecialStockIdfgStockOwner = _SpecialStockIdfgStockOwner.Supplier |
| [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 -- View I_InvtryPrcBasicByKeyDate deliveres the same data as I_InventoryPriceByKeyDate but is performance optimized for stock value calculation from quantities -- View I_InventoryPriceByKeyDate has to stay for compatibility reasons (I_MaterialStock is C1 released) |
| [0..1] | I_InvtryPrcBasicByKeyDate | _InvtryPrcBasicByPeriodEndDate | $projection.CostEstimate = _InvtryPrcBasicByPeriodEndDate.CostEstimate |
| [0..1] | I_InventoryPriceByKeyDate | _InventoryPriceByPeriodEndDate | $projection.CostEstimate = _InventoryPriceByPeriodEndDate.CostEstimate and _InventoryPriceByPeriodEndDate.CurrencyRole = '10' |
| [0..1] | I_CurrentMatlPriceByCostEst | _CurrentInvtryPrice | $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate |
Annotations (18)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | IMATERIALSTOCK | view | |
| AbapCatalog.preserveKey | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| EndUserText.label | Material Stock Calculation | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #PUBLIC_LOCAL_API | view | |
| VDM.lifecycle.status | #DEPRECATED | view | |
| VDM.lifecycle.successor | I_MaterialStock_2 | view | |
| Analytics.dataCategory | #CUBE | view | |
| Metadata.allowExtensions | true | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (34)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | Material | ||
| KEY | Plant | Plant | ||
| KEY | StorageLocation | StorageLocation | ||
| KEY | Batch | Batch | ||
| KEY | Supplier | Supplier | ||
| KEY | SDDocument | SDDocument | ||
| KEY | SDDocumentItem | SDDocumentItem | ||
| KEY | WBSElementInternalID | WBSElementInternalID | ||
| KEY | Customer | Customer | ||
| KEY | SpecialStockIdfgStockOwner | SpecialStockIdfgStockOwner | ||
| KEY | InventoryStockType | InventoryStockType | ||
| KEY | InventorySpecialStockType | InventorySpecialStockType | ||
| KEY | FiscalYearVariant | FiscalYearVariant | ||
| KEY | MatlDocLatestPostgDate | MatlDocLatestPostgDate | ||
| KEY | MaterialBaseUnit | MaterialBaseUnit | ||
| CostEstimate | CostEstimate | |||
| CompanyCode | CompanyCode | |||
| MatlWrhsStkQtyInMatlBaseUnit | MatlWrhsStkQtyInMatlBaseUnit | |||
| MatlCnsmpnQtyInMatlBaseUnit | MatlCnsmpnQtyInMatlBaseUnit | |||
| MatlStkIncrQtyInMatlBaseUnit | MatlStkIncrQtyInMatlBaseUnit | |||
| MatlStkDecrQtyInMatlBaseUnit | MatlStkDecrQtyInMatlBaseUnit | |||
| _UnitOfMeasure | _UnitOfMeasure | |||
| _Material | _Material | |||
| _CompanyCode | _CompanyCode | |||
| _Plant | _Plant | |||
| _StorageLocation | _StorageLocation | |||
| _Supplier | _Supplier | |||
| _Customer | _Customer | |||
| _SpecialStockIdfgStockOwner | _SpecialStockIdfgStockOwner | |||
| _InventoryStockType | _InventoryStockType | |||
| _InventorySpecialStockType | _InventorySpecialStockType | |||
| _InvtryPrcBasicByPeriodEndDate | _InvtryPrcBasicByPeriodEndDate | |||
| _InventoryPriceByPeriodEndDate | _InventoryPriceByPeriodEndDate | |||
| _CurrentInvtryPrice | _CurrentInvtryPrice |
@AbapCatalog: {
sqlViewName: 'IMATERIALSTOCK',
preserveKey: true,
compiler.compareFilter: true
}
@EndUserText.label: 'Material Stock Calculation'
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #NOT_REQUIRED --there are no BP references in table MATDOC with an EndOfPurpose state
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel: {
usageType: {
sizeCategory: #XXL,
serviceQuality: #D,
dataClass:#TRANSACTIONAL
},
modelingPattern: #ANALYTICAL_CUBE,
supportedCapabilities: [#ANALYTICAL_PROVIDER, #SQL_DATA_SOURCE, #CDS_MODELING_DATA_SOURCE]
}
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #PUBLIC_LOCAL_API,
lifecycle.status: #DEPRECATED,
lifecycle.successor: 'I_MaterialStock_2'
}
@Analytics.dataCategory:#CUBE
@Metadata: {
allowExtensions: true,
ignorePropagatedAnnotations: true
}
/*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */
define view I_MaterialStock
as select from I_MaterialStock_Aggr
association [1..1] to I_Material as _Material on $projection.Material = _Material.Material
association [1..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
association [1..1] to I_Plant as _Plant on $projection.Plant = _Plant.Plant
association [0..1] to I_StorageLocation as _StorageLocation on $projection.Plant = _StorageLocation.Plant
and $projection.StorageLocation = _StorageLocation.StorageLocation
association [0..1] to I_Supplier as _Supplier on $projection.Supplier = _Supplier.Supplier
association [0..1] to I_Customer as _Customer on $projection.Customer = _Customer.Customer
association [0..1] to I_Supplier as _SpecialStockIdfgStockOwner on $projection.SpecialStockIdfgStockOwner = _SpecialStockIdfgStockOwner.Supplier
association [1..1] to I_InventoryStockType as _InventoryStockType on $projection.InventoryStockType = _InventoryStockType.InventoryStockType
association [1..1] to I_InventorySpecialStockType as _InventorySpecialStockType on $projection.InventorySpecialStockType = _InventorySpecialStockType.InventorySpecialStockType
association [1..1] to I_UnitOfMeasure as _UnitOfMeasure on $projection.MaterialBaseUnit = _UnitOfMeasure.UnitOfMeasure
-- View I_InvtryPrcBasicByKeyDate deliveres the same data as I_InventoryPriceByKeyDate but is performance optimized for stock value calculation from quantities
-- View I_InventoryPriceByKeyDate has to stay for compatibility reasons (I_MaterialStock is C1 released)
association [0..1] to I_InvtryPrcBasicByKeyDate as _InvtryPrcBasicByPeriodEndDate on $projection.CostEstimate = _InvtryPrcBasicByPeriodEndDate.CostEstimate
association [0..1] to I_InventoryPriceByKeyDate as _InventoryPriceByPeriodEndDate on $projection.CostEstimate = _InventoryPriceByPeriodEndDate.CostEstimate
and _InventoryPriceByPeriodEndDate.CurrencyRole = '10'
association [0..1] to I_CurrentMatlPriceByCostEst as _CurrentInvtryPrice on $projection.CostEstimate = _CurrentInvtryPrice.CostEstimate
{
// Stock Identifier
@ObjectModel.foreignKey.association: '_Material'
key Material,
@ObjectModel.foreignKey.association: '_Plant'
key Plant,
@ObjectModel.foreignKey.association: '_StorageLocation'
key StorageLocation,
key Batch,
@ObjectModel.foreignKey.association: '_Supplier'
key Supplier,
key SDDocument,
key SDDocumentItem,
key WBSElementInternalID,
@ObjectModel.foreignKey.association: '_Customer'
key Customer,
@ObjectModel.foreignKey.association: '_SpecialStockIdfgStockOwner'
key SpecialStockIdfgStockOwner,
@ObjectModel.foreignKey.association: '_InventoryStockType'
key InventoryStockType,
@ObjectModel.foreignKey.association: '_InventorySpecialStockType'
key InventorySpecialStockType,
// Further Stock Groups
@Semantics.fiscal.yearVariant: true
key FiscalYearVariant,
@Semantics.businessDate.at: true
key MatlDocLatestPostgDate,
// Units
@Semantics.unitOfMeasure: true
key MaterialBaseUnit,
CostEstimate,
@ObjectModel.foreignKey.association: '_CompanyCode'
CompanyCode,
// Quantities
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
@DefaultAggregation : #SUM
MatlWrhsStkQtyInMatlBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
@DefaultAggregation : #SUM
MatlCnsmpnQtyInMatlBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
@DefaultAggregation : #SUM
MatlStkIncrQtyInMatlBaseUnit,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
@DefaultAggregation : #SUM
MatlStkDecrQtyInMatlBaseUnit,
// Associations for names and descriptions
_UnitOfMeasure,
_Material,
_CompanyCode,
_Plant,
_StorageLocation,
_Supplier,
_Customer,
_SpecialStockIdfgStockOwner,
_InventoryStockType,
_InventorySpecialStockType,
_InvtryPrcBasicByPeriodEndDate,
_InventoryPriceByPeriodEndDate,
_CurrentInvtryPrice
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIALSTOCK_AGGR"
],
"ASSOCIATED":
[
"I_COMPANYCODE",
"I_CURRENTMATLPRICEBYCOSTEST",
"I_CUSTOMER",
"I_INVENTORYPRICEBYKEYDATE",
"I_INVENTORYSPECIALSTOCKTYPE",
"I_INVENTORYSTOCKTYPE",
"I_INVTRYPRCBASICBYKEYDATE",
"I_MATERIAL",
"I_PLANT",
"I_STORAGELOCATION",
"I_SUPPLIER",
"I_UNITOFMEASURE"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA