R_InventoryPriceByKeyDate
Inventory Price by key date
R_InventoryPriceByKeyDate is a Composite CDS View that provides data about "Inventory Price by key date" in SAP S/4HANA. It reads from 2 data sources (I_MatlValnSemKeyMappg, I_MaterialLedgerPrice) and exposes 32 fields with key fields CostEstimate, Ledger, CurrencyRole. It has 3 associations to related views. Part of development package FINS_ML_VDM.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_MatlValnSemKeyMappg | hd | inner |
| I_MaterialLedgerPrice | invprice | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_CalendarDate | calendardate |
Associations (3)
| 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_MatlLedgerValnCrcyRole | _MLCurrencyInfo | _MLCurrencyInfo.CompanyCode = invprice.CompanyCode and _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole and _MLCurrencyInfo.Ledger = invprice.Ledger |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #COMPOSITE | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| AccessControl.personalData.blocking | #REQUIRED | view | |
| EndUserText.label | Inventory Price by key date | view | |
| VDM.lifecycle.contract.type | #SAP_INTERNAL_API | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.serviceQuality | #C | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (32)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CostEstimate | I_MaterialLedgerPrice | CostEstimate | |
| KEY | Ledger | I_MaterialLedgerPrice | Ledger | |
| KEY | CurrencyRole | I_MaterialLedgerPrice | CurrencyRole | |
| FiscalPeriod | calendar | FiscalPeriod | ||
| FiscalYear | calendar | FiscalYear | ||
| FiscalYearPeriod | calendar | FiscalYearPeriod | ||
| 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 | ||
| CompanyCode | I_MaterialLedgerPrice | CompanyCode | ||
| ValuationQuantityUnit | I_MaterialLedgerPrice | ValuationQuantityUnit | ||
| BaseUnit | I_MaterialLedgerPrice | ValuationQuantityUnit | ||
| InventorySpecialStockType | I_MatlValnSemKeyMappg | InventorySpecialStockType | ||
| InventorySpecialStockValnType | I_MatlValnSemKeyMappg | InventorySpecialStockValnType | ||
| IsSupplierStockValuation | I_MatlValnSemKeyMappg | IsSupplierStockValuation | ||
| PriceDeterminationControl | I_MatlValnSemKeyMappg | PriceDeterminationControl | ||
| MaterialPriceControl | I_MaterialLedgerPrice | MaterialPriceControl | ||
| MaterialPriceUnitQty | I_MaterialLedgerPrice | MaterialPriceUnitQty | ||
| Currency | I_MaterialLedgerPrice | Currency | ||
| InventoryPrice | ||||
| ActualPrice | ||||
| LedgerName | _MLCurrencyInfo | LedgerName | ||
| CurrencyRoleName | _MLCurrencyInfo | CurrencyRoleName | ||
| LegalCurrencyRole | _MLCurrencyInfo | LegalCurrencyRole | ||
| LegalCurrencyRoleName | _MLCurrencyInfo | LegalCurrencyRoleName | ||
| AccountingValuationView | _MLCurrencyInfo | AccountingValuationView | ||
| AcctgValnVwSubviewCombinedName | _MLCurrencyInfo | AcctgValnVwSubviewCombinedName | ||
| LedgerValnCrcyRoleIsUsedInLogs | _MLCurrencyInfo | LedgerValnCrcyRoleIsUsedInLogs |
@VDM.viewType: #COMPOSITE
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'Inventory Price by key date'
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.dataClass: #MIXED
define view entity R_InventoryPriceByKeyDate
with parameters
P_CalendarDate : calendardate
as select from I_MaterialLedgerPrice as invprice
inner join I_MatlValnSemKeyMappg as hd on hd.CostEstimate = invprice.CostEstimate
left outer to one join I_FiscalCalYearPeriodForLedger as calendar on calendar.CompanyCode = invprice.CompanyCode
and calendar.Ledger = invprice.Ledger
and calendar.FiscalPeriodStartDate <= $parameters.P_CalendarDate
and calendar.FiscalPeriodEndDate >= $parameters.P_CalendarDate
and calendar.IsSpecialPeriod <> 'X'
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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate
and _StandardPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate
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.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate
and _ActualPrice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate
association [0..1] to R_MatlLedgerValnCrcyRole as _MLCurrencyInfo on _MLCurrencyInfo.CompanyCode = invprice.CompanyCode
and _MLCurrencyInfo.CurrencyRole = invprice.CurrencyRole
and _MLCurrencyInfo.Ledger = invprice.Ledger
{
key invprice.CostEstimate,
key invprice.Ledger,
key invprice.CurrencyRole,
calendar.FiscalPeriod as FiscalPeriod,
calendar.FiscalYear as FiscalYear,
calendar.FiscalYearPeriod as FiscalYearPeriod,
hd.Material,
hd.ValuationArea,
hd.InventoryValuationType,
hd.SalesOrder,
hd.SalesOrderItem,
hd.Supplier,
hd.WBSElementInternalID,
invprice.CompanyCode as CompanyCode,
invprice.ValuationQuantityUnit,
invprice.ValuationQuantityUnit as BaseUnit,
hd.InventorySpecialStockType,
hd.InventorySpecialStockValnType,
hd.IsSupplierStockValuation,
hd.PriceDeterminationControl,
invprice.MaterialPriceControl,
@Semantics.quantity.unitOfMeasure: 'ValuationQuantityUnit'
invprice.MaterialPriceUnitQty,
invprice.Currency,
@Semantics.amount.currencyCode: 'Currency'
cast( invprice.MaterialPrice as fml_inventory_price ) as InventoryPrice,
@Semantics.amount.currencyCode: 'Currency'
case invprice.MaterialPriceControl
when 'S' then cast( invprice.MaterialPrice as ck_stprs_1 )
else cast( _StandardPrice.MaterialPrice as ck_stprs_1 )
end as StandardPrice,
@Semantics.amount.currencyCode: 'Currency'
cast( _ActualPrice.MaterialPrice as fml_actual_price ) as ActualPrice,
_MLCurrencyInfo.LedgerName as LedgerName,
_MLCurrencyInfo.CurrencyRoleName as CurrencyRoleName,
_MLCurrencyInfo.LegalCurrencyRole as LegalCurrencyRole,
_MLCurrencyInfo.LegalCurrencyRoleName as LegalCurrencyRoleName,
_MLCurrencyInfo.AccountingValuationView as AccountingValuationView,
_MLCurrencyInfo.AcctgValnVwSubviewCombinedName as AcctgValnVwSubviewCombinedName,
_MLCurrencyInfo.LedgerValnCrcyRoleIsUsedInLogs as LedgerValnCrcyRoleIsUsedInLogs
}
where
invprice.MaterialPriceType = 'INVPR'
and invprice.MaterialPriceSubtype = ' '
and invprice.MaterialPriceValidityStartDate <= $parameters.P_CalendarDate
and invprice.MaterialPriceValidityEndDate >= $parameters.P_CalendarDate
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