P_APProcFlowPurOrdHistQty
Purchase Order History - Quantity
P_APProcFlowPurOrdHistQty is a Composite CDS View that provides data about "Purchase Order History - Quantity" in SAP S/4HANA. It reads from 2 data sources (I_PurchaseOrder, I_PurchasingDocumentHistoryBsc) and exposes 11 fields with key fields PurchaseOrder, PurchaseOrderItem, PurchaseOrderTransactionType, MaterialDocumentYear, MaterialDocument. It has 1 association to related views. Part of development package ODATA_PROCESS_FLOW_AP.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrder | _PurchaseOrder | inner |
| I_PurchasingDocumentHistoryBsc | PurchaseOrderHistory | from |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [1..1] | I_PurchaseOrderItem | _PurchaseOrderItem | $projection.PurchaseOrder = _PurchaseOrderItem.PurchaseOrder and $projection.PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem |
Annotations (6)
| Name | Value | Level | Field |
|---|---|---|---|
| AccessControl.authorizationCheck | #MANDATORY | view | |
| ObjectModel.usageType.serviceQuality | #B | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view |
Fields (11)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | |||
| KEY | PurchaseOrderItem | |||
| KEY | PurchaseOrderTransactionType | I_PurchasingDocumentHistoryBsc | PurchasingHistoryDocumentType | Transact. Type |
| KEY | MaterialDocumentYear | I_PurchasingDocumentHistoryBsc | PurchasingHistoryDocumentYear | Settlement Year |
| KEY | MaterialDocument | I_PurchasingDocumentHistoryBsc | PurchasingHistoryDocument | SD Document |
| KEY | MaterialDocumentItem | I_PurchasingDocumentHistoryBsc | PurchasingHistoryDocumentItem | Posting View Item |
| DebitCreditCode | I_PurchasingDocumentHistoryBsc | DebitCreditCode | Single-Character Flag | |
| Quantity | ||||
| PurchaseOrderQuantityUnit | _PurchaseOrderItem | PurchaseOrderQuantityUnit | Order Unit | |
| _PurchaseOrderItem | _PurchaseOrderItem | |||
| AuthorizationGroup |
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_APProcFlowPurOrdHistQty.
-- 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.
CREATE VIEW P_APProcFlowPurOrdHistQty AS
SELECT
cast( PurchaseOrderHistory.PurchasingDocument as vdm_purchaseorder preserving type ) AS PurchaseOrder,
cast( PurchaseOrderHistory.PurchasingDocumentItem as vdm_purchaseorderitem preserving type ) AS PurchaseOrderItem,
PurchaseOrderHistory.PurchasingHistoryDocumentType AS PurchaseOrderTransactionType,
PurchaseOrderHistory.PurchasingHistoryDocumentYear AS MaterialDocumentYear,
PurchaseOrderHistory.PurchasingHistoryDocument AS MaterialDocument,
PurchaseOrderHistory.PurchasingHistoryDocumentItem AS MaterialDocumentItem,
PurchaseOrderHistory.DebitCreditCode AS DebitCreditCode,
sum( PurchaseOrderHistory.Quantity ) AS Quantity,
_PurchaseOrderItem.PurchaseOrderQuantityUnit AS PurchaseOrderQuantityUnit,
_PurchaseOrder._Supplier.AuthorizationGroup AS AuthorizationGroup
FROM I_PurchasingDocumentHistoryBsc AS PurchaseOrderHistory
INNER JOIN I_PurchaseOrder AS _PurchaseOrder ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurchaseOrderItem AS _PurchaseOrderItem ON PurchaseOrder = _PurchaseOrderItem.PurchaseOrder AND PurchaseOrderItem = _PurchaseOrderItem.PurchaseOrderItem -- association [1..1]
;
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