P_InventoryPriceByKeydate
Inventory Price by kaydate
P_InventoryPriceByKeydate is a Composite CDS View that provides data about "Inventory Price by kaydate" in SAP S/4HANA. It reads from 2 data sources (ckmlhd, I_MaterialLedgerPrice) and exposes 31 fields with key fields CostEstimate, CurrencyRole. It has 4 associations to related views. Part of development package FINS_ML_VDM.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| ckmlhd | hd | inner |
| I_MaterialLedgerPrice | invprice | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_CalendarDate | calendardate |
Associations (4)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [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 (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PINVPRKEYDATE | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.status | #DEPRECATED | view | |
| VDM.lifecycle.successor | R_InventoryPriceByKeyDate | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view |
Fields (31)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CostEstimate | I_MaterialLedgerPrice | CostEstimate | Cost EstimateNo |
| KEY | CurrencyRole | I_MaterialLedgerPrice | CurrencyRole | Curr./Val. Type |
| Ledger | I_MaterialLedgerPrice | Ledger | Ledger | |
| FiscalPeriod | dp | FiscalPeriod | Tax period | |
| FiscalYear | ||||
| FiscalYearPeriod | dp | FiscalYearPeriod | Period/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 | 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 | ||||
| ActualPrice | ||||
| 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.CostEstimate AS CostEstimate,
invprice.CurrencyRole AS CurrencyRole,
invprice.Ledger AS Ledger,
dp.FiscalPeriod AS FiscalPeriod,
cast( dp.FiscalYear as fins_gjahr ) AS FiscalYear,
dp.FiscalYearPeriod AS FiscalYearPeriod,
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,
invprice.CompanyCode AS CompanyCode,
invprice.ValuationQuantityUnit AS BaseUnit,
hd.sobkz AS InventorySpecialStockType,
hd.kzbws AS InventorySpecialStockValnType,
hd.xobew AS IsSupplierStockValuation,
hd.mlast AS PriceDeterminationControl,
invprice.MaterialPriceControl AS MaterialPriceControl,
invprice.MaterialPriceUnitQty AS MaterialPriceUnitQty,
invprice.Currency AS Currency,
cast( invprice.MaterialPrice as fml_inventory_price ) AS InventoryPrice,
cast( _ActualPrice.MaterialPrice as fml_actual_price ) AS ActualPrice,
_CurrencyInfo.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 I_MaterialLedgerPrice AS invprice
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]
;
Learn More
- S/4HANA CDS View Deprecation: What You Need to Know
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- 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
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA