P_SrlNmbrStockDiffMatlStock
Material Stock Quantity
P_SrlNmbrStockDiffMatlStock is a Composite CDS View that provides data about "Material Stock Quantity" in SAP S/4HANA. It reads from 1 data source (I_MaterialDocumentRecord) and exposes 16 fields with key fields Material, Plant, Batch, StorageLocation, InventoryStockType. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialDocumentRecord | I_MaterialDocumentRecord | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_ProductPlant | _MaterialPlant | $projection.Material = _MaterialPlant.Product and $projection.Plant = _MaterialPlant.Plant |
| [0..1] | I_Material | _Material | $projection.Material = _Material.Material |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | Material Stock Quantity | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (16)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Material | StockIdentifyingMaterial | ||
| KEY | Plant | Plant | ||
| KEY | Batch | StockIdentifyingBatch | ||
| KEY | StorageLocation | |||
| KEY | InventoryStockType | InventoryStockType | ||
| KEY | InventorySpecialStockType | InventorySpecialStockType | ||
| KEY | Supplier | SpecialStockIdfgSupplier | ||
| KEY | SDDocument | SpecialStockIdfgSalesOrder | ||
| KEY | SDDocumentItem | SpecialStockIdfgSalesOrderItem | ||
| KEY | WBSElementInternalID | |||
| KEY | Customer | SpecialStockIdfgCustomer | ||
| KEY | SpecialStockIdfgStockOwner | SpecialStockIdfgStockOwner | ||
| KEY | CompanyCode | CompanyCode | ||
| MatlWrhsStkQtyInMatlBaseUnit | ||||
| MaterialBaseUnit | _Material | MaterialBaseUnit | ||
| SerialNumberProfile | _MaterialPlant | SerialNumberProfile |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Material Stock Quantity'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_SrlNmbrStockDiffMatlStock
as select from I_MaterialDocumentRecord
association [1..1] to I_ProductPlant as _MaterialPlant on $projection.Material = _MaterialPlant.Product
and $projection.Plant = _MaterialPlant.Plant
association [0..1] to I_Material as _Material on $projection.Material = _Material.Material
{
key StockIdentifyingMaterial as Material,
key Plant as Plant,
key StockIdentifyingBatch as Batch,
key cast(StockIdfgStorageLocation as lgort_d) as StorageLocation,
key InventoryStockType as InventoryStockType,
key InventorySpecialStockType as InventorySpecialStockType,
key SpecialStockIdfgSupplier as Supplier,
key SpecialStockIdfgSalesOrder as SDDocument,
key SpecialStockIdfgSalesOrderItem as SDDocumentItem,
key cast(SpecialStockIdfgWBSElement as nsdm_wbselement_internal_id preserving type ) as WBSElementInternalID,
key SpecialStockIdfgCustomer as Customer,
key SpecialStockIdfgStockOwner,
key CompanyCode,
@Semantics.quantity.unitOfMeasure: 'MaterialBaseUnit'
@Aggregation.default: #SUM
cast(sum(MatlStkChangeQtyInBaseUnit) as nsdm_stock_qty preserving type) as MatlWrhsStkQtyInMatlBaseUnit,
_Material.MaterialBaseUnit,
_MaterialPlant.SerialNumberProfile
}
group by
StockIdentifyingMaterial,
Plant,
StockIdentifyingBatch,
StockIdfgStorageLocation,
SpecialStockIdfgSupplier,
SpecialStockIdfgSalesOrder,
SpecialStockIdfgSalesOrderItem,
SpecialStockIdfgWBSElement,
SpecialStockIdfgCustomer,
SpecialStockIdfgStockOwner,
InventoryStockType,
InventorySpecialStockType,
CompanyCode,
_Material.MaterialBaseUnit,
_MaterialPlant.SerialNumberProfile
having
_MaterialPlant.SerialNumberProfile <> ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIAL",
"I_MATERIALDOCUMENTRECORD",
"I_PRODUCTPLANT"
],
"ASSOCIATED":
[],
"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