P_InfoRecordPriceVariance

DDL: P_INFORECORDPRICEVARIANCE SQL: PMMIRPRCVAR Type: view CONSUMPTION

P_InfoRecordPriceVariance is a Consumption CDS View in SAP S/4HANA. It reads from 3 data sources (I_PurchasingInfoRecord, I_PurgInfoRecdOrgPlantData, P_ChangeDocumentItem2) and exposes 26 fields with key fields PurchasingInfoRecord, PurchasingInfoRecordCategory, PurchasingOrganization, Plant, ChangeDocument.

Data Sources (3)

SourceAliasJoin Type
I_PurchasingInfoRecord InfoRecord from
I_PurgInfoRecdOrgPlantData InfoRecord1 inner
P_ChangeDocumentItem2 P_ChangeDocumentItem2 left_outer

Parameters (3)

NameTypeDefault
P_Material matnr
P_StartDate vdm_validitystart
P_EndDate vdm_validityend

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PMMIRPRCVAR 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)

KeyFieldSource TableSource FieldDescription
KEY PurchasingInfoRecord I_PurchasingInfoRecord PurchasingInfoRecord Info Record
KEY PurchasingInfoRecordCategory I_PurgInfoRecdOrgPlantData PurchasingInfoRecordCategory Infotype
KEY PurchasingOrganization I_PurgInfoRecdOrgPlantData PurchasingOrganization Purchasing Organization
KEY Plant I_PurgInfoRecdOrgPlantData Plant Valuation Area
KEY ChangeDocument ChangeDocument Document Number
PurchasingGroup I_PurgInfoRecdOrgPlantData PurchasingGroup Purchasing Group
Supplier I_PurchasingInfoRecord Supplier Supplier
IRNetPriceAmount I_PurgInfoRecdOrgPlantData NetPriceAmount Net Price
CreationDate I_PurchasingInfoRecord CreationDate Time Stamp
Material I_PurchasingInfoRecord Material Vehicle Model
MaterialGroup I_PurchasingInfoRecord MaterialGroup Product Group
Currency ChangeItem Currency Valuation Crcy
CurrencyendasDocumentCurrency
CreationDateendasDocumentChangeDate
NetPriceAmountendasNetPriceAmount
MaterialPriceUnitQty MaterialPriceUnitQty Price unit
PurchaseOrderPriceUnit PurchaseOrderPriceUnit Order Price Un.
IsDocumentChanged IsDocumentChanged
NumberOfChanges NumberOfChanges
NumberOfPriceChanges NumberOfPriceChanges
_Material I_PurchasingInfoRecord _Material
_MaterialGroup I_PurchasingInfoRecord _MaterialGroup
_Plant I_PurgInfoRecdOrgPlantData _Plant
_Supplier I_PurchasingInfoRecord _Supplier
_PurchasingOrganization I_PurgInfoRecdOrgPlantData _PurchasingOrganization
_PurchasingGroup I_PurgInfoRecdOrgPlantData _PurchasingGroup

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_InfoRecordPriceVariance.
-- 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: PMMIRPRCVAR
-- Parameters: P_Material : matnr, P_StartDate : vdm_validitystart, P_EndDate : vdm_validityend

CREATE VIEW P_InfoRecordPriceVariance AS
SELECT
  InfoRecord.PurchasingInfoRecord AS PurchasingInfoRecord,
  InfoRecord1.PurchasingInfoRecordCategory AS PurchasingInfoRecordCategory,
  InfoRecord1.PurchasingOrganization AS PurchasingOrganization,
  InfoRecord1.Plant AS Plant,
  ChangeDocument,
  InfoRecord1.PurchasingGroup AS PurchasingGroup,
  InfoRecord.Supplier AS Supplier,
  InfoRecord1.NetPriceAmount AS IRNetPriceAmount,
  InfoRecord.CreationDate AS CreationDate,
  InfoRecord.Material AS Material,
  InfoRecord.MaterialGroup AS MaterialGroup,
  ChangeItem.Currency AS Currency,
  case when ChangeDocument is not null and ChangeItem.Currency is not null then ChangeItem.Currency else InfoRecord1.Currency end as DocumentCurrency AS CurrencyendasDocumentCurrency,
  case when ChangeDocument = '' or ChangeDocument is null then InfoRecord.CreationDate else ChangeItem.CreationDate end as DocumentChangeDate AS CreationDateendasDocumentChangeDate,
  case when ChangeDocument is not null then cast(ChangeItem.NetPriceAmount + division(cast(ValueAfterDecimal as abap.dec( 21, 2 )), 100,2) as abap.curr( 21, 2 )) else InfoRecord1.NetPriceAmount end as NetPriceAmount AS NetPriceAmountendasNetPriceAmount,
  MaterialPriceUnitQty,
  PurchaseOrderPriceUnit,
  IsDocumentChanged,
  NumberOfChanges,
  NumberOfPriceChanges,
  InfoRecord._Material AS _Material,
  InfoRecord._MaterialGroup AS _MaterialGroup,
  InfoRecord1._Plant AS _Plant,
  InfoRecord._Supplier AS _Supplier,
  InfoRecord1._PurchasingOrganization AS _PurchasingOrganization,
  InfoRecord1._PurchasingGroup AS _PurchasingGroup
FROM I_PurchasingInfoRecord AS InfoRecord
INNER JOIN I_PurgInfoRecdOrgPlantData AS InfoRecord1 ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN P_ChangeDocumentItem2 ON /* join condition not captured in parsed metadata */
;