P_MatlStkAtKeyDateInAltUoM1

DDL: P_MATLSTKATKEYDATEINALTUOM1 Type: view COMPOSITE

P_MatlStkAtKeyDateInAltUoM1 is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_MaterialStock_2) and exposes 18 fields with key fields Material, Plant, StorageLocation, Batch, Supplier.

Data Sources (1)

SourceAliasJoin Type
I_MaterialStock_2 I_MaterialStock_2 from

Parameters (1)

NameTypeDefault
P_KeyDate vdm_v_key_date

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PMATSTKDATEAUOM1 view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY Material Material
KEY Plant Plant
KEY StorageLocation StorageLocation
KEY Batch Batch
KEY Supplier Supplier
KEY SDDocument SDDocument
KEY SDDocumentItem SDDocumentItem
KEY WBSElementInternalID
KEY SpecialStockIdfgStockOwner SpecialStockIdfgStockOwner
KEY InventoryStockType InventoryStockType
KEY InventorySpecialStockType InventorySpecialStockType
KEY MaterialBaseUnit MaterialBaseUnit
CompanyCode CompanyCode
FiscalYearVariant FiscalYearVariant
MatlWrhsStkQtyInMatlBaseUnit
MatlCnsmpnQtyInMatlBaseUnit
MatlStkIncrQtyInMatlBaseUnit
MatlStkDecrQtyInMatlBaseUnit
@AbapCatalog: {
                sqlViewName: 'PMATSTKDATEAUOM1',
                compiler.compareFilter: true,
                preserveKey: true
              }
@ObjectModel: {
                usageType: {
                              sizeCategory: #XXL,
                              serviceQuality: #D,
                              dataClass:#TRANSACTIONAL
                            }
               }
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM: {
         viewType: #COMPOSITE,
         private: true
       }

/*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */

define view P_MatlStkAtKeyDateInAltUoM1 with parameters
    P_KeyDate : vdm_v_key_date    
  as select from I_MaterialStock_2
{
      // Stock Identifier

  key Material,
  key Plant,
  key StorageLocation,
  key Batch,
  key Supplier,
  key SDDocument,
  key SDDocumentItem,
  key cast( WBSElementInternalID as mat_pspnr preserving type ) as WBSElementInternalID,   --I_MaterailStock_2 does a cast to a DE w/o conversion exit, for compatibility reason: cast back
  key Customer,
  key SpecialStockIdfgStockOwner,
  key InventoryStockType,
  key InventorySpecialStockType,
      // Units

  @Semantics.unitOfMeasure: true
  key MaterialBaseUnit,
      CompanyCode,
      FiscalYearVariant,

      // Quantities

      sum(MatlWrhsStkQtyInMatlBaseUnit) as MatlWrhsStkQtyInMatlBaseUnit,
      sum(MatlCnsmpnQtyInMatlBaseUnit) as  MatlCnsmpnQtyInMatlBaseUnit,
      sum(MatlStkIncrQtyInMatlBaseUnit) as MatlStkIncrQtyInMatlBaseUnit,
      sum(MatlStkDecrQtyInMatlBaseUnit) as MatlStkDecrQtyInMatlBaseUnit
}
where   MatlDocLatestPostgDate <= $parameters.P_KeyDate
group by Material, Plant, StorageLocation, Batch, Supplier, SDDocument, SDDocumentItem, WBSElementInternalID, Customer,
SpecialStockIdfgStockOwner, InventoryStockType, InventorySpecialStockType, MaterialBaseUnit, CompanyCode, FiscalYearVariant