P_InvPrice_Union_Old

DDL: P_INVPRICE_UNION_OLD SQL: PINVPRUNIOLD Type: view BASIC

P_InvPrice_Union_Old is a Basic CDS View in SAP S/4HANA. It reads from 1 data source (ckmlhd) and exposes 33 fields with key fields CostEstimate, Ledger, CurrencyRole. It has 2 associations to related views.

Data Sources (1)

SourceAliasJoin Type
ckmlhd hd from

Parameters (1)

NameTypeDefault
P_CalendarDate calendardate

Associations (2)

CardinalityTargetAliasCondition
[0..1] R_LedgerValuationCrcyRole _CurrencyInfo _CurrencyInfo.LedgerValuationCurrencyRole = cr.curtp
[0..1] I_MatlLedgerValnCrcyRoleName _MLCurrencyInfo _MLCurrencyInfo.LedgerValuationCurrencyRole = cr.curtp and _MLCurrencyInfo.CompanyCode = tk.bukrs

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PINVPRUNIOLD view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.private true view
VDM.viewType #BASIC view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY CostEstimate ckmlhd kalnr ProdCostEst.No.
KEY Ledger
KEY CurrencyRole cr curtp Valuation Area
MaxFiscPerCKMLPP zp MaxFiscPerCKMLPP
FiscalPeriod cr poper Posting periods
FiscalYear cr bdatj Year
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 tk bukrs Value
BaseUnit pp meins Valuation Unit
InventorySpecialStockType ckmlhd sobkz Special Stock
InventorySpecialStockValnType ckmlhd kzbws Valuation
IsSupplierStockValuation ckmlhd xobew Vendor stk val.
PriceDeterminationControl ckmlhd mlast Price Determ.
MatlPrcMigratedUntilFsclYrPerd ckmlhd price_sdm_yearper Price SDM YearPeriod
MaterialPriceControl cr vprsv Price control
MaterialPriceUnitQty
Currency cr waers Transaction Currency
stprs0endasInventoryPrice
StandardPrice cr stprs Standard price
MovingAveragePrice cr pvprs Per. Unit Price
LedgerName _MLCurrencyInfo 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_InvPrice_Union_Old.
-- 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: PINVPRUNIOLD
-- Parameters: P_CalendarDate : calendardate

CREATE VIEW P_InvPrice_Union_Old AS
SELECT
  hd.kalnr AS CostEstimate,
  coalesce(_MLCurrencyInfo.Ledger, cast(' ' as fins_ledger)) AS Ledger,
  cr.curtp AS CurrencyRole,
  zp.MaxFiscPerCKMLPP AS MaxFiscPerCKMLPP,
  cr.poper AS FiscalPeriod,
  cr.bdatj AS FiscalYear,
  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,
  tk.bukrs AS CompanyCode,
  pp.meins AS BaseUnit,
  hd.sobkz AS InventorySpecialStockType,
  hd.kzbws AS InventorySpecialStockValnType,
  hd.xobew AS IsSupplierStockValuation,
  hd.mlast AS PriceDeterminationControl,
  hd.price_sdm_yearper AS MatlPrcMigratedUntilFsclYrPerd,
  cr.vprsv AS MaterialPriceControl,
  coalesce(cr.peinh, 1) AS MaterialPriceUnitQty,
  cr.waers AS Currency,
  case cr.vprsv when 'S' then coalesce(cr.stprs, 0) when 'V' then coalesce(cr.pvprs, 0) else coalesce(cr.stprs, 0) end as InventoryPrice AS stprs0endasInventoryPrice,
  cr.stprs AS StandardPrice,
  cr.pvprs AS MovingAveragePrice,
  _MLCurrencyInfo.LedgerName AS LedgerName,
  _CurrencyInfo.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
FROM ckmlhd AS hd
LEFT OUTER JOIN R_LedgerValuationCrcyRole AS _CurrencyInfo ON _CurrencyInfo.LedgerValuationCurrencyRole = cr.curtp  -- association [0..1]
LEFT OUTER JOIN I_MatlLedgerValnCrcyRoleName AS _MLCurrencyInfo ON _MLCurrencyInfo.LedgerValuationCurrencyRole = cr.curtp AND _MLCurrencyInfo.CompanyCode = tk.bukrs  -- association [0..1]
;