P_SrlNmbrStockDiffMatlStock

DDL: P_SRLNMBRSTOCKDIFFMATLSTOCK Type: view_entity COMPOSITE

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)

SourceAliasJoin Type
I_MaterialDocumentRecord I_MaterialDocumentRecord from

Associations (2)

CardinalityTargetAliasCondition
[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)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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":""
}
}*/