P_PurchasingGroupAnalysis2
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)
| Source | Alias | Join Type |
|---|---|---|
| I_CalendarDate | CalendarDate | inner |
| P_PurchaseOrderHistDetail | P_PurchaseOrderHistDetail | from |
| I_PurchaseOrder | PurchaseOrder | inner |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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 */
;
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