P_InventoryPriceByKeydate

DDL: P_INVENTORYPRICEBYKEYDATE SQL: PINVPRKEYDATE Type: view BASIC

P_InventoryPriceByKeydate is a Basic CDS View in SAP S/4HANA. It reads from 5 data sources (ckmlhd, I_MaterialLedgerPrice, P_InvPrice_Union_Old, R_MatlPriceDataMigrationStatus, R_MatlPriceDataMigrationStatus) and exposes 61 fields with key fields CostEstimate, CurrencyRole, CurrencyRole. It has 4 associations to related views.

Data Sources (5)

SourceAliasJoin Type
ckmlhd hd inner
I_MaterialLedgerPrice invprice union_all
P_InvPrice_Union_Old P_InvPrice_Union_Old from
R_MatlPriceDataMigrationStatus tf inner
R_MatlPriceDataMigrationStatus tf inner

Parameters (1)

NameTypeDefault
P_CalendarDate calendardate

Associations (4)

CardinalityTargetAliasCondition
[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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate and _StandardPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate
[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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate and _ActualPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate
[0..1] R_LedgerValuationCrcyRole _CurrencyInfo _CurrencyInfo.CurrencyRole = invprice.CurrencyRole and _CurrencyInfo.Ledger = invprice.Ledger
[0..1] I_MatlLedgerValnCrcyRoleName _MLCurrencyInfo _MLCurrencyInfo.CompanyCode = invprice.CompanyCode and _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole and _MLCurrencyInfo.Ledger = invprice.Ledger

Annotations (5)

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

Fields (61)

KeyFieldSource TableSource FieldDescription
KEY CostEstimate invprice_old CostEstimate Cost EstimateNo
KEY CurrencyRole invprice_old CurrencyRole Curr./Val. Type
Ledger invprice_old Ledger Ledger
FiscalPeriod dp FiscalPeriod Tax period
FiscalYear
Material invprice_old Material Vehicle Model
ValuationArea invprice_old ValuationArea Valuation Area
InventoryValuationType invprice_old InventoryValuationType Valuation Type
SalesOrder invprice_old SalesOrder SD Sched. Agmt
SalesOrderItem invprice_old SalesOrderItem WBS Element
Supplier invprice_old Supplier Vendor no.
WBSElementInternalID invprice_old WBSElementInternalID WBS Element
CompanyCode invprice_old CompanyCode Receiver Company Code
BaseUnit invprice_old BaseUnit
InventorySpecialStockType invprice_old InventorySpecialStockType Special Stock
InventorySpecialStockValnType invprice_old InventorySpecialStockValnType Valuation
IsSupplierStockValuation invprice_old IsSupplierStockValuation Vendor stk val.
PriceDeterminationControl invprice_old PriceDeterminationControl Price Determ.
MaterialPriceControl invprice_old MaterialPriceControl Price Control
MaterialPriceUnitQty invprice_old MaterialPriceUnitQty Price unit
Currency invprice_old Currency Valuation Crcy
InventoryPrice invprice_old InventoryPrice Inventory Price
StandardPrice invprice_old StandardPrice Standard price
MovingAveragePrice0endasActualPrice
LedgerName invprice_old LedgerName Ledger Name
CurrencyRoleName invprice_old CurrencyRoleName
LegalCurrencyRole invprice_old LegalCurrencyRole
LegalCurrencyRoleName invprice_old LegalCurrencyRoleName
AccountingValuationView invprice_old AccountingValuationView
AcctgValnVwSubviewCombinedName invprice_old AcctgValnVwSubviewCombinedName
CostEstimate Cost EstimateNo
KEY CurrencyRole I_MaterialLedgerPrice CurrencyRole Curr./Val. Type
Ledger I_MaterialLedgerPrice Ledger Ledger
FiscalPeriod dp FiscalPeriod Tax period
FiscalYear
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
CompanyCode I_MaterialLedgerPrice CompanyCode Receiver Company Code
BaseUnit I_MaterialLedgerPrice ValuationQuantityUnit
InventorySpecialStockType ckmlhd sobkz Special Stock
InventorySpecialStockValnType ckmlhd kzbws Valuation
IsSupplierStockValuation ckmlhd xobew Vendor stk val.
PriceDeterminationControl ckmlhd mlast Price Determ.
MaterialPriceControl I_MaterialLedgerPrice MaterialPriceControl Price Control
MaterialPriceUnitQty I_MaterialLedgerPrice MaterialPriceUnitQty Price unit
Currency I_MaterialLedgerPrice Currency Valuation Crcy
InventoryPrice I_MaterialLedgerPrice MaterialPrice Inventory Price
MaterialPrice0endasStandardPrice
ActualPrice _ActualPrice MaterialPrice Inventory Price
LedgerName _CurrencyInfo LedgerName Ledger Name
CurrencyRoleName _CurrencyInfo CurrencyRoleName
LegalCurrencyRole _CurrencyInfo LegalCurrencyRole
LegalCurrencyRoleName _CurrencyInfo LegalCurrencyRoleName
AccountingValuationView
AcctgValnVwSubviewCombinedName _CurrencyInfo AcctgValnVwSubviewCombinedName
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_InventoryPriceByKeydate.
-- 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: PINVPRKEYDATE
-- Parameters: P_CalendarDate : calendardate

CREATE VIEW P_InventoryPriceByKeydate AS
SELECT
  invprice_old.CostEstimate AS CostEstimate,
  invprice_old.CurrencyRole AS CurrencyRole,
  invprice_old.Ledger AS Ledger,
  dp.FiscalPeriod AS FiscalPeriod,
  cast( dp.FiscalYear as fins_gjahr ) AS FiscalYear,
  invprice_old.Material AS Material,
  invprice_old.ValuationArea AS ValuationArea,
  invprice_old.InventoryValuationType AS InventoryValuationType,
  invprice_old.SalesOrder AS SalesOrder,
  invprice_old.SalesOrderItem AS SalesOrderItem,
  invprice_old.Supplier AS Supplier,
  invprice_old.WBSElementInternalID AS WBSElementInternalID,
  invprice_old.CompanyCode AS CompanyCode,
  invprice_old.BaseUnit AS BaseUnit,
  invprice_old.InventorySpecialStockType AS InventorySpecialStockType,
  invprice_old.InventorySpecialStockValnType AS InventorySpecialStockValnType,
  invprice_old.IsSupplierStockValuation AS IsSupplierStockValuation,
  invprice_old.PriceDeterminationControl AS PriceDeterminationControl,
  invprice_old.MaterialPriceControl AS MaterialPriceControl,
  invprice_old.MaterialPriceUnitQty AS MaterialPriceUnitQty,
  invprice_old.Currency AS Currency,
  invprice_old.InventoryPrice AS InventoryPrice,
  invprice_old.StandardPrice AS StandardPrice,
  case invprice_old.MaterialPriceControl when 'V' then coalesce(invprice_old.InventoryPrice, 0) else coalesce(invprice_old.MovingAveragePrice, 0) end as ActualPrice AS MovingAveragePrice0endasActualPrice,
  invprice_old.LedgerName AS LedgerName,
  invprice_old.CurrencyRoleName AS CurrencyRoleName,
  invprice_old.LegalCurrencyRole AS LegalCurrencyRole,
  invprice_old.LegalCurrencyRoleName AS LegalCurrencyRoleName,
  invprice_old.AccountingValuationView AS AccountingValuationView,
  invprice_old.AcctgValnVwSubviewCombinedName AS AcctgValnVwSubviewCombinedName,
  case invprice.MaterialPriceControl when 'S' then coalesce(invprice.MaterialPrice, 0) else coalesce(_StandardPrice.MaterialPrice, 0) end as StandardPrice AS MaterialPrice0endasStandardPrice,
  _ActualPrice.MaterialPrice AS ActualPrice,
  _MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs AS LedgerValnCrcyRoleIsUsedInLogs
FROM P_InvPrice_Union_Old
INNER JOIN R_MatlPriceDataMigrationStatus AS tf 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_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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate AND _StandardPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate  -- 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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate AND _ActualPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate  -- association [0..1]
LEFT OUTER JOIN R_LedgerValuationCrcyRole AS _CurrencyInfo ON _CurrencyInfo.CurrencyRole = invprice.CurrencyRole AND _CurrencyInfo.Ledger = invprice.Ledger  -- association [0..1]
LEFT OUTER JOIN I_MatlLedgerValnCrcyRoleName AS _MLCurrencyInfo ON _MLCurrencyInfo.CompanyCode = invprice.CompanyCode AND _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole AND _MLCurrencyInfo.Ledger = invprice.Ledger  -- association [0..1]
-- UNION ALL with additional select branch(es): I_MaterialLedgerPrice
;