P_MATLMOVINGAVGPRICE
Moving Average Price for Material
P_MATLMOVINGAVGPRICE is a CDS View in S/4HANA. Moving Average Price for Material. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_MaterialPriceVariance | view | union_all | CONSUMPTION | Material Price Variance |
@AbapCatalog.sqlViewName: 'PMATLMOVAVGPRC'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Moving Average Price for Material'
@VDM.viewType: #CONSUMPTION
@VDM.private : true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.preserveKey: true
@AbapCatalog.viewEnhancementCategory: [#PROJECTION_LIST,#GROUP_BY,#UNION] // Added for extensibility
define view P_MatlMovingAvgPrice
with parameters
P_Material : matnr,
P_StartDate : vdm_validitystart,
P_EndDate : vdm_validityend
as select from I_MaterialValuationHist as MovingAvg
{
key MovingAvg.Material,
key ValuationArea,
cast ( MovingAveragePrice as mm_pur_ana_mat_avg_price ) as MovingPrice,
CreationDate,
Currency,
CompanyCode,
MaterialPriceUnitQty
}
where MovingAvg.Material = $parameters.P_Material and MaterialPriceControl = 'V'
and CreationDate between $parameters.P_StartDate and $parameters.P_EndDate
union all select from P_CurPerdMatlMovingAvgPrice ( P_Material : $parameters.P_Material) as MovingAvg
{
key MovingAvg.Material as Material,
key ValuationArea as ValuationArea,
max( MovingAveragePrice ) as MovingPrice,
max( CreationDate ) as CreationDate,
Currency,
CompanyCode,
MaterialPriceUnitQty
}
where CreationDate between $parameters.P_StartDate and $parameters.P_EndDate
group by MovingAvg.Material, ValuationArea, Currency, CompanyCode, MaterialPriceUnitQty