P_POandSAdocs

DDL: P_POANDSADOCS SQL: PPOANDSADOC Type: view CONSUMPTION

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.

Data Sources (2)

SourceAliasJoin Type
I_PurchaseOrderHistory POHistory from
I_SchedulingAgreementHistory SAHistory union_all

Annotations (9)

NameValueLevelField
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)

KeyFieldSource TableSource FieldDescription
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
;