P_SalesOrderByMonth

DDL: P_SALESORDERBYMONTH Type: view_entity COMPOSITE

P_SalesOrderByMonth is a Composite CDS View in SAP S/4HANA. It reads from 4 data sources (P_CurrentCalendarDateYearMonth, P_PrevCalendarDateYearMonth, P_SalesOrderItem, P_SalesOrderItem) and exposes 21 fields with key fields SalesOrder, YearMonth, IsCurrentYearTransaction, YearMonth, IsCurrentYearTransaction.

Data Sources (4)

SourceAliasJoin Type
P_CurrentCalendarDateYearMonth P_CurrentCalendarDateYearMonth inner
P_PrevCalendarDateYearMonth P_PrevCalendarDateYearMonth inner
P_SalesOrderItem P_SalesOrderItem from
P_SalesOrderItem P_SalesOrderItem union_all

Parameters (4)

NameTypeDefault
P_Date sydatum
P_NumberOfMonths num_of_months
P_ExchangeRateType kurst
P_DisplayCurrency vdm_v_display_currency

Annotations (7)

NameValueLevelField
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #L view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY SalesOrder P_SalesOrderItem SalesOrder SD Document
KEY YearMonth P_CurrentCalendarDateYearMonth YearMonth Year Month
KEY IsCurrentYearTransaction
CalendarMonth P_CurrentCalendarDateYearMonth CalendarMonth Calendar Month
_CalendarMonth P_CurrentCalendarDateYearMonth _CalendarMonth
DisplayCurrency P_SalesOrderItem DisplayCurrency Display Currency
IncomingSalesOrdersNetAmtInDC
ComprnIncgSlsOrdersNetAmtInDC
NumberOfSalesOrders
P_ExchangeRateType
P_Date
SalesOrder SD Document
KEY YearMonth P_PrevCalendarDateYearMonth YearMonth Year Month
KEY IsCurrentYearTransaction
CalendarMonth P_PrevCalendarDateYearMonth CalendarMonth Calendar Month
_CalendarMonth P_PrevCalendarDateYearMonth _CalendarMonth
DisplayCurrency P_SalesOrderItem DisplayCurrency Display Currency
IncomingSalesOrdersNetAmtInDC
ComprnIncgSlsOrdersNetAmtInDC
NumberOfSalesOrders
ComparisonNumberOfSalesOrders

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_SalesOrderByMonth.
-- 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.
-- Parameters: P_Date : sydatum, P_NumberOfMonths : num_of_months, P_ExchangeRateType : kurst, P_DisplayCurrency : vdm_v_display_currency

CREATE VIEW P_SalesOrderByMonth AS
SELECT
  P_SalesOrderItem.SalesOrder AS SalesOrder,
  P_CurrentCalendarDateYearMonth.YearMonth AS YearMonth,
  'X' AS IsCurrentYearTransaction,
  P_CurrentCalendarDateYearMonth.CalendarMonth AS CalendarMonth,
  P_CurrentCalendarDateYearMonth._CalendarMonth AS _CalendarMonth,
  P_SalesOrderItem.DisplayCurrency AS DisplayCurrency,
  cast(sum(P_SalesOrderItem.IncomingSalesOrdersNetAmtInDC) as incg_sls_ords_net_amt_in_dc) AS IncomingSalesOrdersNetAmtInDC,
  cast(0 as comprn_incg_sls_ords_amt_in_dc) AS ComprnIncgSlsOrdersNetAmtInDC,
  cast( 1 as number_of_sales_orders) AS NumberOfSalesOrders,
  cast( 0 as comprn_num_of_sls_ords) as ComparisonNumberOfSalesOrders AS P_ExchangeRateType,
  P_DisplayCurrency: $parameters.P_DisplayCurrency ) inner join P_PrevCalendarDateYearMonth( P_Date: $parameters.P_Date AS P_Date,
  cast( 1 as comprn_num_of_sls_ords) AS ComparisonNumberOfSalesOrders
FROM P_SalesOrderItem
INNER JOIN P_CurrentCalendarDateYearMonth ON /* join condition not captured in parsed metadata */
INNER JOIN P_PrevCalendarDateYearMonth ON /* join condition not captured in parsed metadata */
-- UNION ALL with additional select branch(es): P_SalesOrderItem
;