P_CustomerOrder

DDL: P_CUSTOMERORDER SQL: P_CUSTORDER Type: view BASIC

P_CustomerOrder is a Basic CDS View in SAP S/4HANA. It reads from 7 data sources and exposes 23 fields with key fields mandt, Customer, Plant, Material, PositionNumber.

Data Sources (7)

SourceAliasJoin Type
v_mrp_currency currency left_outer
kna1 kna1 inner
knvv knvv inner
P_MaterialInfo P_MaterialInfo inner
stck_cust_table StockCust inner
vbak vbak inner
vbap vbap inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName P_CUSTORDER view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #BASIC view
VDM.private true view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MASTER view

Fields (23)

KeyFieldSource TableSource FieldDescription
KEY mandt vbak mandt Editing Client
KEY Customer vbak kunnr Stock customer
KEY Plant sales werks Receiving Plant
KEY Material sales matnr Vehicle Model
KEY PositionNumber sales delps Order Item
KEY OrderNumber sales delnr Order No.(OLTP)
ReferenceDocumentScheduleLine sales delet Scheduling
DeliveryDate sales dat00 Planned dates
OriginalBaseAmount
QuantityBaseUnitOfMeasure vbap meins Valuation Unit
BaseUnitOfMeasure P_MaterialInfo BaseUnitOfMeasure Base Unit
Name kna1 name1 PA text
IncreaseTolerance knvv uebto Overrun Tol.
MaterialPrice P_MaterialInfo Price RVP f.PricePro.
MaterialPriceUnit P_MaterialInfo PriceUnit Fixation Set Grp UoM
NetPriceAmount vbap netpr Price
DocumentCurrency vbap waerk Doc. Currency
StandardPrice P_MaterialInfo Costprice
MaterialPriceInCoCodeCurrency P_MaterialInfo MaterialPriceInCoCodeCurrency Moving price
TodaysDate
Umrez P_MaterialInfo Umrez Numerator
katr10endasCustomerType
katr10endasToleranceLevel

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_CustomerOrder.
-- 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: P_CUSTORDER

CREATE VIEW P_CustomerOrder AS
SELECT
  vbak.mandt AS mandt,
  vbak.kunnr AS Customer,
  sales.werks AS Plant,
  sales.matnr AS Material,
  sales.delps AS PositionNumber,
  sales.delnr AS OrderNumber,
  sales.delet AS ReferenceDocumentScheduleLine,
  sales.dat00 AS DeliveryDate,
  cast ( 0 - sales.mng01 as abap.quan(13,3)) AS OriginalBaseAmount,
  vbap.meins AS QuantityBaseUnitOfMeasure,
  P_MaterialInfo.BaseUnitOfMeasure AS BaseUnitOfMeasure,
  kna1.name1 AS Name,
  knvv.uebto AS IncreaseTolerance,
  P_MaterialInfo.Price AS MaterialPrice,
  P_MaterialInfo.PriceUnit AS MaterialPriceUnit,
  vbap.netpr AS NetPriceAmount,
  vbap.waerk AS DocumentCurrency,
  P_MaterialInfo.Costprice AS StandardPrice,
  P_MaterialInfo.MaterialPriceInCoCodeCurrency AS MaterialPriceInCoCodeCurrency,
  $session.system_date AS TodaysDate,
  P_MaterialInfo.Umrez AS Umrez,
  case when StockCust.customertype = 'KATR1' then kna1.katr1 when StockCust.customertype = 'KATR2' then kna1.katr2 when StockCust.customertype = 'KATR3' then kna1.katr3 when StockCust.customertype = 'KATR4' then kna1.katr4 when StockCust.customertype = 'KATR5' then kna1.katr5 when StockCust.customertype = 'KATR6' then kna1.katr6 when StockCust.customertype = 'KATR7' then kna1.katr7 when StockCust.customertype = 'KATR8' then kna1.katr8 when StockCust.customertype = 'KATR9' then kna1.katr9 when StockCust.customertype = 'KATR10' then kna1.katr10 end as CustomerType AS katr10endasCustomerType,
  case when StockCust.tolerancelevel = 'KATR1' then kna1.katr1 when StockCust.customertype = 'KATR2' then kna1.katr2 when StockCust.customertype = 'KATR3' then kna1.katr3 when StockCust.customertype = 'KATR4' then kna1.katr4 when StockCust.customertype = 'KATR5' then kna1.katr5 when StockCust.customertype = 'KATR6' then kna1.katr6 when StockCust.customertype = 'KATR7' then kna1.katr7 when StockCust.customertype = 'KATR8' then kna1.katr8 when StockCust.customertype = 'KATR9' then kna1.katr9 when StockCust.customertype = 'KATR10' then kna1.katr10 end as ToleranceLevel AS katr10endasToleranceLevel
INNER JOIN vbak ON /* join condition not captured in parsed metadata */
INNER JOIN vbap ON /* join condition not captured in parsed metadata */
INNER JOIN kna1 ON /* join condition not captured in parsed metadata */
INNER JOIN knvv ON /* join condition not captured in parsed metadata */
INNER JOIN P_MaterialInfo ON /* join condition not captured in parsed metadata */
INNER JOIN stck_cust_table AS StockCust ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN v_mrp_currency AS currency ON /* join condition not captured in parsed metadata */
;