P_MatlStkCsgnmtStockQuantity
Consignment Stock Quantity
P_MatlStkCsgnmtStockQuantity is a Composite CDS View that provides data about "Consignment Stock Quantity" in SAP S/4HANA. It reads from 2 data sources (I_MaterialDocumentRecord, I_MatlStkSubscrpnConsignment) and exposes 10 fields with key fields Plant, Supplier, Material, StorageLocation, InventoryStockType. Part of development package ODATA_MM_IM_STOCKOUTPUT.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialDocumentRecord | _Record | from |
| I_MatlStkSubscrpnConsignment | _Subs | inner |
Parameters (2)
| Name | Type | Default |
|---|---|---|
| P_PostingDate | sydate | |
| P_CreationDateTime | timestamp |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | 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 (10)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | Plant | I_MaterialDocumentRecord | Plant | |
| KEY | Supplier | I_MaterialDocumentRecord | SpecialStockIdfgSupplier | |
| KEY | Material | I_MaterialDocumentRecord | Material | |
| KEY | StorageLocation | I_MaterialDocumentRecord | StorageLocation | |
| KEY | InventoryStockType | I_MaterialDocumentRecord | InventoryStockType | |
| KEY | MaterialBaseUnit | |||
| KEY | CompanyCode | I_MaterialDocumentRecord | CompanyCode | |
| MaterialStockSubscriptionUUID | I_MatlStkSubscrpnConsignment | MaterialStockSubscriptionUUID | ||
| MaterialStockSubscriptionItem | I_MatlStkSubscrpnConsignment | MaterialStockSubscriptionItem | ||
| MatlWrhsStkQtyInMatlBaseUnit |
@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_MatlStkCsgnmtStockQuantity
with parameters
@Environment.systemField: #SYSTEM_DATE
P_PostingDate : sydate,
P_CreationDateTime: timestamp
as select from I_MaterialDocumentRecord as _Record
inner join I_MatlStkSubscrpnConsignment as _Subs
on _Record.CompanyCode = _Subs.CompanyCode
and _Record.Plant = _Subs.Plant
and _Record.SpecialStockIdfgSupplier = _Subs.Supplier
{
key _Record.Plant,
key _Record.SpecialStockIdfgSupplier as Supplier,
key _Record.Material,
key _Record.StorageLocation,
key _Record.InventoryStockType,
key _Record._Material.MaterialBaseUnit as MaterialBaseUnit,
key _Record.CompanyCode,
_Subs.MaterialStockSubscriptionUUID,
_Subs.MaterialStockSubscriptionItem,
@Semantics.quantity.unitOfMeasure : 'MaterialBaseUnit'
sum(_Record.MatlStkChangeQtyInBaseUnit ) as MatlWrhsStkQtyInMatlBaseUnit
}
where _Record.MaterialBaseUnit <> '' // value only material does not have meins
and _Record.InventoryStockType <> ''
and _Record.InventorySpecialStockType = 'K'
and _Record.Material <> ''
and _Record.PostingDate <= $parameters.P_PostingDate
and dats_tims_to_tstmp( _Record.CreationDate, _Record.CreationTime, abap_system_timezone( $session.client,'NULL' ), $session.client,'NULL' )
<= $parameters.P_CreationDateTime
group by
_Record.Plant,
_Record.SpecialStockIdfgSupplier,
_Record.Material,
_Record.StorageLocation,
_Record.InventoryStockType,
_Record._Material.MaterialBaseUnit,
_Record.CompanyCode,
_Subs.MaterialStockSubscriptionUUID,
_Subs.MaterialStockSubscriptionItem
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