P_DDPurchaseOrder

DDL: P_DDPURCHASEORDER SQL: PDDPURORD Type: view COMPOSITE

P_DDPurchaseOrder is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_PurgDocScheduleLine, I_PurchasingDocument, I_PurchasingDocumentItem) and exposes 37 fields with key fields PurchasingDocument, PurchasingDocumentItem, ScheduleLine. It has 2 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_PurgDocScheduleLine eket left_outer
I_PurchasingDocument ekko from
I_PurchasingDocumentItem ekpo inner

Parameters (1)

NameTypeDefault
P_MRPElementCategory delkz

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_PurchasingGroup _PurchasingGroup $projection.PurchasingGroup = _PurchasingGroup.PurchasingGroup
[0..1] I_PurchasingDocumentTypeText _DocTypeTxt $projection.PurchasingDocumentType = _DocTypeTxt.PurchasingDocumentType and $projection.PurchasingDocumentCategory = _DocTypeTxt.PurchasingDocumentCategory

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName PDDPURORD view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MASTER view

Fields (37)

KeyFieldSource TableSource FieldDescription
KEY PurchasingDocument I_PurchasingDocument PurchasingDocument Purchasing Document
KEY PurchasingDocumentItem I_PurchasingDocumentItem PurchasingDocumentItem Purchasing Doc. Item
KEY ScheduleLine I_PurgDocScheduleLine ScheduleLine Schedule Line
Material I_PurchasingDocumentItem Material Vehicle Model
MaterialName
PurchasingDocumentCategory I_PurchasingDocument PurchasingDocumentCategory Doc. Category
PurchasingDocumentType I_PurchasingDocument PurchasingDocumentType RFQ Type
PurchasingDocumentTypeName
PurchasingDocumentItemCategory I_PurchasingDocumentItem PurchasingDocumentItemCategory Item Category
Supplier I_PurchasingDocument Supplier Supplier
SupplierMaterialNumber I_PurchasingDocumentItem SupplierMaterialNumber Supp. Mat. No.
InventorySpecialStockType I_PurchasingDocumentItem InventorySpecialStockType Special Stock Type
PlantendasMRPPlant
SupplyingPlantendasSupplyingPlant
PurchasingInfoRecord I_PurchasingDocumentItem PurchasingInfoRecord Info Record
PurchasingOrganization I_PurchasingDocument PurchasingOrganization Purchasing Organization
PurchasingGroup I_PurchasingDocument PurchasingGroup Purchasing Group
PurchasingGroupName _PurchasingGroup PurchasingGroupName Purchasing Grp. Name
PurchasingGroupEmailAddress _PurchasingGroup EmailAddress E-Mail Address
PlannedDeliveryDurationInDays I_PurchasingDocumentItem PlannedDeliveryDurationInDays Plnd dely time
GoodsReceiptDurationInDays I_PurchasingDocumentItem GoodsReceiptDurationInDays GR proc. time
DeliveryDate I_PurgDocScheduleLine ScheduleLineDeliveryDate Delivery Date
ProductAvailabilityDate I_PurgDocScheduleLine ProductAvailabilityDate Mat.Avail.Date
ScheduleLineOrderDate I_PurgDocScheduleLine ScheduleLineOrderDate PurchOrderDate
PartialDeliveryIsAllowed I_PurchasingDocumentItem PartialDeliveryIsAllowed Partial Deliv.
PurchaseContract I_PurchasingDocumentItem PurchaseContract Purchasing Doc.
PurchaseContractItem I_PurchasingDocumentItem PurchaseContractItem Item
OrderQuantityUnit I_PurchasingDocumentItem OrderQuantityUnit Sales Unit
OrderQuantity I_PurchasingDocumentItem OrderQuantity Quantity
ScheduleLineOrderQuantity I_PurgDocScheduleLine ScheduleLineOrderQuantity Scheduled Qty
RoughGoodsReceiptQty I_PurgDocScheduleLine RoughGoodsReceiptQty Delivered
ScheduleLineOpenQuantity I_PurgDocScheduleLine ScheduleLineOpenQuantity SchLineOpenQuan
ScheduleLineIssuedQuantity I_PurgDocScheduleLine ScheduleLineIssuedQuantity Issued
StockTransferDeliveredQuantity I_PurgDocScheduleLine StockTransferDeliveredQuantity Qty Delivered
ScheduleLineCommittedQuantity I_PurgDocScheduleLine ScheduleLineCommittedQuantity Committed Qty
OrderPriceUnitToOrderUnitNmrtr I_PurchasingDocumentItem OrderPriceUnitToOrderUnitNmrtr Quantity Conversion Numerator
OrdPriceUnitToOrderUnitDnmntr I_PurchasingDocumentItem OrdPriceUnitToOrderUnitDnmntr Quantity Conversion Denominator

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_DDPurchaseOrder.
-- 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: PDDPURORD
-- Parameters: P_MRPElementCategory : delkz

CREATE VIEW P_DDPurchaseOrder AS
SELECT
  ekko.PurchasingDocument AS PurchasingDocument,
  ekpo.PurchasingDocumentItem AS PurchasingDocumentItem,
  eket.ScheduleLine AS ScheduleLine,
  ekpo.Material AS Material,
  _Material._Text[1:Language = $session.system_language].MaterialName AS MaterialName,
  ekko.PurchasingDocumentCategory AS PurchasingDocumentCategory,
  ekko.PurchasingDocumentType AS PurchasingDocumentType,
  _DocTypeTxt[1:Language = $session.system_language].PurchasingDocumentTypeName AS PurchasingDocumentTypeName,
  ekpo.PurchasingDocumentItemCategory AS PurchasingDocumentItemCategory,
  ekko.Supplier AS Supplier,
  ekpo.SupplierMaterialNumber AS SupplierMaterialNumber,
  ekpo.InventorySpecialStockType AS InventorySpecialStockType,
  case $parameters.P_MRPElementCategory when 'BE' then ekpo.Plant when 'U1' then ekko.SupplyingPlant when 'LE' then ekpo.Plant end as MRPPlant AS PlantendasMRPPlant,
  case $parameters.P_MRPElementCategory when 'BE' then ekko.SupplyingPlant when 'U2' then ekpo.Plant when 'LE' then ekko.SupplyingPlant end as SupplyingPlant AS SupplyingPlantendasSupplyingPlant,
  ekpo.PurchasingInfoRecord AS PurchasingInfoRecord,
  ekko.PurchasingOrganization AS PurchasingOrganization,
  ekko.PurchasingGroup AS PurchasingGroup,
  _PurchasingGroup.PurchasingGroupName AS PurchasingGroupName,
  _PurchasingGroup.EmailAddress AS PurchasingGroupEmailAddress,
  ekpo.PlannedDeliveryDurationInDays AS PlannedDeliveryDurationInDays,
  ekpo.GoodsReceiptDurationInDays AS GoodsReceiptDurationInDays,
  eket.ScheduleLineDeliveryDate AS DeliveryDate,
  eket.ProductAvailabilityDate AS ProductAvailabilityDate,
  eket.ScheduleLineOrderDate AS ScheduleLineOrderDate,
  ekpo.PartialDeliveryIsAllowed AS PartialDeliveryIsAllowed,
  ekpo.PurchaseContract AS PurchaseContract,
  ekpo.PurchaseContractItem AS PurchaseContractItem,
  ekpo.OrderQuantityUnit AS OrderQuantityUnit,
  ekpo.OrderQuantity AS OrderQuantity,
  eket.ScheduleLineOrderQuantity AS ScheduleLineOrderQuantity,
  eket.RoughGoodsReceiptQty AS RoughGoodsReceiptQty,
  eket.ScheduleLineOpenQuantity AS ScheduleLineOpenQuantity,
  eket.ScheduleLineIssuedQuantity AS ScheduleLineIssuedQuantity,
  eket.StockTransferDeliveredQuantity AS StockTransferDeliveredQuantity,
  eket.ScheduleLineCommittedQuantity AS ScheduleLineCommittedQuantity,
  ekpo.OrderPriceUnitToOrderUnitNmrtr AS OrderPriceUnitToOrderUnitNmrtr,
  ekpo.OrdPriceUnitToOrderUnitDnmntr AS OrdPriceUnitToOrderUnitDnmntr
FROM I_PurchasingDocument AS ekko
INNER JOIN I_PurchasingDocumentItem AS ekpo ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurgDocScheduleLine AS eket ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_PurchasingGroup AS _PurchasingGroup ON PurchasingGroup = _PurchasingGroup.PurchasingGroup  -- association [0..1]
LEFT OUTER JOIN I_PurchasingDocumentTypeText AS _DocTypeTxt ON PurchasingDocumentType = _DocTypeTxt.PurchasingDocumentType AND PurchasingDocumentCategory = _DocTypeTxt.PurchasingDocumentCategory  -- association [0..1]
;