P_CURRENTMATLVALNPRICE
Material Valuation Prices - Current/Previous/PrevYear Period
P_CURRENTMATLVALNPRICE is a Composite CDS View that provides data about "Material Valuation Prices - Current/Previous/PrevYear Period" in SAP S/4HANA. It reads from 3 data sources (I_MatlValnSemKeyMappg, I_MaterialLedgerPrice, I_WBSElementBasicData) and exposes 31 fields with key fields CostEstimate, Ledger, CurrencyRole. It has 6 associations to related views. Part of development package FINS_ML_VDM.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_MatlValnSemKeyMappg | hd | inner |
| I_MaterialLedgerPrice | invprice | from |
| I_WBSElementBasicData | ps | left_outer |
Associations (6)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | R_MatlLedgerValnCrcyRole | _MLCurrencyInfo | _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole and _MLCurrencyInfo.Ledger = invprice.Ledger and _MLCurrencyInfo.CompanyCode = invprice.CompanyCode |
| [0..1] | I_MaterialLedgerPrice | _StandardPrice | _StandardPrice.CostEstimate = invprice.CostEstimate and _StandardPrice.Ledger = invprice.Ledger and _StandardPrice.CurrencyRole = invprice.CurrencyRole and _StandardPrice.MaterialPriceType = 'STDPR' and _StandardPrice.MaterialPriceSubtype = ' ' and _StandardPrice.MaterialPriceValidityEndDate = '99991231' |
| [0..1] | I_MaterialLedgerPrice | _ActualPrice | _ActualPrice.CostEstimate = invprice.CostEstimate and _ActualPrice.Ledger = invprice.Ledger and _ActualPrice.CurrencyRole = invprice.CurrencyRole and _ActualPrice.MaterialPriceType = 'ACT' and _ActualPrice.MaterialPriceSubtype = 'ACT' and _ActualPrice.MaterialPriceValidityEndDate = '99991231' |
| [0..1] | I_MaterialLedgerPrice | _MvgAvgPrice | _MvgAvgPrice.CostEstimate = invprice.CostEstimate and _MvgAvgPrice.Ledger = invprice.Ledger and _MvgAvgPrice.CurrencyRole = invprice.CurrencyRole and _MvgAvgPrice.MaterialPriceType = 'MAP' and _MvgAvgPrice.MaterialPriceSubtype = ' ' and _MvgAvgPrice.MaterialPriceValidityEndDate = '99991231' |
| [0..1] | I_MaterialLedgerPrice | _FuturePrice | _FuturePrice.CostEstimate = invprice.CostEstimate and _FuturePrice.Ledger = invprice.Ledger and _FuturePrice.CurrencyRole = invprice.CurrencyRole and _FuturePrice.MaterialPriceType = 'FUTURE' and _FuturePrice.MaterialPriceSubtype = ' ' |
| [0..1] | I_MLPrExtRefCostEstimate | _FutureStdPrice | _FutureStdPrice.CostEstimate = invprice.CostEstimate and _FutureStdPrice.Ledger = invprice.Ledger and _FutureStdPrice.CurrencyRole = invprice.CurrencyRole and _FutureStdPrice.MaterialPriceType = 'FSTDCE' and _FutureStdPrice.MaterialPriceSubtype = ' ' |
Annotations (3)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view |
Fields (31)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CostEstimate | I_MaterialLedgerPrice | CostEstimate | |
| KEY | Ledger | I_MaterialLedgerPrice | Ledger | |
| KEY | CurrencyRole | I_MaterialLedgerPrice | CurrencyRole | |
| Material | I_MatlValnSemKeyMappg | Material | ||
| ValuationArea | I_MatlValnSemKeyMappg | ValuationArea | ||
| InventoryValuationType | I_MatlValnSemKeyMappg | InventoryValuationType | ||
| SalesOrder | I_MatlValnSemKeyMappg | SalesOrder | ||
| SalesOrderItem | I_MatlValnSemKeyMappg | SalesOrderItem | ||
| Supplier | I_MatlValnSemKeyMappg | Supplier | ||
| WBSElementInternalID | I_MatlValnSemKeyMappg | WBSElementInternalID | ||
| WBSElementExternalID | I_WBSElementBasicData | WBSElementExternalID | ||
| InvtryValnSpecialStockType | I_MatlValnSemKeyMappg | InventorySpecialStockType | ||
| InventorySpecialStockValnType | I_MatlValnSemKeyMappg | InventorySpecialStockValnType | ||
| IsSupplierStockValuation | I_MatlValnSemKeyMappg | IsSupplierStockValuation | ||
| PriceDeterminationControl | I_MatlValnSemKeyMappg | PriceDeterminationControl | ||
| CompanyCode | I_MaterialLedgerPrice | CompanyCode | ||
| MaterialPriceControl | I_MaterialLedgerPrice | MaterialPriceControl | ||
| MaterialPriceUnitQty | I_MaterialLedgerPrice | MaterialPriceUnitQty | ||
| Currency | I_MaterialLedgerPrice | Currency | ||
| InventoryPrice | I_MaterialLedgerPrice | MaterialPrice | ||
| FuturePrice | ||||
| FuturePriceValidityStartDate | _FuturePrice | MaterialPriceValidityStartDate | ||
| PlannedPrice | ||||
| FutrCostEstValuationVariant | _FutureStdPrice | ValuationVariant | ||
| FutureCostEstFiscalYear | _FutureStdPrice | MatlPrcValidityStartFiscalYear | ||
| FutureCostEstimateFiscalPeriod | _FutureStdPrice | MatlPrcValdtyStartFiscalPeriod | ||
| FutureCostEstCostingVersion | _FutureStdPrice | CostingVersion | ||
| FixedPortionOfPlannedPrice | _FutureStdPrice | FixedPortionOfMaterialPrice | ||
| LedgerName | _MLCurrencyInfo | LedgerName | ||
| CurrencyRoleName | _MLCurrencyInfo | CurrencyRoleName | ||
| LedgerValnCrcyRoleIsUsedInLogs | _MLCurrencyInfo | LedgerValnCrcyRoleIsUsedInLogs |
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view entity P_CURRENTMATLVALNPRICE
as select from I_MaterialLedgerPrice as invprice
inner join I_MatlValnSemKeyMappg as hd on hd.CostEstimate = invprice.CostEstimate
left outer join I_WBSElementBasicData as ps on ps.WBSElementInternalID = hd.WBSElementInternalID
association [0..1] to R_MatlLedgerValnCrcyRole as _MLCurrencyInfo on _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole
and _MLCurrencyInfo.Ledger = invprice.Ledger
and _MLCurrencyInfo.CompanyCode = invprice.CompanyCode
association [0..1] to I_MaterialLedgerPrice as _StandardPrice on _StandardPrice.CostEstimate = invprice.CostEstimate
and _StandardPrice.Ledger = invprice.Ledger
and _StandardPrice.CurrencyRole = invprice.CurrencyRole
and _StandardPrice.MaterialPriceType = 'STDPR'
and _StandardPrice.MaterialPriceSubtype = ' '
and _StandardPrice.MaterialPriceValidityEndDate = '99991231'
association [0..1] to I_MaterialLedgerPrice as _ActualPrice on _ActualPrice.CostEstimate = invprice.CostEstimate
and _ActualPrice.Ledger = invprice.Ledger
and _ActualPrice.CurrencyRole = invprice.CurrencyRole
and _ActualPrice.MaterialPriceType = 'ACT'
and _ActualPrice.MaterialPriceSubtype = 'ACT'
and _ActualPrice.MaterialPriceValidityEndDate = '99991231'
association [0..1] to I_MaterialLedgerPrice as _MvgAvgPrice on _MvgAvgPrice.CostEstimate = invprice.CostEstimate
and _MvgAvgPrice.Ledger = invprice.Ledger
and _MvgAvgPrice.CurrencyRole = invprice.CurrencyRole
and _MvgAvgPrice.MaterialPriceType = 'MAP'
and _MvgAvgPrice.MaterialPriceSubtype = ' '
and _MvgAvgPrice.MaterialPriceValidityEndDate = '99991231'
association [0..1] to I_MaterialLedgerPrice as _FuturePrice on _FuturePrice.CostEstimate = invprice.CostEstimate
and _FuturePrice.Ledger = invprice.Ledger
and _FuturePrice.CurrencyRole = invprice.CurrencyRole
and _FuturePrice.MaterialPriceType = 'FUTURE'
and _FuturePrice.MaterialPriceSubtype = ' '
association [0..1] to I_MLPrExtRefCostEstimate as _FutureStdPrice on _FutureStdPrice.CostEstimate = invprice.CostEstimate
and _FutureStdPrice.Ledger = invprice.Ledger
and _FutureStdPrice.CurrencyRole = invprice.CurrencyRole
and _FutureStdPrice.MaterialPriceType = 'FSTDCE'
and _FutureStdPrice.MaterialPriceSubtype = ' '
{
key invprice.CostEstimate,
key invprice.Ledger,
key invprice.CurrencyRole,
hd.Material,
hd.ValuationArea,
hd.InventoryValuationType,
hd.SalesOrder,
hd.SalesOrderItem,
hd.Supplier,
hd.WBSElementInternalID,
ps.WBSElementExternalID as WBSElementExternalID,
hd.InventorySpecialStockType as InvtryValnSpecialStockType,
hd.InventorySpecialStockValnType,
hd.IsSupplierStockValuation,
hd.PriceDeterminationControl,
invprice.CompanyCode,
invprice.MaterialPriceControl as MaterialPriceControl,
invprice.MaterialPriceUnitQty as MaterialPriceUnitQty,
invprice.Currency as Currency,
@Semantics.amount.currencyCode: 'Currency'
cast(
case invprice.MaterialPriceControl
when 'S'
then case hd.PriceDeterminationControl
when '2' then _MvgAvgPrice.MaterialPrice
when '3' then _ActualPrice.MaterialPrice
else cast ( 0 as ck_stprs_1 )
end
else //when 'V'
invprice.MaterialPrice
end as ck_pvprs_1 ) as MovingAveragePrice,
@Semantics.amount.currencyCode: 'Currency'
cast(
case invprice.MaterialPriceControl
when 'S' then invprice.MaterialPrice
else _StandardPrice.MaterialPrice
end as ck_stprs_1 ) as StandardPrice,
@Semantics.amount.currencyCode: 'Currency'
invprice.MaterialPrice as InventoryPrice,
@Semantics.amount.currencyCode: 'Currency'
cast( _FuturePrice.MaterialPrice as dzkprs ) as FuturePrice,
_FuturePrice.MaterialPriceValidityStartDate as FuturePriceValidityStartDate,
@Semantics.amount.currencyCode: 'Currency'
cast( _FutureStdPrice.MaterialPrice as fml_plpr) as PlannedPrice,
_FutureStdPrice.ValuationVariant as FutrCostEstValuationVariant,
_FutureStdPrice.MatlPrcValidityStartFiscalYear as FutureCostEstFiscalYear,
_FutureStdPrice.MatlPrcValdtyStartFiscalPeriod as FutureCostEstimateFiscalPeriod,
_FutureStdPrice.CostingVersion as FutureCostEstCostingVersion,
//pr.zbwst as FutrPlanProjSlsOrdValnStrategy,
@Semantics.amount.currencyCode: 'Currency'
_FutureStdPrice.FixedPortionOfMaterialPrice as FixedPortionOfPlannedPrice,
_MLCurrencyInfo.LedgerName as LedgerName,
_MLCurrencyInfo.CurrencyRoleName as CurrencyRoleName,
// _CurrencyInfo.LegalCurrencyRole as LegalCurrencyRole,
// _CurrencyInfo.LegalCurrencyRoleName as LegalCurrencyRoleName,
// cast(_CurrencyInfo.AccountingValuationView as fins_valutyp) as AccountingValuationView,
// _CurrencyInfo.AcctgValnVwSubviewCombinedName as AcctgValnVwSubviewCombinedName,
_MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs as LedgerValnCrcyRoleIsUsedInLogs
}
where
invprice.MaterialPriceType = 'INVPR'
and invprice.MaterialPriceSubtype = ' '
and invprice.MaterialPriceValidityEndDate = '99991231'
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA