P_POandSAdocs
Union of PO and SA History
P_POandSAdocs is a Consumption CDS View that provides data about "Union of PO and SA History" in SAP S/4HANA. It reads from 2 data sources (I_PurchaseOrderHistory, I_SchedulingAgreementHistory) and exposes 25 fields with key fields PurchaseOrder, PurchaseOrderItem, PurchaseOrderTransactionType, MaterialDocument, MaterialDocumentYear. Part of development package ODATA_MM_PUR_POITEMS_MONI.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrderHistory | POHistory | from |
| I_SchedulingAgreementHistory | SAHistory | union_all |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PPOANDSADOC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #PRIVILEGED_ONLY | view | |
| EndUserText.label | Union of PO and SA History | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #A | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view |
Fields (25)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | I_PurchaseOrderHistory | PurchaseOrder | Purchasing Document |
| KEY | PurchaseOrderItem | I_PurchaseOrderHistory | PurchaseOrderItem | Schedule Item Number |
| KEY | PurchaseOrderTransactionType | I_PurchaseOrderHistory | PurchaseOrderTransactionType | Transact. Type |
| KEY | MaterialDocument | I_PurchaseOrderHistory | MaterialDocument | Material Doc. |
| KEY | MaterialDocumentYear | I_PurchaseOrderHistory | MaterialDocumentYear | Material Document Year |
| KEY | MaterialDocumentItem | I_PurchaseOrderHistory | MaterialDocumentItem | Material Document Item |
| KEY | AccountAssignmentNumber | I_PurchaseOrderHistory | AccountAssignmentNumber | Account Assgmt No. |
| GdsRcptBlkdStkQtyInOrdQtyUnit | I_PurchaseOrderHistory | GdsRcptBlkdStkQtyInOrdQtyUnit | GR Bl.St. OUn | |
| Quantity | I_PurchaseOrderHistory | Quantity | Value | |
| DebitCreditCode | I_PurchaseOrderHistory | DebitCreditCode | Single-Character Flag | |
| PurchaseOrderAmount | I_PurchaseOrderHistory | PurchaseOrderAmount | Gross Amount | |
| PostingDate | I_PurchaseOrderHistory | PostingDate | Posting Date for GR | |
| SchedulingAgreementasPurchaseOrder | ||||
| KEY | PurchaseOrderItem | I_SchedulingAgreementHistory | SchedulingAgreementItem | Schedule Item Number |
| KEY | PurchaseOrderTransactionType | I_SchedulingAgreementHistory | PurchaseOrderTransactionType | Transact. Type |
| KEY | MaterialDocument | I_SchedulingAgreementHistory | MaterialDocument | Material Doc. |
| KEY | MaterialDocumentYear | I_SchedulingAgreementHistory | MaterialDocumentYear | Material Document Year |
| KEY | MaterialDocumentItem | I_SchedulingAgreementHistory | MaterialDocumentItem | Material Document Item |
| KEY | AccountAssignmentNumber | I_SchedulingAgreementHistory | AccountAssignmentNumber | Account Assgmt No. |
| GdsRcptBlkdStkQtyInOrdQtyUnit | I_SchedulingAgreementHistory | GdsRcptBlkdStkQtyInOrdQtyUnit | GR Bl.St. OUn | |
| Quantity | I_SchedulingAgreementHistory | Quantity | Value | |
| DebitCreditCode | I_SchedulingAgreementHistory | DebitCreditCode | Single-Character Flag | |
| PurchaseOrderAmount | I_SchedulingAgreementHistory | PurchaseOrderAmount | Gross Amount | |
| PostingDate | I_SchedulingAgreementHistory | PostingDate | Posting Date for GR | |
| Currency | I_SchedulingAgreementHistory | Currency | Valuation Crcy |
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_POandSAdocs.
-- 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: PPOANDSADOC
CREATE VIEW P_POandSAdocs AS
SELECT
POHistory.PurchaseOrder AS PurchaseOrder,
POHistory.PurchaseOrderItem AS PurchaseOrderItem,
POHistory.PurchaseOrderTransactionType AS PurchaseOrderTransactionType,
POHistory.MaterialDocument AS MaterialDocument,
POHistory.MaterialDocumentYear AS MaterialDocumentYear,
POHistory.MaterialDocumentItem AS MaterialDocumentItem,
POHistory.AccountAssignmentNumber AS AccountAssignmentNumber,
POHistory.GdsRcptBlkdStkQtyInOrdQtyUnit AS GdsRcptBlkdStkQtyInOrdQtyUnit,
POHistory.Quantity AS Quantity,
POHistory.DebitCreditCode AS DebitCreditCode,
POHistory.PurchaseOrderAmount AS PurchaseOrderAmount,
POHistory.PostingDate AS PostingDate,
POHistory.Currency AS SchedulingAgreementasPurchaseOrder,
SAHistory.Currency AS Currency
FROM I_PurchaseOrderHistory AS POHistory
-- UNION ALL with additional select branch(es): I_SchedulingAgreementHistory
;
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