P_PurchasingGroupAnalysis2

DDL: P_PURCHASINGGROUPANALYSIS2 SQL: PMMPURGRPAN2 Type: view CONSUMPTION

Purchasing Group Analysis 2

P_PurchasingGroupAnalysis2 is a Consumption CDS View that provides data about "Purchasing Group Analysis 2" in SAP S/4HANA. It reads from 3 data sources (I_CalendarDate, P_PurchaseOrderHistDetail, I_PurchaseOrder) and exposes 19 fields with key fields PurchaseOrder, PurchaseOrderItem, PurchaseOrderTransactionType.

Data Sources (3)

SourceAliasJoin Type
I_CalendarDate CalendarDate inner
P_PurchaseOrderHistDetail P_PurchaseOrderHistDetail from
I_PurchaseOrder PurchaseOrder inner

Parameters (3)

NameTypeDefault
P_DisplayCurrency displaycurrency
P_StartDate bedat
P_EndDate bedat

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PMMPURGRPAN2 view
VDM.viewType #CONSUMPTION view
VDM.private true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Purchasing Group Analysis 2 view
AccessControl.personalData.blocking #NOT_REQUIRED view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder ItemHistDel PurchaseOrder Purchasing Document
KEY PurchaseOrderItem ItemHistDel PurchaseOrderItem Purchasing Document Item
KEY PurchaseOrderTransactionType ItemHistDel PurchaseOrderTransactionType
CompanyCodeCurrency ItemHistDel CompanyCodeCurrency Local Currency
PostingDate ItemHistDel PostingDate Posting Date for GR
PurchaseOrderType ItemHistDel PurchaseOrderType PO Type
PurchasingGroup ItemHistDel PurchasingGroup Purchasing Group
PurchasingOrganization ItemHistDel PurchasingOrganization Purchasing Organization
Plant Plant Valuation Area
Supplier Supplier Supplier
CompanyCode CompanyCode Receiver Company Code
PurchasingDocumentCategory PurchasingDocumentCategory Doc. Category
PurchasingDocumentStatus I_PurchaseOrder PurchasingDocumentOrigin Status
CalendarYear I_CalendarDate CalendarYear Year
CalendarMonth I_CalendarDate CalendarMonth Calendar Month
CalendarQuarter I_CalendarDate CalendarQuarter Calendar Quarter
CalendarWeek I_CalendarDate CalendarWeek Calendar Week
DisplayCurrency
curr182asTotalInvoiceAmountInDisCrcy

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_PurchasingGroupAnalysis2.
-- 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: PMMPURGRPAN2
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat

CREATE VIEW P_PurchasingGroupAnalysis2 AS
SELECT
  ItemHistDel.PurchaseOrder AS PurchaseOrder,
  ItemHistDel.PurchaseOrderItem AS PurchaseOrderItem,
  ItemHistDel.PurchaseOrderTransactionType AS PurchaseOrderTransactionType,
  ItemHistDel.CompanyCodeCurrency AS CompanyCodeCurrency,
  ItemHistDel.PostingDate AS PostingDate,
  ItemHistDel.PurchaseOrderType AS PurchaseOrderType,
  ItemHistDel.PurchasingGroup AS PurchasingGroup,
  ItemHistDel.PurchasingOrganization AS PurchasingOrganization,
  Plant,
  Supplier,
  CompanyCode,
  PurchasingDocumentCategory,
  PurchaseOrder.PurchasingDocumentOrigin AS PurchasingDocumentStatus,
  CalendarDate.CalendarYear AS CalendarYear,
  CalendarDate.CalendarMonth AS CalendarMonth,
  CalendarDate.CalendarQuarter AS CalendarQuarter,
  CalendarDate.CalendarWeek AS CalendarWeek,
  :P_DisplayCurrency AS DisplayCurrency,
  cast(currency_conversion( amount => ItemHistDel.TotalInvoiceAmountInCoCodeCrcy, source_currency => ItemHistDel.CompanyCodeCurrency, target_currency => $parameters.P_DisplayCurrency, exchange_rate_date => ItemHistDel.PostingDate, exchange_rate_type => 'M' ) as abap.curr( 18, 2 )) as TotalInvoiceAmountInDisCrcy AS curr182asTotalInvoiceAmountInDisCrcy
FROM P_PurchaseOrderHistDetail
INNER JOIN I_PurchaseOrder AS PurchaseOrder ON /* join condition not captured in parsed metadata */
INNER JOIN I_CalendarDate AS CalendarDate ON /* join condition not captured in parsed metadata */
;