P_CURRENTMATLVALNPRICE

DDL: P_CURRENTMATLVALNPRICE SQL: PCURMATLVALNPRC Type: view BASIC

P_CURRENTMATLVALNPRICE is a Basic CDS View in SAP S/4HANA. It reads from 9 data sources and exposes 65 fields with key fields CostEstimate, Ledger, CurrencyRole, Ledger, CurrencyRole. It has 6 associations to related views.

Data Sources (9)

SourceAliasJoin Type
P_CURMATLVALNPRICE_CR_JOIN crjoin from
ckmlhd hd left_outer
ckmlhd hd inner
I_MaterialLedgerPrice invprice union_all
ckmlpr pr left_outer
prps ps left_outer
prps ps left_outer
R_MatlPriceDataMigrationStatus tf inner
R_MatlPriceDataMigrationStatus tf inner

Associations (6)

CardinalityTargetAliasCondition
[0..1] I_MatlLedgerValnCrcyRoleName _MLCurrencyInfo _MLCurrencyInfo.LedgerValuationCurrencyRole = crjoin.CurrencyRole and _MLCurrencyInfo.CompanyCode = tk.bukrs
[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 (5)

NameValueLevelField
AbapCatalog.sqlViewName PCURMATLVALNPRC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #BASIC view

Fields (65)

KeyFieldSource TableSource FieldDescription
KEY CostEstimate P_CURMATLVALNPRICE_CR_JOIN CostEstimate Cost EstimateNo
KEY Ledger Ledger
KEY CurrencyRole Curr./Val. Type
Material ckmlhd matnr Vehicle Model
ValuationArea ckmlhd bwkey Valuation Area
InventoryValuationType ckmlhd bwtar Valuation Type
SalesOrder ckmlhd vbeln SD Sched. Agmt
SalesOrderItem ckmlhd posnr WBS Element
Supplier ckmlhd lifnr Vendor no.
WBSElementInternalID ckmlhd pspnr WBS Element
WBSElementExternalID prps posid_edit WBS Element
InvtryValnSpecialStockType ckmlhd sobkz Special Stock
InventorySpecialStockValnType ckmlhd kzbws Valuation
IsSupplierStockValuation ckmlhd xobew Vendor stk val.
PriceDeterminationControl ckmlhd mlast Price Determ.
CompanyCode tk bukrs Receiver Company Code
MaterialPriceControl P_CURMATLVALNPRICE_CR_JOIN MaterialPriceControl Price Control
MaterialPriceUnitQty P_CURMATLVALNPRICE_CR_JOIN MaterialPriceUnitQty Price unit
Currency P_CURMATLVALNPRICE_CR_JOIN Currency Valuation Crcy
MovingAveragePrice P_CURMATLVALNPRICE_CR_JOIN MovingAveragePrice Per. Unit Price
StandardPrice P_CURMATLVALNPRICE_CR_JOIN StandardPrice Standard price
InventoryPrice P_CURMATLVALNPRICE_CR_JOIN InventoryPrice Inventory Price
FuturePrice ckmlpr zkprs Inventory Price
FuturePriceValidityStartDate ckmlpr zprsdat
PlannedPrice Inventory Price
FutrCostEstValuationVariant ckmlpr bwva1
FutureCostEstFiscalYear ckmlpr pdatz
FutureCostEstimateFiscalPeriod ckmlpr pprdz
FutureCostEstCostingVersion ckmlpr vers1
FixedPortionOfPlannedPrice
LedgerName _MLCurrencyInfo LedgerName Ledger Name
CurrencyRoleName _MLCurrencyInfo CurrencyRoleName
CostEstimate Cost EstimateNo
KEY Ledger I_MaterialLedgerPrice Ledger Ledger
KEY CurrencyRole I_MaterialLedgerPrice CurrencyRole Curr./Val. Type
Material ckmlhd matnr Vehicle Model
ValuationArea ckmlhd bwkey Valuation Area
InventoryValuationType ckmlhd bwtar Valuation Type
SalesOrder ckmlhd vbeln SD Sched. Agmt
SalesOrderItem ckmlhd posnr WBS Element
Supplier ckmlhd lifnr Vendor no.
WBSElementInternalID ckmlhd pspnr WBS Element
WBSElementExternalID prps posid_edit WBS Element
InvtryValnSpecialStockType ckmlhd sobkz Special Stock
InventorySpecialStockValnType ckmlhd kzbws Valuation
IsSupplierStockValuation ckmlhd xobew Vendor stk val.
PriceDeterminationControl ckmlhd mlast Price Determ.
CompanyCode I_MaterialLedgerPrice CompanyCode Receiver Company Code
MaterialPriceControl I_MaterialLedgerPrice MaterialPriceControl Price Control
MaterialPriceUnitQty I_MaterialLedgerPrice MaterialPriceUnitQty Price unit
Currency I_MaterialLedgerPrice Currency Valuation Crcy
MaterialPrice0endasMovingAveragePrice
MaterialPrice0endasStandardPrice
InventoryPrice I_MaterialLedgerPrice MaterialPrice Inventory Price
FuturePrice _FuturePrice MaterialPrice Inventory Price
FuturePriceValidityStartDate _FuturePrice MaterialPriceValidityStartDate
PlannedPrice _FutureStdPrice MaterialPrice Inventory Price
FutrCostEstValuationVariant _FutureStdPrice ValuationVariant
FutureCostEstFiscalYear _FutureStdPrice MatlPrcValidityStartFiscalYear
FutureCostEstimateFiscalPeriod _FutureStdPrice MatlPrcValdtyStartFiscalPeriod
FutureCostEstCostingVersion _FutureStdPrice CostingVersion
FixedPortionOfPlannedPrice _FutureStdPrice FixedPortionOfMaterialPrice
LedgerName _MLCurrencyInfo LedgerName Ledger Name
CurrencyRoleName _MLCurrencyInfo CurrencyRoleName
LedgerValnCrcyRoleIsUsedInLogs _MLCurrencyInfo LedgerValnCrcyRoleIsUsedInLogs Is Log. Curr. Type

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_CURRENTMATLVALNPRICE.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PCURMATLVALNPRC

CREATE VIEW P_CURRENTMATLVALNPRICE AS
SELECT
  crjoin.CostEstimate AS CostEstimate,
  coalesce(_MLCurrencyInfo.Ledger, cast(' ' as fins_ledger)) AS Ledger,
  cast( crjoin.CurrencyRole as fins_ext_curtype preserving type ) AS CurrencyRole,
  hd.matnr AS Material,
  hd.bwkey AS ValuationArea,
  hd.bwtar AS InventoryValuationType,
  hd.vbeln AS SalesOrder,
  hd.posnr AS SalesOrderItem,
  hd.lifnr AS Supplier,
  hd.pspnr AS WBSElementInternalID,
  ps.posid_edit AS WBSElementExternalID,
  hd.sobkz AS InvtryValnSpecialStockType,
  hd.kzbws AS InventorySpecialStockValnType,
  hd.xobew AS IsSupplierStockValuation,
  hd.mlast AS PriceDeterminationControl,
  tk.bukrs AS CompanyCode,
  crjoin.MaterialPriceControl AS MaterialPriceControl,
  crjoin.MaterialPriceUnitQty AS MaterialPriceUnitQty,
  crjoin.Currency AS Currency,
  crjoin.MovingAveragePrice AS MovingAveragePrice,
  crjoin.StandardPrice AS StandardPrice,
  crjoin.InventoryPrice AS InventoryPrice,
  pr.zkprs AS FuturePrice,
  pr.zprsdat AS FuturePriceValidityStartDate,
  cast(pr.zplpr as fml_plpr) AS PlannedPrice,
  pr.bwva1 AS FutrCostEstValuationVariant,
  pr.pdatz AS FutureCostEstFiscalYear,
  pr.pprdz AS FutureCostEstimateFiscalPeriod,
  pr.vers1 AS FutureCostEstCostingVersion,
  cast(pr.fplpx as fml_plpx) AS FixedPortionOfPlannedPrice,
  _MLCurrencyInfo.LedgerName AS LedgerName,
  _MLCurrencyInfo.CurrencyRoleName AS CurrencyRoleName,
  case invprice.MaterialPriceControl when 'S' then case hd.mlast when '2' then coalesce(_MvgAvgPrice.MaterialPrice, 0) when '3' then coalesce(_ActualPrice.MaterialPrice, 0) else cast (0 as fml_price ) end else coalesce(invprice.MaterialPrice, 0) end as MovingAveragePrice AS MaterialPrice0endasMovingAveragePrice,
  case invprice.MaterialPriceControl when 'S' then coalesce(invprice.MaterialPrice, 0) else coalesce(_StandardPrice.MaterialPrice, 0) end as StandardPrice AS MaterialPrice0endasStandardPrice,
  _MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs AS LedgerValnCrcyRoleIsUsedInLogs
FROM P_CURMATLVALNPRICE_CR_JOIN AS crjoin
INNER JOIN R_MatlPriceDataMigrationStatus AS tf ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN ckmlhd AS hd ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN ckmlpr AS pr ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN prps AS ps ON /* join condition not captured in parsed metadata */
INNER JOIN ckmlhd AS hd ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_MatlLedgerValnCrcyRoleName AS _MLCurrencyInfo ON _MLCurrencyInfo.LedgerValuationCurrencyRole = crjoin.CurrencyRole AND _MLCurrencyInfo.CompanyCode = tk.bukrs  -- association [0..1]
LEFT OUTER JOIN 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]
LEFT OUTER JOIN 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]
LEFT OUTER JOIN 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]
LEFT OUTER JOIN 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]
LEFT OUTER JOIN 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 = ' '  -- association [0..1]
-- UNION ALL with additional select branch(es): I_MaterialLedgerPrice
;