I_MaterialValuationHist

DDL: I_MATERIALVALUATIONHIST SQL: IMMVALNHIST Type: view COMPOSITE

Material Valuation History

I_MaterialValuationHist is a Composite CDS View that provides data about "Material Valuation History" in SAP S/4HANA. It reads from 3 data sources (I_CompanyCode, Mbv_Mbewh, I_ValuationArea) and exposes 17 fields with key fields Material, ValuationArea, ValuationType, FiscalYearCurrentPeriod, FiscalMonthCurrentPeriod.

Data Sources (3)

SourceAliasJoin Type
I_CompanyCode CompanyCode inner
Mbv_Mbewh MatValHist from
I_ValuationArea ValuationArea inner

Annotations (13)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Material Valuation History view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName IMMVALNHIST view
AccessControl.authorizationCheck #CHECK view
ObjectModel.representativeKey Material view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.lifecycle.contract.type #SAP_INTERNAL_API view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view

Fields (17)

KeyFieldSource TableSource FieldDescription
KEY Material Mbv_Mbewh matnr
KEY ValuationArea Mbv_Mbewh bwkey
KEY ValuationType bwtar
KEY FiscalYearCurrentPeriod Mbv_Mbewh lfgja
KEY FiscalMonthCurrentPeriod Mbv_Mbewh lfmon
TotalValStockQuantity lbkum
StockValueInCCCrcy salk3
MaterialPriceControl vprsv
MovingAveragePrice verpr
StandardPrice stprs
MaterialPriceUnitQty peinh
ValuationClass bklas
ValBsdOnMvgAvgPrcInCCCrcy salkv
TotStkValAtSlsPrcInCoCodeCrcy vksal
Currency I_CompanyCode Currency
CompanyCode I_CompanyCode CompanyCode
lfmon01aserdatasCreationDate
@ClientHandling.algorithm: #SESSION_VARIABLE
@EndUserText.label: 'Material Valuation History'
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'IMMVALNHIST'
@AccessControl.authorizationCheck: #CHECK
@ObjectModel.representativeKey: 'Material'
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true

define view I_MaterialValuationHist as select from Mbv_Mbewh  as MatValHist 

  inner join   I_ValuationArea as ValuationArea on MatValHist.bwkey = ValuationArea.ValuationArea
      inner join I_CompanyCode as CompanyCode on CompanyCode.CompanyCode = ValuationArea.CompanyCode      
        
//  Below given inner join to fetch Purch Organiztion has been commmeted since there would be multiple Org's against a plant.

//  hence join would fetch multiple records out of this join. This would duplicate MovingAveragePrice data for key combination of ValuationArea and Material.

//    inner join I_PlantPurchasingOrganization as PlantPurchOrg on  ProductPlant.Plant = PlantPurchOrg.Plant

        
{

 
  key MatValHist.matnr as Material,
  key MatValHist.bwkey as ValuationArea,
  key bwtar as ValuationType,
  key MatValHist.lfgja as FiscalYearCurrentPeriod,  
  key MatValHist.lfmon as FiscalMonthCurrentPeriod,
  lbkum as TotalValStockQuantity,
  salk3 as StockValueInCCCrcy,
  vprsv as MaterialPriceControl,
  verpr as MovingAveragePrice,
  stprs as StandardPrice,
  peinh as MaterialPriceUnitQty,
  bklas as ValuationClass,
  salkv as ValBsdOnMvgAvgPrcInCCCrcy,
  vksal as TotStkValAtSlsPrcInCoCodeCrcy,  
  CompanyCode.Currency       as Currency,
  CompanyCode.CompanyCode       as CompanyCode, 
  cast ( concat( MatValHist.lfgja , concat( MatValHist.lfmon , '01' ) )  as erdat )as CreationDate
  
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COMPANYCODE",
"I_VALUATIONAREA",
"MBV_MBEWH"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/