P_PurOrdMaintainHeaderActive
P_PurOrdMaintainHeaderActive is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrder) and exposes 45 fields with key field PurchaseOrder. It has 2 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_PurchaseOrder | ekko | from |
Associations (2)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | P_PurOrdMaintainHeaderDraft | _HeaderDraft | ekko.PurchaseOrder = _HeaderDraft.PurchaseOrder and _HeaderDraft.CreatedByUser != '' |
| [0..1] | P_PurOrdMaintainHeaderActAddr | _HeaderActAddr | ekko.PurchaseOrder = _HeaderActAddr.PurchaseOrder |
Annotations (4)
| Name | Value | Level | Field |
|---|---|---|---|
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view | |
| AbapCatalog.sqlViewName | PPOMAINTHDRACT | view | |
| AccessControl.authorizationCheck | #CHECK | view |
Fields (45)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | PurchaseOrder | I_PurchaseOrder | PurchaseOrder | Purchasing Document |
| PurchasingDocumentCategory | ||||
| PurchasingDocumentType | I_PurchaseOrder | PurchaseOrderType | PO Type | |
| CompanyCode | I_PurchaseOrder | CompanyCode | Receiver Company Code | |
| PurchasingOrganization | I_PurchaseOrder | PurchasingOrganization | Purchasing Organization | |
| PurchasingGroup | I_PurchaseOrder | PurchasingGroup | Purchasing Group | |
| Supplier | I_PurchaseOrder | Supplier | Supplier | |
| Currency | I_PurchaseOrder | DocumentCurrency | Document Currency | |
| PaymentTerms | I_PurchaseOrder | PaymentTerms | Pyt Terms | |
| CashDiscount1Days | I_PurchaseOrder | CashDiscount1Days | Days from Baseline Date for Payment | |
| CashDiscount2Days | I_PurchaseOrder | CashDiscount2Days | Days from Baseline Date for Payment | |
| NetPaymentDays | I_PurchaseOrder | NetPaymentDays | Net Pmt Terms Period | |
| CashDiscount1Percent | I_PurchaseOrder | CashDiscount1Percent | Disc. Percent 1 | |
| CashDiscount2Percent | I_PurchaseOrder | CashDiscount2Percent | Disc. Percent 2 | |
| ExchangeRate | ||||
| IncotermsClassification | I_PurchaseOrder | IncotermsClassification | Incoterms | |
| IncotermsTransferLocation | I_PurchaseOrder | IncotermsTransferLocation | Incoterms 2 | |
| IncotermsVersion | I_PurchaseOrder | IncotermsVersion | Inco. Version | |
| IncotermsLocation1 | I_PurchaseOrder | IncotermsLocation1 | Inco. Location1 | |
| IncotermsLocation2 | I_PurchaseOrder | IncotermsLocation2 | Inco. Location2 | |
| CreatedByUser | I_PurchaseOrder | CreatedByUser | User Name | |
| PurchaseOrderDate | I_PurchaseOrder | PurchaseOrderDate | PO Date | |
| LastChangeDateTime | ||||
| LastChangeUser | ||||
| InvoicingParty | I_PurchaseOrder | InvoicingParty | Supplier | |
| ReleaseIsNotCompleted | I_PurchaseOrder | ReleaseIsNotCompleted | Subj.to Release | |
| IsHeld | I_PurchaseOrder | PurchasingCompletenessStatus | Incomplete | |
| PurchasingDocumentCondition | I_PurchaseOrder | PurchasingDocumentCondition | Doc. Condition | |
| PricingProcedure | I_PurchaseOrder | PricingProcedure | Procedure | |
| ValidityEndDate | I_PurchaseOrder | ValidityEndDate | ValidTo | |
| IsEndOfPurposeBlocked | I_PurchaseOrder | IsEndOfPurposeBlocked | Busin. Purp. Cmpltd. | |
| AddressID | _HeaderActAddr | AddressID | Ship-to address | |
| PurchaseOrderAddressNumber | _HeaderActAddr | PurchaseOrderAddressNumber | ||
| AddressName | _HeaderActAddr | AddressName | Name | |
| AddressStreetName | _HeaderActAddr | AddressStreetName | Street | |
| AddressHouseNumber | _HeaderActAddr | AddressHouseNumber | House Number | |
| AddressPostalCode | _HeaderActAddr | AddressPostalCode | Postal Code | |
| AddressCityName | _HeaderActAddr | AddressCityName | City | |
| AddressPhoneNumber | _HeaderActAddr | AddressPhoneNumber | ||
| AddressFaxNumber | _HeaderActAddr | AddressFaxNumber | Fax | |
| AddressRegion | _HeaderActAddr | AddressRegion | Region | |
| AddressCountry | _HeaderActAddr | AddressCountry | Country/Reg. | |
| AddressCorrespondenceLanguage | _HeaderActAddr | AddressCorrespondenceLanguage | Language | |
| char1endasEditState | ||||
| char1endasHasTwin |
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_PurOrdMaintainHeaderActive.
-- 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: PPOMAINTHDRACT
CREATE VIEW P_PurOrdMaintainHeaderActive AS
SELECT
ekko.PurchaseOrder AS PurchaseOrder,
'F' AS PurchasingDocumentCategory,
ekko.PurchaseOrderType AS PurchasingDocumentType,
ekko.CompanyCode AS CompanyCode,
ekko.PurchasingOrganization AS PurchasingOrganization,
ekko.PurchasingGroup AS PurchasingGroup,
ekko.Supplier AS Supplier,
ekko.DocumentCurrency AS Currency,
ekko.PaymentTerms AS PaymentTerms,
ekko.CashDiscount1Days AS CashDiscount1Days,
ekko.CashDiscount2Days AS CashDiscount2Days,
ekko.NetPaymentDays AS NetPaymentDays,
ekko.CashDiscount1Percent AS CashDiscount1Percent,
ekko.CashDiscount2Percent AS CashDiscount2Percent,
cast(ekko.ExchangeRate as abap.dec(19,5)) AS ExchangeRate,
ekko.IncotermsClassification AS IncotermsClassification,
ekko.IncotermsTransferLocation AS IncotermsTransferLocation,
ekko.IncotermsVersion AS IncotermsVersion,
ekko.IncotermsLocation1 AS IncotermsLocation1,
ekko.IncotermsLocation2 AS IncotermsLocation2,
ekko.CreatedByUser AS CreatedByUser,
ekko.PurchaseOrderDate AS PurchaseOrderDate,
cast('19000101120000' as abap.dec(21,7)) AS LastChangeDateTime,
cast('' as abap.char(12)) AS LastChangeUser,
ekko.InvoicingParty AS InvoicingParty,
ekko.ReleaseIsNotCompleted AS ReleaseIsNotCompleted,
ekko.PurchasingCompletenessStatus AS IsHeld,
ekko.PurchasingDocumentCondition AS PurchasingDocumentCondition,
ekko.PricingProcedure AS PricingProcedure,
ekko.ValidityEndDate AS ValidityEndDate,
ekko.IsEndOfPurposeBlocked AS IsEndOfPurposeBlocked,
_HeaderActAddr.AddressID AS AddressID,
_HeaderActAddr.PurchaseOrderAddressNumber AS PurchaseOrderAddressNumber,
_HeaderActAddr.AddressName AS AddressName,
_HeaderActAddr.AddressStreetName AS AddressStreetName,
_HeaderActAddr.AddressHouseNumber AS AddressHouseNumber,
_HeaderActAddr.AddressPostalCode AS AddressPostalCode,
_HeaderActAddr.AddressCityName AS AddressCityName,
_HeaderActAddr.AddressPhoneNumber AS AddressPhoneNumber,
_HeaderActAddr.AddressFaxNumber AS AddressFaxNumber,
_HeaderActAddr.AddressRegion AS AddressRegion,
_HeaderActAddr.AddressCountry AS AddressCountry,
_HeaderActAddr.AddressCorrespondenceLanguage AS AddressCorrespondenceLanguage,
case when _HeaderDraft.PurchaseOrder is null then cast('0' as abap.char(1)) else cast('2' as abap.char(1)) end as EditState AS char1endasEditState,
case when _HeaderDraft.PurchaseOrder is null then cast('' as abap.char(1)) else cast('X' as abap.char(1)) end as HasTwin AS char1endasHasTwin
FROM I_PurchaseOrder AS ekko
LEFT OUTER JOIN P_PurOrdMaintainHeaderDraft AS _HeaderDraft ON ekko.PurchaseOrder = _HeaderDraft.PurchaseOrder AND _HeaderDraft.CreatedByUser != '' -- association [0..1]
LEFT OUTER JOIN P_PurOrdMaintainHeaderActAddr AS _HeaderActAddr ON ekko.PurchaseOrder = _HeaderActAddr.PurchaseOrder -- association [0..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