A_PurchaseOrder

DDL: A_PURCHASEORDER SQL: APURCHASEORDER Type: view COMPOSITE

Purchase Order

A_PurchaseOrder is a Composite CDS View that provides data about "Purchase Order" in SAP S/4HANA. It reads from 1 data source (R_PurchaseOrder) and exposes 59 fields with key field PurchaseOrder. It has 4 associations to related views.

Data Sources (1)

SourceAliasJoin Type
R_PurchaseOrder Root from

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_PurchaseOrderSupplierAddress _SupplierAddress $projection.PurchaseOrder = _SupplierAddress.PurchaseOrder --Extension
[1..1] E_PurchasingDocument _PurchaseOrderExtension $projection.PurchaseOrder = _PurchaseOrderExtension.PurchasingDocument
[1..*] A_PurchaseOrderItem _PurchaseOrderItem
[0..*] A_PurchaseOrderNote _PurchaseOrderNote

Annotations (15)

NameValueLevelField
VDM.lifecycle.contract.type #PUBLIC_REMOTE_API view
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName APURCHASEORDER view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
EndUserText.label Purchase Order view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.sapObjectNodeType.name PurchaseOrder view
Metadata.ignorePropagatedAnnotations true view
OData.entitySet.name A_PurchaseOrder view

Fields (59)

KeyFieldSource TableSource FieldDescription
KEY PurchaseOrder PurchaseOrder Purchasing Document
CompanyCode CompanyCode Receiver Company Code
PurchaseOrderType PurchaseOrderType PO Type
PurchasingDocumentDeletionCode PurchaseOrderDeletionCode Deletion Code
PurchasingProcessingStatus PurchasingProcessingStatus Proc. State
CreatedByUser CreatedByUser User Name
CreationDate CreationDate Time Stamp
LastChangeDateTime LastChangeDateTime Timestamp
Supplier Supplier Supplier
PurchaseOrderSubtype PurchaseOrderSubtype Control
Language Language Report Text Language
PaymentTerms PaymentTerms Pyt Terms
CashDiscount1Days CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days CashDiscount2Days Days from Baseline Date for Payment
NetPaymentDays NetPaymentDays Net Pmt Terms Period
CashDiscount1Percent CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent CashDiscount2Percent Disc. Percent 2
PurchasingOrganization PurchasingOrganization Purchasing Organization
PurchasingDocumentOrigin PurchasingDocumentOrigin Status
PurchasingGroup PurchasingGroup Purchasing Group
PurchaseOrderDate PurchaseOrderDate PO Date
DocumentCurrency DocumentCurrency Document Currency
ExchangeRate Exchange rate
ExchangeRateIsFixed ExchangeRateIsFixed Fixed Exch.Rate
ValidityStartDate ValidityStartDate Validity Start Date
ValidityEndDate ValidityEndDate ValidTo
SupplierQuotationExternalID SupplierQuotationExternalID Quotation
PurchasingCollectiveNumber PurchasingCollectiveNumber
SupplierRespSalesPersonName SupplierRespSalesPersonName Salesperson
SupplierPhoneNumber SupplierPhoneNumber Telephone
SupplyingSupplier SupplyingSupplier Goods Supplier
SupplyingPlant SupplyingPlant Supplying Plant
IncotermsClassification IncotermsClassification Incoterms
CorrespncExternalReference CorrespncExternalReference Your Reference
CorrespncInternalReference CorrespncInternalReference Our Reference
InvoicingParty InvoicingParty Supplier
ReleaseIsNotCompleted ReleaseIsNotCompleted Subj.to Release
PurchasingCompletenessStatus PurchasingCompletenessStatus Incomplete
IncotermsVersion IncotermsVersion Inco. Version
IncotermsLocation1 IncotermsLocation1 Inco. Location1
IncotermsLocation2 IncotermsLocation2 Inco. Location2
ManualSupplierAddressID ManualSupplierAddressID Address Number
IsEndOfPurposeBlocked IsEndOfPurposeBlocked Busin. Purp. Cmpltd.
AddressCityName
AddressFaxNumber
AddressHouseNumber
AddressName
AddressPostalCode
AddressStreetName
AddressPhoneNumber
AddressRegion
AddressCountry
AddressCorrespondenceLanguage
PurgAggrgdProdCmplncSuplrSts PurgAggrgdProdCmplncSuplrSts Supplier Check Sts
PurgAggrgdProdMarketabilitySts PurgAggrgdProdMarketabilitySts Prod. Marktablty Sts
PurgAggrgdSftyDataSheetStatus PurgAggrgdSftyDataSheetStatus Sfty Data Sheet Sts
PurgProdCmplncTotDngrsGoodsSts PurgProdCmplncTotDngrsGoodsSts Dangerous Goods Sts
_PurchaseOrderItem _PurchaseOrderItem
_PurchaseOrderNote _PurchaseOrderNote

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 A_PurchaseOrder.
-- 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: APURCHASEORDER

CREATE VIEW A_PurchaseOrder AS
SELECT
  PurchaseOrder,
  CompanyCode,
  PurchaseOrderType,
  PurchaseOrderDeletionCode AS PurchasingDocumentDeletionCode,
  PurchasingProcessingStatus,
  CreatedByUser,
  CreationDate,
  LastChangeDateTime,
  Supplier,
  PurchaseOrderSubtype,
  Language,
  PaymentTerms,
  CashDiscount1Days,
  CashDiscount2Days,
  NetPaymentDays,
  CashDiscount1Percent,
  CashDiscount2Percent,
  PurchasingOrganization,
  PurchasingDocumentOrigin,
  PurchasingGroup,
  PurchaseOrderDate,
  DocumentCurrency,
  cast(ExchangeRate as abap.char(12)) AS ExchangeRate,
  ExchangeRateIsFixed,
  ValidityStartDate,
  ValidityEndDate,
  SupplierQuotationExternalID,
  PurchasingCollectiveNumber,
  SupplierRespSalesPersonName,
  SupplierPhoneNumber,
  SupplyingSupplier,
  SupplyingPlant,
  IncotermsClassification,
  CorrespncExternalReference,
  CorrespncInternalReference,
  InvoicingParty,
  ReleaseIsNotCompleted,
  PurchasingCompletenessStatus,
  IncotermsVersion,
  IncotermsLocation1,
  IncotermsLocation2,
  ManualSupplierAddressID,
  IsEndOfPurposeBlocked,
  _SupplierAddress._Address_2.CityName AS AddressCityName,
  _SupplierAddress._Address_2._CurrentDfltFaxNumber.InternationalFaxNumber AS AddressFaxNumber,
  _SupplierAddress._Address_2.HouseNumber AS AddressHouseNumber,
  _SupplierAddress._Address_2.OrganizationName1 AS AddressName,
  _SupplierAddress._Address_2.PostalCode AS AddressPostalCode,
  _SupplierAddress._Address_2.StreetName AS AddressStreetName,
  _SupplierAddress._Address_2._CurrentDfltLandlinePhoneNmbr.InternationalPhoneNumber AS AddressPhoneNumber,
  _SupplierAddress._Address_2.Region AS AddressRegion,
  _SupplierAddress._Address_2.Country AS AddressCountry,
  _SupplierAddress._Address_2.CorrespondenceLanguage AS AddressCorrespondenceLanguage,
  PurgAggrgdProdCmplncSuplrSts,
  PurgAggrgdProdMarketabilitySts,
  PurgAggrgdSftyDataSheetStatus,
  PurgProdCmplncTotDngrsGoodsSts
FROM R_PurchaseOrder AS Root
LEFT OUTER JOIN I_PurchaseOrderSupplierAddress AS _SupplierAddress ON PurchaseOrder = _SupplierAddress.PurchaseOrder  -- association [1..1]
LEFT OUTER JOIN E_PurchasingDocument AS _PurchaseOrderExtension ON PurchaseOrder = _PurchaseOrderExtension.PurchasingDocument  -- association [1..1]
LEFT OUTER JOIN A_PurchaseOrderItem AS _PurchaseOrderItem ON /* condition not available in parsed metadata */  -- association [1..*]
LEFT OUTER JOIN A_PurchaseOrderNote AS _PurchaseOrderNote ON /* condition not available in parsed metadata */  -- association [0..*]
;