P_InfoRecordPriceVariance1
Info Record Price Variance 1
P_InfoRecordPriceVariance1 is a Consumption CDS View that provides data about "Info Record Price Variance 1" in SAP S/4HANA. It reads from 3 data sources (I_CalendarDate, P_ChangeDocumentItem3, P_InfoRecordPriceVariance) and exposes 26 fields with key fields PurchasingInfoRecord, PurchasingInfoRecordCategory, PurchasingOrganization, Plant, ChangeDocument. Part of development package ODATA_MM_ANALYTICS.
Data Sources (3)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | CalendarDate | left_outer |
| P_ChangeDocumentItem3 | P_ChangeDocumentItem3 | left_outer |
| P_InfoRecordPriceVariance | P_InfoRecordPriceVariance | from |
Parameters (4)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_Material | matnr | |
| P_StartDate | vdm_validitystart | |
| P_EndDate | vdm_validityend |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMMIRPRCVAR1 | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view |
Fields (26)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchasingInfoRecord | InfoRecordPriceChange | PurchasingInfoRecord | |
| KEY | PurchasingInfoRecordCategory | PurchasingInfoRecordCategory | ||
| KEY | PurchasingOrganization | InfoRecordPriceChange | PurchasingOrganization | |
| KEY | Plant | InfoRecordPriceChange | Plant | |
| KEY | ChangeDocument | ChangeDocument | ||
| CompanyCode | ||||
| PurchasingGroup | InfoRecordPriceChange | PurchasingGroup | ||
| Supplier | Supplier | |||
| Material | InfoRecordPriceChange | Material | ||
| MaterialGroup | InfoRecordPriceChange | MaterialGroup | ||
| CreationDate | CreationDate | |||
| NumberOfChanges | NumberOfChanges | |||
| NumberOfPriceChanges | InfoRecordPriceChange | NumberOfPriceChanges | ||
| DocumentChangeDate | DocumentChangeDate | |||
| BOMHasHeaderInfoRecord | BOMHasHeaderInfoRecord | |||
| TotalNumberOfChanges | NumberOfChanges | NumberOfPriceChanges | ||
| CalendarYear | CalendarYear | |||
| CalendarQuarter | CalendarQuarter | |||
| CalendarMonth | CalendarMonth | |||
| CalendarWeek | CalendarWeek | |||
| YearQuarter | YearQuarter | |||
| YearMonth | YearMonth | |||
| YearWeek | YearWeek | |||
| QuantityInBaseUnit | QuantityInBaseUnit | |||
| MaterialPriceUnitQty | MaterialPriceUnitQty | |||
| PurchaseOrderPriceUnit | PurchaseOrderPriceUnit |
@AbapCatalog.sqlViewName: 'PMMIRPRCVAR1'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@VDM.viewType : #CONSUMPTION
@VDM.private: true
@AccessControl.personalData.blocking: #NOT_REQUIRED
define view P_InfoRecordPriceVariance1
with parameters
P_DisplayCurrency : displaycurrency,
P_Material : matnr,
P_StartDate : vdm_validitystart,
P_EndDate : vdm_validityend
as select from P_InfoRecordPriceVariance( P_Material : $parameters.P_Material, P_StartDate: $parameters.P_StartDate,
P_EndDate: $parameters.P_EndDate ) as InfoRecordPriceChange
left outer join I_CalendarDate as CalendarDate
on InfoRecordPriceChange.DocumentChangeDate = CalendarDate.CalendarDate
// left outer join P_PurchOrdReleased as ReleaseOrders
// on InfoRecordPriceChange.PurchasingInfoRecord = ReleaseOrders.PurchasingInfoRecord
// and ReleaseOrders.PurchaseContract = '' // commented for removing duplicate records
left outer join P_ChangeDocumentItem3 ( P_StartDate: $parameters.P_StartDate,
P_EndDate: $parameters.P_EndDate ) as NumberOfChanges on InfoRecordPriceChange.PurchasingInfoRecord = NumberOfChanges.ChangeDocObject
{
key InfoRecordPriceChange.PurchasingInfoRecord,
key PurchasingInfoRecordCategory,
key InfoRecordPriceChange.PurchasingOrganization,
key InfoRecordPriceChange.Plant,
key ChangeDocument,
cast('' as bukrs ) as CompanyCode,
InfoRecordPriceChange.PurchasingGroup,
Supplier,
InfoRecordPriceChange.Material,
InfoRecordPriceChange.MaterialGroup,
case when IsDocumentChanged = 'X'and NumberOfChanges = 0
then InfoRecordPriceChange.DocumentCurrency
else Currency end as DocumentCurrency,
CreationDate,
NumberOfChanges,
InfoRecordPriceChange.NumberOfPriceChanges,
DocumentChangeDate,
BOMHasHeaderInfoRecord,
case when DocumentChangeDate is not null
and DocumentChangeDate != '00000000'
and InfoRecordPriceChange.DocumentCurrency is not null
then currency_conversion(
amount => InfoRecordPriceChange.NetPriceAmount,
source_currency => InfoRecordPriceChange.DocumentCurrency,
target_currency => :P_DisplayCurrency,
exchange_rate_date => DocumentChangeDate,
exchange_rate_type => 'M',
error_handling => 'FAIL_ON_ERROR'
)
else 0
end as NetPrice,
NumberOfChanges.NumberOfPriceChanges as TotalNumberOfChanges,
// commented as field not required in the above level
// case when ReleaseOrders.PurchaseOrderDate is not null
// and ReleaseOrders.PurchaseOrderDate != '00000000'
// and ReleaseOrders.DocumentCurrency is not null
// then
// currency_conversion( amount => ReleaseOrders.NetAmount,
// source_currency => ReleaseOrders.DocumentCurrency,
// target_currency => $parameters.P_DisplayCurrency,
// exchange_rate_date => ReleaseOrders.PurchaseOrderDate,
// exchange_rate_type => 'M',
// error_handling => 'FAIL_ON_ERROR' )
// else 0 end as ReleaseOrderItemNetAmount,
/* Dates */
CalendarYear,
CalendarQuarter,
CalendarMonth,
CalendarWeek,
YearQuarter,
YearMonth,
YearWeek,
QuantityInBaseUnit,
MaterialPriceUnitQty,
PurchaseOrderPriceUnit
}
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