P_PurOrdMaintainHeadersList

DDL: P_PURORDMAINTAINHEADERSLIST SQL: PPOMAINHEADLIST Type: view CONSUMPTION Package: ODATA_MM_PUR_PO_MAINTAIN

PO Maintenance: Purchase Order Header List

P_PurOrdMaintainHeadersList is a Consumption CDS View that provides data about "PO Maintenance: Purchase Order Header List" in SAP S/4HANA. It reads from 1 data source (I_PurchaseOrder) and exposes 32 fields with key field PurchaseOrder. It has 1 association to related views. Part of development package ODATA_MM_PUR_PO_MAINTAIN.

Data Sources (1)

SourceAliasJoin Type
I_PurchaseOrder ekko from

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_PurOrdMaintainHeaderDraft _HeaderDraft ekko.PurchaseOrder = _HeaderDraft.PurchaseOrder and _HeaderDraft.CreatedByUser != ''

Annotations (5)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
AbapCatalog.sqlViewName PPOMAINHEADLIST view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view

Fields (32)

KeyFieldSource TableSource FieldDescription
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
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_PurOrdMaintainHeadersList.
-- 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: PPOMAINHEADLIST

CREATE VIEW P_PurOrdMaintainHeadersList 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,
  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]
;