P_MaterialPriceVariance
Material Price Variance
P_MaterialPriceVariance is a Consumption CDS View that provides data about "Material Price Variance" in SAP S/4HANA. It reads from 8 data sources and exposes 221 fields with key fields PurchasingDocument, PurchasingDocumentItem, ChangeDocument, MaterialDocumentYear, MaterialDocumentItem.
Data Sources (8)
| Source | Alias | Join Type |
|---|---|---|
| I_MaterialPlant | MaterialPlant | inner |
| I_Material | MatMaster | inner |
| P_InfoRecordPriceVariance1 | P_InfoRecordPriceVariance1 | union_all |
| P_InvoicePriceVariance | P_InvoicePriceVariance | union_all |
| P_MatlMovingAvgPrice | P_MatlMovingAvgPrice | union_all |
| P_PurchaseOrderPriceVariance | P_PurchaseOrderPriceVariance | union_all |
| P_PurContractPriceVariance2 | P_PurContractPriceVariance2 | from |
| I_ProductPlant | ProductPlant | inner |
Parameters (4)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_Material | matnr | |
| P_StartDate | vdm_validitystart | |
| P_EndDate | vdm_validityend |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMMMATLPRCVAR | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view | |
| EndUserText.label | Material Price Variance | view |
Fields (221)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchasingDocument | Purchasing Doc. | ||
| KEY | PurchasingDocumentItem | Purchasing Document Item | ||
| KEY | ChangeDocument | ChangeDocument | Document Number | |
| KEY | MaterialDocumentYear | Material Document Year | ||
| KEY | MaterialDocumentItem | Material Document Item | ||
| KEY | PurchasingInfoRecordCategory | Infotype | ||
| KEY | PurchasingGroup | PurchasingGroup | Purchasing Group | |
| FormattedDocumentKey | Vehicle Model | |||
| PurchaseContract | Purchasing Doc. | |||
| PurchaseContractItem | Item | |||
| PurchaseOrder | Purchasing Document | |||
| PurchaseOrderItem | Purchasing Document Item | |||
| Invoice | Orig.Inv.Number | |||
| PurchasingInfoRecord | Info Record | |||
| InvoiceDate | Run On | |||
| CreationDate | CreationDate | Time Stamp | ||
| DocumentChangeDate | DocumentChangeDate | Time Stamp | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| Supplier | Supplier | Supplier | ||
| Material | Material | Vehicle Model | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| Plant | Plant | Valuation Area | ||
| DocNumber | PurchaseContract | Info Record | ||
| PurchasingDocumentType | ||||
| DocumentCurrency | Currency | Document Currency | ||
| DisplayCurrency | Display Currency | |||
| PurchaseOrderQuantityUnit | Order Unit | |||
| OrderQuantity | Quantity | |||
| OrderQuantityUnit | OrderQuantityUnit | Sales Unit | ||
| TargetQuantity | TargetQuantity | Target Quantity | ||
| TargetAmount | Target Value | |||
| InvoiceAmtInDisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | ||||
| NetPriceAmount | Price per Unit | |||
| NetPriceQuantity | Price unit | |||
| OrderPriceUnit | OrderPriceUnit | Valuation Unit | ||
| QuantityInBaseUnit | Quantity | |||
| BOMHasHeaderInfoRecord | ||||
| NumberOfContractChanges | NumberOfChanges | |||
| NumberOfPriceChanges | ||||
| NumberOfPurchaseOrders | ||||
| P_DisplayCurrency | ||||
| P_Material | ||||
| P_StartDate | ||||
| KEY | PurchasingDocumentItem | Purchasing Document Item | ||
| KEY | ChangeDocument | Document Number | ||
| KEY | MaterialDocumentYear | MaterialDocumentYear | Material Document Year | |
| KEY | MaterialDocumentItem | Material Document Item | ||
| KEY | PurchasingInfoRecordCategory | Infotype | ||
| KEY | PurchasingGroup | PurchasingGroup | Purchasing Group | |
| FormattedDocumentKey | Invoice | Vehicle Model | ||
| PurchaseContract | Purchasing Doc. | |||
| PurchaseContractItem | Item | |||
| PurchaseOrder | Purchasing Document | |||
| PurchaseOrderItem | Purchasing Document Item | |||
| Invoice | Orig.Inv.Number | |||
| PurchasingInfoRecord | Info Record | |||
| InvoiceDate | InvoiceDate | Run On | ||
| CreationDate | Time Stamp | |||
| DocumentChangeDate | Time Stamp | |||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| Supplier | Supplier | Supplier | ||
| Material | Material | Vehicle Model | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| Plant | Plant | Valuation Area | ||
| DocNumber | DocNumber | Info Record | ||
| PurchasingDocumentType | ||||
| DocumentCurrency | Currency | Document Currency | ||
| DisplayCurrency | DisplayCurrency | Display Currency | ||
| PurchaseOrderQuantityUnit | PurchaseOrderQuantityUnit | Order Unit | ||
| OrderQuantity | Quantity | |||
| OrderQuantityUnit | Sales Unit | |||
| TargetQuantity | Target Quantity | |||
| ReleaseOrderItemNetAmount | ||||
| TargetAmount | Target Value | |||
| InvoiceAmtInDisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | ||||
| NetPriceAmount | Price per Unit | |||
| NetPriceQuantity | Price unit | |||
| OrderPriceUnit | OrderPriceUnit | Valuation Unit | ||
| QuantityInBaseUnit | Quantity | |||
| BOMHasHeaderInfoRecord | ||||
| NumberOfContractChanges | ||||
| NumberOfPriceChanges | ||||
| NumberOfPurchaseOrders | ||||
| P_DisplayCurrency | ||||
| P_Material | ||||
| P_StartDate | ||||
| KEY | PurchasingDocumentItem | Purchasing Document Item | ||
| KEY | ChangeDocument | Document Number | ||
| KEY | MaterialDocumentYear | Material Document Year | ||
| KEY | MaterialDocumentItem | Material Document Item | ||
| KEY | PurchasingInfoRecordCategory | Infotype | ||
| KEY | PurchasingGroup | PurchasingGroup | Purchasing Group | |
| FormattedDocumentKey | Vehicle Model | |||
| PurchaseContract | Purchasing Doc. | |||
| PurchaseContractItem | Item | |||
| PurchaseOrder | Purchasing Document | |||
| PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | ||
| Invoice | Orig.Inv.Number | |||
| PurchasingInfoRecord | Info Record | |||
| InvoiceDate | Run On | |||
| CreationDate | PurchaseOrderDate | Time Stamp | ||
| DocumentChangeDate | Time Stamp | |||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| Supplier | Supplier | Supplier | ||
| Material | Material | Vehicle Model | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| Plant | Plant | Valuation Area | ||
| DocNumber | DocNumber | Info Record | ||
| PurchasingDocumentType | ||||
| DocumentCurrency | DocumentCurrency | Document Currency | ||
| DisplayCurrency | DisplayCurrency | Display Currency | ||
| PurchaseOrderQuantityUnit | PurchaseOrderQuantityUnit | Order Unit | ||
| OrderQuantity | OrderQuantity | Quantity | ||
| OrderQuantityUnit | Sales Unit | |||
| TargetQuantity | Target Quantity | |||
| TargetAmount | Target Value | |||
| InvoiceAmtInDisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | PurOrdNetAmountInDisplayCrcy | |||
| NetPriceAmount | Price per Unit | |||
| NetPriceQuantity | Price unit | |||
| OrderPriceUnit | OrderPriceUnit | Valuation Unit | ||
| QuantityInBaseUnit | Quantity | |||
| BOMHasHeaderInfoRecord | ||||
| NumberOfContractChanges | ||||
| NumberOfPriceChanges | ||||
| NumberOfPurchaseOrders | ||||
| P_DisplayCurrency | ||||
| P_Material | ||||
| P_StartDate | ||||
| KEY | PurchasingDocumentItem | Purchasing Document Item | ||
| KEY | ChangeDocument | ChangeDocument | Document Number | |
| KEY | MaterialDocumentYear | Material Document Year | ||
| KEY | MaterialDocumentItem | Material Document Item | ||
| KEY | PurchasingInfoRecordCategory | PurchasingInfoRecordCategory | Infotype | |
| KEY | PurchasingGroup | PurchasingGroup | Purchasing Group | |
| FormattedDocumentKey | PurchasingInfoRecord | Vehicle Model | ||
| PurchaseContract | Purchasing Doc. | |||
| PurchaseContractItem | Item | |||
| PurchaseOrder | Purchasing Document | |||
| PurchaseOrderItem | Purchasing Document Item | |||
| Invoice | Orig.Inv.Number | |||
| PurchasingInfoRecord | Info Record | |||
| InvoiceDate | Run On | |||
| CreationDate | CreationDate | Time Stamp | ||
| DocumentChangeDate | DocumentChangeDate | Time Stamp | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| Supplier | Supplier | Supplier | ||
| Material | Material | Vehicle Model | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| Plant | Plant | Valuation Area | ||
| DocNumber | PurchasingInfoRecord | Info Record | ||
| PurchasingDocumentType | ||||
| DocumentCurrency | DocumentCurrency | Document Currency | ||
| DisplayCurrency | Display Currency | |||
| PurchaseOrderQuantityUnit | Order Unit | |||
| OrderQuantity | Quantity | |||
| OrderQuantityUnit | Sales Unit | |||
| TargetQuantity | Target Quantity | |||
| ReleaseOrderItemNetAmount | ||||
| TargetAmount | Target Value | |||
| InvoiceAmtInDisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | ||||
| NetPriceAmount | Price per Unit | |||
| NetPriceQuantity | Price unit | |||
| OrderPriceUnit | PurchaseOrderPriceUnit | Valuation Unit | ||
| QuantityInBaseUnit | QuantityInBaseUnit | Quantity | ||
| BOMHasHeaderInfoRecord | BOMHasHeaderInfoRecord | |||
| NumberOfContractChanges | ||||
| NumberOfPriceChanges | NumberOfPriceChanges | |||
| NumberOfPurchaseOrders | ||||
| P_Material | ||||
| P_StartDate | ||||
| KEY | PurchasingDocumentItem | Purchasing Document Item | ||
| KEY | ChangeDocument | Document Number | ||
| KEY | MaterialDocumentYear | Material Document Year | ||
| KEY | MaterialDocumentItem | Material Document Item | ||
| KEY | PurchasingInfoRecordCategory | Infotype | ||
| PurchasingGroup | I_ProductPlant | PurchasingGroup | Purchasing Group | |
| FormattedDocumentKey | MovingAvg | Material | Vehicle Model | |
| PurchaseContract | Purchasing Doc. | |||
| PurchaseContractItem | Item | |||
| PurchaseOrder | Purchasing Document | |||
| PurchaseOrderItem | Purchasing Document Item | |||
| Invoice | Orig.Inv.Number | |||
| PurchasingInfoRecord | Info Record | |||
| InvoiceDate | Run On | |||
| CreationDate | CreationDate | Time Stamp | ||
| DocumentChangeDate | CreationDate | Time Stamp | ||
| PurchasingOrganization | Purchasing Organization | |||
| Supplier | Supplier | |||
| Material | MovingAvg | Material | Vehicle Model | |
| MaterialGroup | Product Group | |||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| Plant | I_MaterialPlant | Plant | Valuation Area | |
| DocNumber | Info Record | |||
| PurchasingDocumentType | ||||
| DocumentCurrency | Document Currency | |||
| DisplayCurrency | Display Currency | |||
| PurchaseOrderQuantityUnit | Order Unit | |||
| OrderQuantity | Quantity | |||
| OrderQuantityUnit | Sales Unit | |||
| TargetQuantity | Target Quantity | |||
| ReleaseOrderItemNetAmount | ||||
| TargetAmount | Target Value | |||
| InvoiceAmtInDisplayCurrency | ||||
| PurOrdNetAmountInDisplayCrcy | ||||
| NetUnitPriceAmount | ||||
| NetPriceQuantity | Price unit | |||
| OrderPriceUnit | I_Material | MaterialBaseUnit | Valuation Unit | |
| QuantityInBaseUnit | Quantity | |||
| BOMHasHeaderInfoRecord | ||||
| NumberOfContractChanges | ||||
| NumberOfPriceChanges | ||||
| NumberOfPurchaseOrders | ||||
| InvoiceQuantity |
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_MaterialPriceVariance.
-- 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: PMMMATLPRCVAR
-- Parameters: P_DisplayCurrency : displaycurrency, P_Material : matnr, P_StartDate : vdm_validitystart, P_EndDate : vdm_validityend
CREATE VIEW P_MaterialPriceVariance AS
SELECT
cast( PurchaseContract as mm_a_purchasing_document ) AS PurchasingDocument,
cast( PurchaseContractItem as ebelp ) AS PurchasingDocumentItem,
ChangeDocument,
cast('' as gjahr ) AS MaterialDocumentYear,
cast('' as mm_a_material_doc_item ) AS MaterialDocumentItem,
cast('' as esokz ) AS PurchasingInfoRecordCategory,
PurchasingGroup,
concat( PurchaseContract, concat( '/' , PurchaseContractItem) ) AS FormattedDocumentKey,
cast(PurchaseContract as vdm_purchasecontract ) AS PurchaseContract,
cast(PurchaseContractItem as vdm_purchasecontractitem) AS PurchaseContractItem,
cast('' as vdm_purchaseorder) AS PurchaseOrder,
cast('' as vdm_purchaseorderitem ) AS PurchaseOrderItem,
cast('' as fikz_reginv_invoice ) AS Invoice,
cast( cast( '' as abap.char(10)) as mm_a_info_record preserving type ) AS PurchasingInfoRecord,
cast('' as budat ) AS InvoiceDate,
CreationDate,
DocumentChangeDate,
PurchasingOrganization,
Supplier,
Material,
MaterialGroup,
CompanyCode,
Plant,
PurchaseContract AS DocNumber,
cast( '01' as mm_pur_ana_de_doctype ) AS PurchasingDocumentType,
Currency AS DocumentCurrency,
:P_DisplayCurrency AS DisplayCurrency,
cast('' as bstme) AS PurchaseOrderQuantityUnit,
cast(0 as bstmg) AS OrderQuantity,
OrderQuantityUnit,
TargetQuantity,
cast( PurchaseContractTargetAmount as mm_a_target_amount ) AS TargetAmount,
cast(0 as mm_pur_ana_de_invoice_amount) AS InvoiceAmtInDisplayCurrency,
cast(0 as purchase_order_net_amount) AS PurOrdNetAmountInDisplayCrcy,
fltp_to_dec( ContractNetPriceAmount as mm_pur_ana_mat_avg_price ) AS NetPriceAmount,
cast( NetPriceQuantity as abap.quan( 13, 3 ) ) AS NetPriceQuantity,
OrderPriceUnit,
cast(0 as abap.quan(13,3) ) AS QuantityInBaseUnit,
cast('' as abap.char(1)) AS BOMHasHeaderInfoRecord,
NumberOfChanges AS NumberOfContractChanges,
cast( 0 as abap.int4) AS NumberOfPriceChanges,
cast(0 as mm_a_numberofpurchaseorders ) AS NumberOfPurchaseOrders,
cast(0 as menge_d) as InvoiceQuantity AS P_DisplayCurrency,
P_Material : $parameters.P_Material AS P_Material,
P_StartDate: $parameters.P_StartDate AS P_StartDate,
cast( 0 as mm_a_release_order_net_amount ) AS ReleaseOrderItemNetAmount,
cast( 0 as mm_pur_ana_mat_net_unit_price ) AS NetUnitPriceAmount,
cast(0 as menge_d) AS InvoiceQuantity
FROM P_PurContractPriceVariance2
INNER JOIN I_ProductPlant AS ProductPlant ON /* join condition not captured in parsed metadata */
INNER JOIN I_MaterialPlant AS MaterialPlant ON /* join condition not captured in parsed metadata */
INNER JOIN I_Material AS MatMaster ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_InvoicePriceVariance, P_PurchaseOrderPriceVariance, P_InfoRecordPriceVariance1, P_MatlMovingAvgPrice
;
Learn More
- 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
- S/4HANA CDS View Deprecation: What You Need to Know
- 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