P_PurchasingSpendComparison

DDL: P_PURCHASINGSPENDCOMPARISON SQL: PMMPURSPENDCOMP Type: view CONSUMPTION Package: ODATA_MM_ANALYTICS

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)

SourceAliasJoin Type
P_PurchasingSpndComparison2 P_PurchasingSpndComparison2 from
P_PurchasingSpndComparison2 P_PurchasingSpndComparison2 union

Parameters (3)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate bedat
P_EndDate bedat

Annotations (7)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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
;