P_PurchasingSpendComparison
Purchasing Spend Comparison
P_PurchasingSpendComparison is a Consumption CDS View that provides data about "Purchasing Spend Comparison" in SAP S/4HANA. It reads from 2 data sources (P_PurchasingSpndComparison2, P_PurchasingSpndComparison2) and exposes 55 fields with key fields PurchaseOrder, PurchaseOrderItem, AccountAssignmentNumber, Supplier, PurchaseOrderItem. Part of development package ODATA_MM_ANALYTICS.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| P_PurchasingSpndComparison2 | P_PurchasingSpndComparison2 | from |
| P_PurchasingSpndComparison2 | P_PurchasingSpndComparison2 | union |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PMMPURSPENDCOMP | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Purchasing Spend Comparison | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view |
Fields (55)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | PurchaseOrder | Purchasing Document | |
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | AccountAssignmentNumber | Account Assgmt No. | |
| KEY | Supplier | Supplier | Supplier | |
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurgDocHdrCompanyCode | PurgDocHdrCompanyCode | |||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurOrderItmNetAmtInDispCrcy | ||||
| DisplayCurrency | DisplayCurrency | Display Currency | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| Currency | Currency | Valuation Crcy | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| ProductType | ProductType | Product Type Group | ||
| ServicePerformer | ServicePerformer | Service Performer | ||
| WBSElementInternalID | WBSElementInternalID | WBS Internal ID | ||
| CostCenter | CostCenter | Cost Center | ||
| ComparisonSupplier | Supplier | |||
| ComparisonPurchasingGroup | Purchasing Group | |||
| ComparisonPurchasingOrg | Purchasing Organization | |||
| ComparisonMaterialGroup | Product Group | |||
| P_DisplayCurrency | ||||
| P_StartDate | ||||
| P_EndDatekeyPurchaseOrder | ||||
| KEY | PurchaseOrderItem | PurchaseOrderItem | Purchasing Document Item | |
| KEY | AccountAssignmentNumber | AccountAssignmentNumber | Account Assgmt No. | |
| KEY | Supplier | Supplier | Supplier | |
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurgDocHdrCompanyCode | PurgDocHdrCompanyCode | |||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurOrderItmNetAmtInDispCrcy | ||||
| DisplayCurrency | DisplayCurrency | Display Currency | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| Currency | Currency | Valuation Crcy | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchaseOrderItemCategory | PurchaseOrderItemCategory | Item Category | ||
| PurchaseOrderCategory | PurchaseOrderCategory | Doc. Category | ||
| PurchaseOrderDate | PurchaseOrderDate | PO Date | ||
| MaterialGroup | MaterialGroup | Product Group | ||
| Material | Material | Vehicle Model | ||
| Plant | Plant | Valuation Area | ||
| ProductType | ProductType | Product Type Group | ||
| ServicePerformer | ServicePerformer | Service Performer | ||
| WBSElementInternalID | WBSElementInternalID | WBS Internal ID | ||
| CostCenter | CostCenter | Cost Center | ||
| ComparisonSupplier | Supplier | |||
| ComparisonPurchasingGroup | Purchasing Group | |||
| ComparisonPurchasingOrg | Purchasing Organization | |||
| ComparisonMaterialGroup | Product Group | |||
| ComparisonNetAmtInDispCrcy_E |
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_PurchasingSpendComparison.
-- 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: PMMPURSPENDCOMP
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat
CREATE VIEW P_PurchasingSpendComparison AS
SELECT
PurchaseOrder,
PurchaseOrderItem,
AccountAssignmentNumber,
Supplier,
PurchasingOrganization,
PurgDocHdrCompanyCode,
CompanyCode,
PurOrdNetAmountInDisplayCrcy * ReturnItems AS PurOrderItmNetAmtInDispCrcy,
DisplayCurrency,
PurchasingGroup,
Currency,
PurchaseOrderType,
PurchaseOrderItemCategory,
PurchaseOrderCategory,
PurchaseOrderDate,
MaterialGroup,
Material,
Plant,
ProductType,
ServicePerformer,
WBSElementInternalID,
CostCenter,
cast('DUMMY' as mm_a_comparison_supplier) AS ComparisonSupplier,
cast('ZZZ' as mm_a_comparison_purg_grp) AS ComparisonPurchasingGroup,
cast('ZZZ' as mm_a_comparison_purg_org) AS ComparisonPurchasingOrg,
cast('ZZZ' as mm_a_comparison_mat_grp) AS ComparisonMaterialGroup,
cast(0 as abap.dec(15, 3 )) as ComparisonNetAmtInDispCrcy_E AS P_DisplayCurrency,
P_StartDate : $parameters.P_StartDate AS P_StartDate,
PurOrdNetAmountInDisplayCrcy * ReturnItems AS ComparisonNetAmtInDispCrcy_E
FROM P_PurchasingSpndComparison2
-- UNION with additional select branch(es): P_PurchasingSpndComparison2
;
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