P_PurOrdMaintainHeaderDraft

DDL: P_PURORDMAINTAINHEADERDRAFT SQL: PPOMAINTHDRDRAFT Type: view CONSUMPTION

P_PurOrdMaintainHeaderDraft is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (ekko_po_d) and exposes 41 fields with key field PurchaseOrderHeaderDraftUUID. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
ekko_po_d ekkod from

Associations (1)

CardinalityTargetAliasCondition
[0..1] P_PurOrdMaintDraftAdminData _DraftAdministrativeData ekkod.db_key = _DraftAdministrativeData.DraftID and _DraftAdministrativeData.EntityName = 'MM_PO_DRAFT'

Annotations (4)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
AbapCatalog.sqlViewName PPOMAINTHDRDRAFT view
AccessControl.authorizationCheck #PRIVILEGED_ONLY view

Fields (41)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrderHeaderDraftUUID guid UUID 22 char.
PurchaseOrder ekko_po_d ebeln Source PurchDoc
PurchasingDocumentCategory
PurchasingDocumentType ekko_po_d bsart Stnd purch.ord.
CompanyCode ekko_po_d bukrs Value
PurchasingOrganization ekko_po_d ekorg Purchasing Org.
PurchasingGroup ekko_po_d ekgrp Sub. purchasing grp
Supplier ekko_po_d lifnr Vendor no.
Currency ekko_po_d waers Transaction Currency
PaymentTerms ekko_po_d zterm Terms of Payment
CashDiscount1Days ekko_po_d zbd1t Payment in
CashDiscount2Days ekko_po_d zbd2t Payment in
NetPaymentDays ekko_po_d zbd3t Payment in
CashDiscount1Percent ekko_po_d zbd1p Max. Cash Dis. (%)
CashDiscount2Percent ekko_po_d zbd2p Nrm. Cash Dis. (%)
ExchangeRate
IncotermsClassification ekko_po_d inco1 Incoterms
IncotermsTransferLocation ekko_po_d inco2 Incoterms 2
IncotermsVersion ekko_po_d incov Inco. Version
IncotermsLocation1 ekko_po_d inco2_l Inco. Location1
IncotermsLocation2 ekko_po_d inco3_l Inco. Location2
CreatedByUser ekko_po_d crea_uname User Name
PurchaseOrderDate ekko_po_d bedat Start date
LastChangeDateTime ekko_po_d lchg_date_time Time Stamp
LastChangeUser ekko_po_d lchg_uname User Name
InvoicingParty ekko_po_d lifre Location Alias
ReleaseIsNotCompleted
IsHeld ekko_po_d memory Incomplete
PurchasingDocumentCondition ekko_po_d knumv Doc. Condition
PricingProcedure ekko_po_d kalsm Search Proced.
AddressID ekko_po_d adrnr Sold-To Address
AddressName ekko_po_d ad_name1 Name
AddressStreetName ekko_po_d ad_street Street
AddressHouseNumber ekko_po_d ad_hsnm1 House Number
AddressPostalCode ekko_po_d ad_pstcd1 Postal Code
AddressCityName ekko_po_d ad_city1 City
AddressPhoneNumber ekko_po_d ad_tlnmbr1 Telephone
AddressFaxNumber ekko_po_d ad_fxnmbr1 Fax
AddressRegion ekko_po_d regio Resident Region
AddressCountry ekko_po_d land1 Trip Ctry/Reg
AddressCorrespondenceLanguage ekko_po_d langu Primary lang.

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_PurOrdMaintainHeaderDraft.
-- 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: PPOMAINTHDRDRAFT

CREATE VIEW P_PurOrdMaintainHeaderDraft AS
SELECT
  guid AS PurchaseOrderHeaderDraftUUID,
  ekkod.ebeln AS PurchaseOrder,
  cast('F' as abap.char(1)) AS PurchasingDocumentCategory,
  ekkod.bsart AS PurchasingDocumentType,
  ekkod.bukrs AS CompanyCode,
  ekkod.ekorg AS PurchasingOrganization,
  ekkod.ekgrp AS PurchasingGroup,
  ekkod.lifnr AS Supplier,
  ekkod.waers AS Currency,
  ekkod.zterm AS PaymentTerms,
  ekkod.zbd1t AS CashDiscount1Days,
  ekkod.zbd2t AS CashDiscount2Days,
  ekkod.zbd3t AS NetPaymentDays,
  ekkod.zbd1p AS CashDiscount1Percent,
  ekkod.zbd2p AS CashDiscount2Percent,
  cast(ekkod.wkurs as abap.dec(19,5)) AS ExchangeRate,
  ekkod.inco1 AS IncotermsClassification,
  ekkod.inco2 AS IncotermsTransferLocation,
  ekkod.incov AS IncotermsVersion,
  ekkod.inco2_l AS IncotermsLocation1,
  ekkod.inco3_l AS IncotermsLocation2,
  ekkod.crea_uname AS CreatedByUser,
  ekkod.bedat AS PurchaseOrderDate,
  ekkod.lchg_date_time AS LastChangeDateTime,
  ekkod.lchg_uname AS LastChangeUser,
  ekkod.lifre AS InvoicingParty,
  cast('' as abap.char(1)) AS ReleaseIsNotCompleted,
  ekkod.memory AS IsHeld,
  ekkod.knumv AS PurchasingDocumentCondition,
  ekkod.kalsm AS PricingProcedure,
  ekkod.adrnr AS AddressID,
  ekkod.ad_name1 AS AddressName,
  ekkod.ad_street AS AddressStreetName,
  ekkod.ad_hsnm1 AS AddressHouseNumber,
  ekkod.ad_pstcd1 AS AddressPostalCode,
  ekkod.ad_city1 AS AddressCityName,
  ekkod.ad_tlnmbr1 AS AddressPhoneNumber,
  ekkod.ad_fxnmbr1 AS AddressFaxNumber,
  ekkod.regio AS AddressRegion,
  ekkod.land1 AS AddressCountry,
  ekkod.langu AS AddressCorrespondenceLanguage
FROM ekko_po_d AS ekkod
LEFT OUTER JOIN P_PurOrdMaintDraftAdminData AS _DraftAdministrativeData ON ekkod.db_key = _DraftAdministrativeData.DraftID AND _DraftAdministrativeData.EntityName = 'MM_PO_DRAFT'  -- association [0..1]
;