0% found this document useful (0 votes)
49 views15 pages

Sap Abap-6

The document provides a comprehensive guide on modeling analytical applications using Core Data Services (CDS) views in SAP ABAP on HANA. It covers the creation and execution of analytical CDS views, specifically focusing on a sales order item cube view, and includes steps for testing and enabling standard query options in the SAP environment. Additionally, it outlines how to utilize these views in SAP Fiori and other BI tools for reporting and analysis.

Uploaded by

venkatesh ravi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views15 pages

Sap Abap-6

The document provides a comprehensive guide on modeling analytical applications using Core Data Services (CDS) views in SAP ABAP on HANA. It covers the creation and execution of analytical CDS views, specifically focusing on a sales order item cube view, and includes steps for testing and enabling standard query options in the SAP environment. Additionally, it outlines how to utilize these views in SAP Fiori and other BI tools for reporting and analysis.

Uploaded by

venkatesh ravi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

PART-1

SAP ABAP ON HANA


Modeling Analytical Applications using CDS View
Modeling Analytical Applications using CDS View

Inhaltsverzeichnis

MODELING ANALYTICAL APPLICATIONS USING CDS VIEW ................................................. 1

INTRODUCTION..................................................................................................................... 1
ANALYTICAL CDS VIEWS .......................................................................................................... 1
ESSENTIAL TYPES OF ANALYTICAL VIEWS ....................................................................................... 1
FIRST ANALYTICAL CUBE VIEW ................................................................................................... 1
EXECUTE THE CDS VIEW ......................................................................................................... 4
OUTPUT .............................................................................................................................. 5
TEST ENVIRONMENT FOR ANALYTICAL VIEWS ............................................................................... 5
STEP 1 ................................................................................................................................ 5
STEP 2 ................................................................................................................................ 6
EXECUTE THE REPORT ............................................................................................................. 7
ENABLE STANDARD QUERY OPTION ............................................................................................ 7
VIEW ANALYTICAL QUERY IN FIORI QUERY DESIGNER .................................................................. 11
GO TO FIORI LAUNCHPAD ...................................................................................................... 11
SELECT THE VIEW BROWSER .................................................................................................... 12
PROVIDE CDS VIEW NAME ..................................................................................................... 12
EXECUTE THE FIORI QUERY ..................................................................................................... 13

Introduction
Modeling analytical applications using CDS (Core Data Services) views in SAP involves
creating CDS views that are optimized for analytics and then exposing these views for
consumption in tools like SAP Fiori, SAP Analytics Cloud, or third-party BI tools.

Analytical CDS Views


Analytical CDS views are designed for reporting, aggregating, and analyzing data,
typically involving large datasets.

Essential Types of analytical views


• Cube views
• Dimension views

Prepared by [email protected] 26-Aug-24


First Analytical Cube view
Please create CDS view in Eclipse and activate it.

@AbapCatalog.sqlViewName: 'ZMAHI_SOIC01'
@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: 'Sales Order item Cube view'
@Metadata.ignorePropagatedAnnotations: true
@Analytics.dataCategory: #CUBE
@OData.publish: true
@Analytics.dataExtraction.enabled: true
define view ZMAHI_SalesOrderItemCube01 as select from I_SalesOrderItem
{
@ObjectModel.readOnly: true
SalesOrder,
_SalesOrder,
SalesOrderItem,
SalesOrderItemCategory,
SalesOrderItemType,
CreatedByUser,
CreationDate,
CreationTime,
Division,
@ObjectModel.foreignKey.association: '_Material'
Material,
Product,
Batch,
MaterialGroup,
ProductGroup,
MaterialPricingGroup,
Plant,
StorageLocation,
DeliveryGroup,
PurchaseOrderByCustomer,
PurchaseOrderByShipToParty,
CustomerPurchaseOrderDate,
@ObjectModel.foreignKey.association: '_SalesOrganization'
_SalesOrder.SalesOrganization,

Prepared by [email protected] 26-Aug-24


_SalesOrder._SalesOrganization,
@ObjectModel.foreignKey.association: '_SoldToParty'
_SalesOrder.SoldToParty,
_SalesOrder._SoldToParty,
_SalesOrder._SoldToParty.Country as SoldtoCountry,
@Aggregation.default: #SUM
@Semantics.quantity.unitOfMeasure: 'OrderQuantityUnit'
OrderQuantity,
@ObjectModel.foreignKey.association: '_OrderQuantityUnit'
@Semantics.unitOfMeasure: true
OrderQuantityUnit,
_OrderQuantityUnit,
TargetQuantity,
TargetQuantityUnit,
BaseUnit,
RequestedQuantity,
RequestedQuantityUnit,
ItemGrossWeight,
ItemNetWeight,
ItemWeightUnit,
ItemVolume,
ItemVolumeUnit,
ServicesRenderedDate,
SalesDistrict,
SalesDeal,
SalesPromotion,
RetailPromotion,
CustomerGroup,
SalesDocumentRjcnReason,
RequirementSegment,
@Aggregation.default: #SUM
@Semantics.amount.currencyCode: 'TransactionCurrency'
NetAmount,
@ObjectModel.foreignKey.association: '_TransactionCurrency'
@Semantics.currencyCode: true
TransactionCurrency,
PricingDate,
PricingReferenceMaterial,
ExchangeRateDate,
PriceDetnExchangeRate,
NetPriceAmount,
NetPriceQuantity,
NetPriceQuantityUnit,
SalesDocumentItemProcgCode,
TaxAmount,
ProductTaxClassification1,
ProductTaxClassification2,
CostAmount,
Subtotal1Amount,
Subtotal2Amount,
CustomerPriceGroup,
ShippingPoint,
ShippingType,
InventorySpecialStockType,
DeliveryPriority,
Route,
PartialDeliveryIsAllowed,
ReceivingPoint,
CustomerPaymentTerms,
PaymentMethod,
FixedValueDate,
AdditionalValueDays,
BillingDocumentDate,

Prepared by [email protected] 26-Aug-24


FiscalYear,
FiscalPeriod,
CustomerAccountAssignmentGroup,
BusinessArea,
ControllingArea,
ProfitCenter,

WBSElement,
WBSElementInternalID,
OrderID,
ContractAccount,
ReferenceSDDocument,
ReferenceSDDocumentItem,
ReferenceSDDocumentCategory,
DeliveryStatus,
_BusinessAreaText,
_CreatedByUser,
_CustomerAccountAssgmtGroup,
_CustomerGroup,
_CustomerPaymentTerms,
_CustomerPriceGroup,
_DeliveryPriority,
_DeliveryStatus,
_Division,
_ItemVolumeUnit,
_ItemWeightUnit,
_Material,
_MaterialGroup,
_MaterialPlant,
_MaterialPricingGroup,
_MaterialText,
_NetPriceQuantityUnit,
_PartialDeliveryItem,
_Partner,
_Plant,
_PrecedingProcFlowDocItem,
_PricingElement,
_Product,
_ProductGroup,
_ProductText,
_ProfitCenter,
_ReferenceSDDocument,
_ReferenceSDDocumentCategory,
_ReferenceSDDocumentItem,
_RequestedQuantityUnit,
_Route,
_SalesDeal,
_SalesDistrict,
_SalesDocumentRjcnReason,
_ScheduleLine,
_ShippingPoint,
_ShippingPointText,
_ShippingType,
_StorageLocation,
_SubsequentProcFlowDocItem,
_TargetQuantityUnit,
_TransactionCurrency,
_WBSElementBasicData,
_WBSElementBasicData_2
}

Prepared by [email protected] 26-Aug-24


Execute the CDS View

Output

Prepared by [email protected] 26-Aug-24


Test Environment for Analytical views
Step 1
Go to Se38 Report in S4HANA System

Step 2
SQL View Name ZMAHI_SOIC01

Provide ODP name: ‘ZMAHI_SOIC01’

Prepared by [email protected] 26-Aug-24


Execute the report

In the above screenshot you can find “Standard Query” option which is sometimes not
visible.

Enable Standard Query Option


Step 1
Go to Se38 Report ‘SAP_RSADMIN_MAINTAIN’ and execute the report

Prepared by [email protected] 26-Aug-24


Step 2
Provide the input ‘DFT_QUERY_CDS_SUPPORTED’

in the selection screen parameter ‘Maintain table RSADMIN’ .Then execute the report

When we execute the report first time,the settings will be adjusted to “X” for the object
DFT_QUERY_CDS_SUPPORTED. I am executing this report second time so you will see
the output as ‘INSERT failed because a record already exists’.

Prepared by [email protected] 26-Aug-24


In case any issues, please refer the below note 2745251.

Please go back to Transient Provider report for Operational Data Provider and again
execute

Prepared by [email protected] 26-Aug-24


Click ‘Standard Query’

You will see the below query monitor

Now analysis results Grouped by Material

Prepared by [email protected] 26-Aug-24


Y

Now you can see the material in the output.

View Analytical Query in Fiori Query Designer

Go to Fiori Launchpad
Transaction Code :/UI2/FLP

Select the Query Design

Prepared by [email protected] 26-Aug-24


Select the view browser

Provide CDS view Name


‘ZMAHI_SalesOrderItemCube01’

Prepared by [email protected] 26-Aug-24


execute the Fiori Query
https://00.000.000.000:0000 sap/bc/ui2/flp?sap-client=100&sap-
language=EN#AnalyticQuery-analyze?bsa_query=2CZMAHI_SO_Q09A&sap-app-origin-
hint=&/sap-iapp-state=TASASH801LZ1G0WW0HQ44DT9368QT0YZ70DYN9O39

You can design the query as per your business needs.

Prepared by [email protected] 26-Aug-24


We will work on detail scenarios in an upcoming post.

Thank you.

Prepared by [email protected] 26-Aug-24

You might also like