I_ARunAnlytsSalesReturns
Return Sales Order
I_ARunAnlytsSalesReturns (Composite)
Package: Explore, extend and adapt the SAP S/4HANA Cloud Private Edition with built-in and side-by-side extension capabilities.
Cross Applications
I_ARunAnlytsSalesReturns is a Composite CDS View (Cube) that provides data about "Return Sales Order" in SAP S/4HANA. It reads from 2 data sources (I_SupDmndMaterialPlant, I_SalesDocumentItem) and exposes 60 fields with key fields RequirementDocumentNumber, RequirementDocumentItem. It has 14 associations to related views.
SAP API Hub
| State | C1 |
|---|---|
| Line of Business | Cross Applications |
| Application Component | LO-RFM-ARN |
| Capabilities | Data Provider for Analytical Queries, Data Source in SQL Select, Data Source for Defining CDS Entities, Association Target for Defining CDS Entities |
| Package | Cross Applications for SAP S/4HANA Cloud Private Edition |
| Description | <p>This CDS view provides the supply assignment details for return sales orders.</p> <p>This CDS view provides the data to answer the following business questions:</p> <ul> <li><p>What is the amount in sales returns?</p></li> <li><p>What is the amount per plant, per sales district, and so on?</p></li> <li><p>What is the number of items per plant, per sales district, and so on?</p></li> </ul> <p>To help you decide which CDS view to use for your purposes, SAP has introduced the annotation ObjectModel.supportedCapabilities that indicates the most appropriate use cases for each CDS view. To find out what use cases are best supported by this CDS view, access the entry of the CDS view in the View Browser app and find the values for this annotation under the Annotation tab. For more information, see Supported Capabilities for CDS Views.</p> |
Documentation
- Analytics with CDS Views — Build Analytics for S/4HANA Cloud Private Edition ABAP CDS views replicated to SAP Cloud Platform
- CDS Views on SAP Business Accelerator Hub — Explore SAP S/4HANA Cloud Private Edition CDS Views on SAP Business Accelerator Hub
- Create CDS View as API — Create CDS views in SAP S/4HANA Cloud Private Edition and consume them as APIs
- Custom CDS Views — Access data using a Custom Core Data Service view (Custom CDS view)
- Key User Extensibility Tools — The Key User Extensibility Tools of S/4HANA
- SAP Extensibility Explorer for SAP S/4HANA Cloud Private Edition — Explore SAP S/4HANA Cloud Private Edition Extensibility options by leveraging the sample scenarios from SAP
- SAP S/4HANA Extensibility — SAP S/4HANA Extensibility Tutorial
- VDM View Types — The Virtual Data Model in SAP S/4HANA Cloud Private Edition
- View Browser — Search, browse and tag CDS Views
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_SupDmndMaterialPlant | marc | inner |
| I_SalesDocumentItem | SalesDocumentItem | from |
Associations (14)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_SalesDocument | _SalesDocument | $projection.RequirementDocumentNumber = _SalesDocument.SalesDocument |
| [0..1] | I_SalesDocumentItem | _SalesDocumentItem | $projection.RequirementDocumentNumber = _SalesDocumentItem.SalesDocument and $projection.RequirementDocumentItem = _SalesDocumentItem.SalesDocumentItem |
| [0..1] | I_Product | _Product | $projection.Product = _Product.Product |
| [0..1] | I_ProductGroup | _ProductGroup | $projection.ProductGroup = _ProductGroup.MaterialGroup |
| [0..1] | I_Producttype | _ProductType | $projection.ProductType = _ProductType.ProductType |
| [0..1] | I_SalesOrganization | _SalesOrg | $projection.SalesOrganization = _SalesOrg.SalesOrganization |
| [0..1] | I_DistributionChannel | _DistrChnl | $projection.DistributionChannel = _DistrChnl.DistributionChannel |
| [0..1] | I_Division | _Divn | $projection.Division = _Divn.Division |
| [0..1] | I_SalesDistrict | _SalesDist | $projection.SalesDistrict = _SalesDist.SalesDistrict |
| [0..1] | I_Plant | _Plant | $projection.Plant = _Plant.Plant |
| [0..1] | I_CompanyCode | _CompanyCode | $projection.CompanyCode = _CompanyCode.CompanyCode |
| [0..1] | I_Customer | _Customer | $projection.Customer = _Customer.Customer |
| [0..1] | I_Customer | _SoldToParty | $projection.SoldToParty = _SoldToParty.Customer |
| [0..1] | I_UnitOfMeasure | _BaseUnit | $projection.BaseUnit = _BaseUnit.UnitOfMeasure |
Annotations (16)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #PUBLIC_LOCAL_API | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| AbapCatalog.sqlViewName | IARNANLYTSRETSO | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #L | view | |
| ObjectModel.modelingPattern | #ANALYTICAL_CUBE | view | |
| Analytics.dataCategory | #CUBE | view | |
| Analytics.internalName | #LOCAL | view | |
| AbapCatalog.preserveKey | true | view | |
| Metadata.allowExtensions | true | view | |
| Metadata.ignorePropagatedAnnotations | true | view | |
| EndUserText.label | Return Sales Order | view |
Fields (60)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | RequirementDocumentNumber | SalesDocument | Sales Document | |
| KEY | RequirementDocumentItem | SalesDocumentItem | Sales Document Item | |
| SupplyScheduleLine | Schedule Line Number | |||
| AssignedSupplyType | ||||
| SupAssgmtSource | ||||
| SupplyDeliveryDate | Requested Delivery Date | |||
| ProductAvailabilityDate | Requested Delivery Date | |||
| RequestedDeliveryDate | Requested Delivery Date | |||
| TotalQuantity | Overall confirmed sales order schedule lines: quantity | |||
| OpenSupplyQuantity | ||||
| BaseUnit | I_SalesDocumentItem | BaseUnit | Base Unit of Measure | |
| Product | I_SalesDocumentItem | Material | Material Number | |
| ProductGroup | I_SalesDocumentItem | MaterialGroup | Material Group | |
| Plant | I_SalesDocumentItem | Plant | Plant (Own or External) | |
| OrderType | I_SalesDocumentItem | SalesDocumentType | Sales Document Type | |
| ProductType | I_SupDmndMaterialPlant | MaterialType | Material Type | |
| StockSegment | I_SalesDocumentItem | RequirementSegment | Requirement Segment | |
| CrossPlantConfigurableProduct | I_SupDmndMaterialPlant | CrossPlantConfigurableProduct | Cross-Plant Configurable Material | |
| SalesOrganization | _SalesDocument | SalesOrganization | Sales Organization | |
| DistributionChannel | _SalesDocument | DistributionChannel | Distribution Channel | |
| Division | _SalesDocument | OrganizationDivision | Org. Division | |
| SalesDistrict | I_SalesDocumentItem | SalesDistrict | Sales District | |
| PurchasingOrganization | Purchasing Organization | |||
| PurchasingGroup | Purchasing Group | |||
| Batch | Batch Number | |||
| StorageLocation | Storage Location | |||
| Customer | Customer Number | |||
| CompanyCode | _SalesDocument | BillingCompanyCode | Company Code to Be Billed | |
| SDDocumentReason | I_SalesDocumentItem | SDDocumentReason | Order Reason (Reason for the Business Transaction) | |
| SalesDocumentRjcnReason | I_SalesDocumentItem | SalesDocumentRjcnReason | Reason for Rejection of Sales Documents | |
| NetPriceAmount | I_SalesDocumentItem | NetPriceAmount | Net Price | |
| DocumentCurrency | I_SalesDocumentItem | TransactionCurrency | Transaction Currency | |
| NetAmount | I_SalesDocumentItem | NetAmount | Net Value of the Document Item in Document Currency | |
| RequirementSegment | I_SalesDocumentItem | RequirementSegment | Requirement Segment | |
| RequestedRqmtQtyInBaseUnit | I_SalesDocumentItem | RequestedQuantityInBaseUnit | Requested Order Quantity in Base Unit | |
| SalesOffice | Sales Office | |||
| SalesGroup | Sales Group | |||
| SoldToParty | Sold-to Party | |||
| FashionCancelDate | I_SalesDocumentItem | FashionCancelDate | Cancellation Date | |
| ProductSeasonYear | I_SalesDocumentItem | ProductSeasonYear | Season Year | |
| ProductSeason | I_SalesDocumentItem | ProductSeason | Season | |
| ProductCollection | I_SalesDocumentItem | ProductCollection | Fashion Collection | |
| ProductTheme | I_SalesDocumentItem | ProductTheme | Fashion Theme | |
| ProductCharacteristic1 | I_SalesDocumentItem | ProductCharacteristic1 | Characteristic Value 1 | |
| ProductCharacteristic2 | I_SalesDocumentItem | ProductCharacteristic2 | Characteristic Value 2 | |
| ProductCharacteristic3 | I_SalesDocumentItem | ProductCharacteristic3 | Characteristic Value 3 | |
| _SalesDocument | _SalesDocument | |||
| _SalesDocumentItem | _SalesDocumentItem | |||
| _Product | _Product | |||
| _ProductGroup | _ProductGroup | |||
| _ProductType | _ProductType | |||
| _SalesOrg | _SalesOrg | |||
| _DistrChnl | _DistrChnl | |||
| _Divn | _Divn | |||
| _SalesDist | _SalesDist | |||
| _Plant | _Plant | |||
| _CompanyCode | _CompanyCode | |||
| _Customer | _Customer | |||
| _SoldToParty | _SoldToParty | |||
| _BaseUnit | _BaseUnit |
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 I_ARunAnlytsSalesReturns.
-- 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.
CREATE VIEW I_ARunAnlytsSalesReturns AS
SELECT
SalesDocument AS RequirementDocumentNumber,
SalesDocumentItem AS RequirementDocumentItem,
cast ( '0000' as etenr) AS SupplyScheduleLine,
'R' AS AssignedSupplyType,
'R' AS SupAssgmtSource,
cast( _SalesDocument.RequestedDeliveryDate as edatu_vbak) AS SupplyDeliveryDate,
cast( _SalesDocument.RequestedDeliveryDate as edatu_vbak) AS ProductAvailabilityDate,
cast( _SalesDocument.RequestedDeliveryDate as edatu_vbak) AS RequestedDeliveryDate,
cast( SalesDocumentItem.OrderQuantity as ovr_conf_so_sl_qty ) AS TotalQuantity,
cast( SalesDocumentItem.OrderQuantity as abap.quan( 16,3 ) ) AS OpenSupplyQuantity,
SalesDocumentItem.BaseUnit AS BaseUnit,
SalesDocumentItem.Material AS Product,
SalesDocumentItem.MaterialGroup AS ProductGroup,
SalesDocumentItem.Plant AS Plant,
SalesDocumentItem.SalesDocumentType AS OrderType,
marc.MaterialType AS ProductType,
SalesDocumentItem.RequirementSegment AS StockSegment,
marc.CrossPlantConfigurableProduct AS CrossPlantConfigurableProduct,
_SalesDocument.SalesOrganization AS SalesOrganization,
_SalesDocument.DistributionChannel AS DistributionChannel,
_SalesDocument.OrganizationDivision AS Division,
SalesDocumentItem.SalesDistrict AS SalesDistrict,
cast('' as ekorg ) AS PurchasingOrganization,
cast('' as ekgrp ) AS PurchasingGroup,
cast('' as charg_d ) AS Batch,
cast('' as lgort_d ) AS StorageLocation,
cast('' as kunnr ) AS Customer,
_SalesDocument.BillingCompanyCode AS CompanyCode,
SalesDocumentItem.SDDocumentReason AS SDDocumentReason,
SalesDocumentItem.SalesDocumentRjcnReason AS SalesDocumentRjcnReason,
SalesDocumentItem.NetPriceAmount AS NetPriceAmount,
SalesDocumentItem.TransactionCurrency AS DocumentCurrency,
SalesDocumentItem.NetAmount AS NetAmount,
SalesDocumentItem.RequirementSegment AS RequirementSegment,
SalesDocumentItem.RequestedQuantityInBaseUnit AS RequestedRqmtQtyInBaseUnit,
SalesDocumentItem._SalesDocument.SalesOffice AS SalesOffice,
SalesDocumentItem._SalesDocument.SalesGroup AS SalesGroup,
SalesDocumentItem._SalesDocument.SoldToParty AS SoldToParty,
SalesDocumentItem.FashionCancelDate AS FashionCancelDate,
SalesDocumentItem.ProductSeasonYear AS ProductSeasonYear,
SalesDocumentItem.ProductSeason AS ProductSeason,
SalesDocumentItem.ProductCollection AS ProductCollection,
SalesDocumentItem.ProductTheme AS ProductTheme,
SalesDocumentItem.ProductCharacteristic1 AS ProductCharacteristic1,
SalesDocumentItem.ProductCharacteristic2 AS ProductCharacteristic2,
SalesDocumentItem.ProductCharacteristic3 AS ProductCharacteristic3
FROM I_SalesDocumentItem AS SalesDocumentItem
INNER JOIN I_SupDmndMaterialPlant AS marc ON /* join condition not captured in parsed metadata */
LEFT OUTER JOIN I_SalesDocument AS _SalesDocument ON RequirementDocumentNumber = _SalesDocument.SalesDocument -- association [0..1]
LEFT OUTER JOIN I_SalesDocumentItem AS _SalesDocumentItem ON RequirementDocumentNumber = _SalesDocumentItem.SalesDocument AND RequirementDocumentItem = _SalesDocumentItem.SalesDocumentItem -- association [0..1]
LEFT OUTER JOIN I_Product AS _Product ON Product = _Product.Product -- association [0..1]
LEFT OUTER JOIN I_ProductGroup AS _ProductGroup ON ProductGroup = _ProductGroup.MaterialGroup -- association [0..1]
LEFT OUTER JOIN I_Producttype AS _ProductType ON ProductType = _ProductType.ProductType -- association [0..1]
LEFT OUTER JOIN I_SalesOrganization AS _SalesOrg ON SalesOrganization = _SalesOrg.SalesOrganization -- association [0..1]
LEFT OUTER JOIN I_DistributionChannel AS _DistrChnl ON DistributionChannel = _DistrChnl.DistributionChannel -- association [0..1]
LEFT OUTER JOIN I_Division AS _Divn ON Division = _Divn.Division -- association [0..1]
LEFT OUTER JOIN I_SalesDistrict AS _SalesDist ON SalesDistrict = _SalesDist.SalesDistrict -- association [0..1]
LEFT OUTER JOIN I_Plant AS _Plant ON Plant = _Plant.Plant -- association [0..1]
LEFT OUTER JOIN I_CompanyCode AS _CompanyCode ON CompanyCode = _CompanyCode.CompanyCode -- association [0..1]
LEFT OUTER JOIN I_Customer AS _Customer ON Customer = _Customer.Customer -- association [0..1]
LEFT OUTER JOIN I_Customer AS _SoldToParty ON SoldToParty = _SoldToParty.Customer -- association [0..1]
LEFT OUTER JOIN I_UnitOfMeasure AS _BaseUnit ON BaseUnit = _BaseUnit.UnitOfMeasure -- association [0..1]
;
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