P_MatlStkCsgnmtStockQuantity

DDL: P_MATLSTKCSGNMTSTOCKQUANTITY Type: view_entity COMPOSITE

P_MatlStkCsgnmtStockQuantity is a Composite CDS View 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.

Data Sources (2)

SourceAliasJoin Type
I_MaterialDocumentRecord _Record from
I_MatlStkSubscrpnConsignment _Subs inner

Parameters (2)

NameTypeDefault
P_PostingDate sydate
P_CreationDateTime timestamp

Annotations (7)

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

KeyFieldSource TableSource FieldDescription
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    
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATERIAL",
"I_MATERIALDOCUMENTRECORD",
"I_MATLSTKSUBSCRPNCONSIGNMENT"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/