P_SalesOrderByMonth
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)
| Source | Alias | Join Type |
|---|---|---|
| P_CurrentCalendarDateYearMonth | P_CurrentCalendarDateYearMonth | inner |
| P_PrevCalendarDateYearMonth | P_PrevCalendarDateYearMonth | inner |
| P_SalesOrderItem | P_SalesOrderItem | from |
| P_SalesOrderItem | P_SalesOrderItem | union_all |
Parameters (4)
| Name | Type | Default |
|---|---|---|
| P_Date | sydatum | |
| P_NumberOfMonths | num_of_months | |
| P_ExchangeRateType | kurst | |
| P_DisplayCurrency | vdm_v_display_currency |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| 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)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| 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
;
Learn More
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- CDS View Annotations — A Complete Guide
- What Is a CDS View in SAP S/4HANA?
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA
- BSEG to ACDOCA: The Universal Journal Migration
- Business Partner Migration: KNA1/LFA1 to BUT000
- Material Document Migration: MSEG/MKPF to MATDOC
- How to Find the Right CDS View for an SAP Table
- BW Extractor to CDS View Migration Guide
- S/4HANA CDS View Deprecation: What You Need to Know
- ABAP CDS View Tutorial — From Basics to Real-World Examples
- RAP and CDS Views — Building Transactional Apps in SAP S/4HANA
- Sales Document Status Migration: VBUP/VBUK Removal in S/4HANA
- CO Tables in S/4HANA: COEP, COBK, COSS, COSP to ACDOCA