P_INFORECORDPRICEVARIANCE1
Info Record Price Variance 1
P_INFORECORDPRICEVARIANCE1 is a CDS View in S/4HANA. Info Record Price Variance 1. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_MaterialPriceVariance | view | union_all | CONSUMPTION | Material Price Variance |
@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
}