P_PurchaseOrderHistoryDetail
Purchase order history details
P_PurchaseOrderHistoryDetail is a Consumption CDS View that provides data about "Purchase order history details" in SAP S/4HANA. It reads from 1 data source (P_PurchasingGroupAnalysis2) and exposes 16 fields. Part of development package ODATA_MM_ANALYTICS.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| P_PurchasingGroupAnalysis2 | P_PurchasingGroupAnalysis2 | from |
Parameters (3)
| Name | Type | Default |
|---|---|---|
| P_DisplayCurrency | displaycurrency | |
| P_StartDate | bedat | |
| P_EndDate | bedat |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PPURORDHISDETAIL | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ClientDependent | true | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| EndUserText.label | Purchase order history details | view | |
| AccessControl.personalData.blocking | #NOT_REQUIRED | view |
Fields (16)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| PurchaseOrder | P_PurchasingGroupAnalysis2 | PurchaseOrder | Purchasing Document | |
| PurchaseOrderItem | P_PurchasingGroupAnalysis2 | PurchaseOrderItem | Purchasing Document Item | |
| Plant | Plant | Valuation Area | ||
| PurchaseOrderType | PurchaseOrderType | PO Type | ||
| PurchasingOrganization | PurchasingOrganization | Purchasing Organization | ||
| PurchasingGroup | PurchasingGroup | Purchasing Group | ||
| Supplier | Supplier | Supplier | ||
| CompanyCode | CompanyCode | Receiver Company Code | ||
| PurchasingDocumentCategory | PurchasingDocumentCategory | Doc. Category | ||
| PurchasingDocumentStatus | PurchasingDocumentStatus | Short Description | ||
| CalendarYear | CalendarYear | Year | ||
| CalendarMonth | CalendarMonth | Calendar Month | ||
| CalendarQuarter | CalendarQuarter | Calendar Quarter | ||
| CalendarWeek | CalendarWeek | Calendar Week | ||
| TotalInvoiceAmountInDisCrcy | ||||
| int4endasNumberOfDeliveries |
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_PurchaseOrderHistoryDetail.
-- 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: PPURORDHISDETAIL
-- Parameters: P_DisplayCurrency : displaycurrency, P_StartDate : bedat, P_EndDate : bedat
CREATE VIEW P_PurchaseOrderHistoryDetail AS
SELECT
P_PurchasingGroupAnalysis2.PurchaseOrder AS PurchaseOrder,
P_PurchasingGroupAnalysis2.PurchaseOrderItem AS PurchaseOrderItem,
Plant,
PurchaseOrderType,
PurchasingOrganization,
PurchasingGroup,
Supplier,
CompanyCode,
PurchasingDocumentCategory,
PurchasingDocumentStatus,
CalendarYear,
CalendarMonth,
CalendarQuarter,
CalendarWeek,
sum( case when P_PurchasingGroupAnalysis2.PurchaseOrderTransactionType = '2' then P_PurchasingGroupAnalysis2.TotalInvoiceAmountInDisCrcy else 0 end) AS TotalInvoiceAmountInDisCrcy,
sum( case when P_PurchasingGroupAnalysis2.PurchaseOrderTransactionType = '1' then cast(1 as abap.int4) else cast(0 as abap.int4) end ) as NumberOfDeliveries AS int4endasNumberOfDeliveries
FROM P_PurchasingGroupAnalysis2
;
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