/MERP/PP_PO_HEADER

DDL: /MERP/PP_PO_HEADER SQL: /MERP/PP_POHEADR Type: view Package: /MERP/OMDO_PP

Production Order Header

/MERP/PP_PO_HEADER is a CDS View that provides data about "Production Order Header" in SAP S/4HANA. It reads from 2 data sources (aufk, /MERP/PP_PO_STATUS_AGGR) and exposes 33 fields with key field OrderID. It has 2 associations to related views. Part of development package /MERP/OMDO_PP.

Data Sources (2)

SourceAliasJoin Type
aufk aufk from
/MERP/PP_PO_STATUS_AGGR status inner

Associations (2)

CardinalityTargetAliasCondition
[1..1] /MERP/PP_PO_QUANTITY_ISSUE QuantityIssue $projection.OrderID = QuantityIssue.OrderID and $projection.Plant = QuantityIssue.Plant and $projection.ProductionSupervisor = QuantityIssue.ProductionSupervisor
[0..1] /MERP/PP_PO_MissingComponents MissingComponents $projection.OrderID = MissingComponents.ManufacturingOrder and $projection.Plant = MissingComponents.ProductionPlant and $projection.ProductionSupervisor = MissingComponents.ProductionSupervisor

Annotations (9)

NameValueLevelField
AbapCatalog.sqlViewName /MERP/PP_POHEADR view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label Production Order Header view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #C view

Fields (33)

KeyFieldSource TableSource FieldDescription
KEY OrderID aufk aufnr SettlementOrder
OrderCategory
OrderType aufk auart Sales Doc. Type
Plant aufk werks Receiving Plant
IsMarkedForDeletion aufk loekz Status
Material
ActualStartDate afko gstri Actual start
ActualStartTime afko gsuzi ActualStart
ActualEndDate afko gltri Actual finish
ScheduledStartDate afko gstrs Sched. start
ScheduledStartTime afko gsuzs SchedStartTime
ScheduledEndDate afko gltrs Sched. finish
ScheduledEndTime afko gluzs Finish time
ObjectNum aufk objnr Val. Obj. No.
OrderInternalID afko aufpl TaskList No.Ops
ProductionSupervisor afko fevor Prodn Supervisor
SuperiorOdrer afko maufnr SuperiorOrder
ConfirmedQuantity afko igmng Confirmed Yield
MRPController afko dispo MRP Controller
ProductionVersion afpo verid Version ID
ControllingArea aufk kokrs Org. Value
ConfirmedEndDate afko getri Actual Finish
ConfirmedEndTime afko geuzi Actual Finish
UnitOfMeasure afko gmein Base Unit
GRQuantity afpo wemng Received
TotalQuantity afko gamng Target Quantity
PlannedScrapQuantity afko gasmg Total Scrap
QualityIssueScrap afko iasmg Confirmed Scrap
ExpectedDeviationQuantity afpo iamng ExpectVarRecipt
OpenQuantity
totalquantity1endasQualityIssueInPercent
MissingComponentMaterial MissingComponents MissingComponentMaterial
NumberOfComponentsMissing MissingComponents NumberOfComponentsMissing

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 /MERP/PP_PO_HEADER.
-- 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: /MERP/PP_POHEADR

CREATE VIEW /MERP/PP_PO_HEADER AS
SELECT
  aufk.aufnr AS OrderID,
  cast(aufk.autyp as pph_autyp preserving type) AS OrderCategory,
  aufk.auart AS OrderType,
  aufk.werks AS Plant,
  aufk.loekz AS IsMarkedForDeletion,
  cast(afko.plnbez as billofoperationsmaterial preserving type) AS Material,
  afko.gstri AS ActualStartDate,
  afko.gsuzi AS ActualStartTime,
  afko.gltri AS ActualEndDate,
  afko.gstrs AS ScheduledStartDate,
  afko.gsuzs AS ScheduledStartTime,
  afko.gltrs AS ScheduledEndDate,
  afko.gluzs AS ScheduledEndTime,
  aufk.objnr AS ObjectNum,
  afko.aufpl AS OrderInternalID,
  afko.fevor AS ProductionSupervisor,
  afko.maufnr AS SuperiorOdrer,
  afko.igmng AS ConfirmedQuantity,
  afko.dispo AS MRPController,
  afpo.verid AS ProductionVersion,
  aufk.kokrs AS ControllingArea,
  afko.getri AS ConfirmedEndDate,
  afko.geuzi AS ConfirmedEndTime,
  afko.gmein AS UnitOfMeasure,
  afpo.wemng AS GRQuantity,
  afko.gamng AS TotalQuantity,
  afko.gasmg AS PlannedScrapQuantity,
  afko.iasmg AS QualityIssueScrap,
  afpo.iamng AS ExpectedDeviationQuantity,
  cast(totalquantity-plannedscrapquantity-grquantity-expecteddeviationquantity as openquan) AS OpenQuantity,
  case totalquantity when 0 then 0 else DIVISION((qualityissuescrap * 100), totalquantity, 1) end as QualityIssueInPercent AS totalquantity1endasQualityIssueInPercent,
  MissingComponents.MissingComponentMaterial AS MissingComponentMaterial,
  MissingComponents.NumberOfComponentsMissing AS NumberOfComponentsMissing
FROM aufk
INNER JOIN /MERP/PP_PO_STATUS_AGGR AS status ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN /MERP/PP_PO_QUANTITY_ISSUE AS QuantityIssue ON OrderID = QuantityIssue.OrderID AND Plant = QuantityIssue.Plant AND ProductionSupervisor = QuantityIssue.ProductionSupervisor  -- association [1..1]
LEFT OUTER JOIN /MERP/PP_PO_MissingComponents AS MissingComponents ON OrderID = MissingComponents.ManufacturingOrder AND Plant = MissingComponents.ProductionPlant AND ProductionSupervisor = MissingComponents.ProductionSupervisor  -- association [0..1]
;