Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Topics

• CDS Basics
• ALV IDA
• CDS Annotations
• CDS Analytical Queries
• CDS Performance Analysis
• AMDP
• CDS oData
• Suggested readings

Author - Surjit Bawa 1


ABAP CDS (Core Data Services) Basics
CDS is an extension of the ABAP Dictionary that allows you to define
semantically rich data models in the database and to use these data
models in your ABAP programs. CDS is a central part of enabling code
push-down in ABAP applications.

Use Eclipse to build ABAP CDS

Author - Surji t Bawa 2


ABAP CDS (Core Data Services) Basics - Structure

SQL View
name, can be
viewed in
SE11

CDS
Annotations

Check and
CDS Exposed
Activate
fields

Author - Surji t Bawa 3


ABAP CDS (Core Data Services) Basics – Data View

Author - Surji t Bawa 4


SAP List Viewer with Integrated Data Access (ALV with IDA).
cl_salv_gui_table_ida=>create_for_cds_view(`ZCD
_P_SALES_ORDER`)->fullscreen( )->display( ).

Author - Surji t Bawa 5


SAP CDS Annotations
A CDS annotation uses metadata to enrich CDS objects.

Annotations Use example

@Semantics Semantic annotations are used to inform the client as to which of the elements contain @Semantics.currencyCode: true
a Currency key, Unit of Measure, etc waerk,
@Semantics.amount.currencyCode: 'WAERK'
netwr
@Environment Are used in CDS views to associate input parameters with ABAP system fields define view demo_cds_system_fields
with parameters
@Environment.systemField : #CLIENT
p_mandt : syst_mandt
@Consumption Define a specific behavior that relates to the consumption of CDS content through @Consumption.defaultValue
domain-specific frameworks, used to set default values, derive values from other CDS

@DefaultAggregation Specifies aggregation behavior on element level @DefaultAggregation: #SUM

@Analytics Enable the analytic manager for multidimensional data consumption @Analytics.dataCategory: #CUBE
@Analytics.query: true

Reference - https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/63/0ce9b386b84e80bfade96779fbaeec/frameset.htm

Author - Surji t Bawa 6


SAP CDS Analytical Query
• A CDS Analytical queries are used to use embedded analytics
capabilities of SAP S/4 HANA.
• Analytical queries can be used in SAC, BO, etc
• In ABAP you can test queries using transaction RSRT.

• Use Annotations to define Measures and Attributes

• Measures with @DefaultAggregation: #SUM

• Use @AnalyticsDetails.query.axis: #COLUMNS to


define default Axis

• @Analytics.query:true sets the current CDS as Query

• Query must consume a Cube

Author - Surji t Bawa 7


SAP CDS Analytical Query

Author - Surji t Bawa 8


SAP CDS Performance Analysis
• Use ST12 to enable Trace and download PLV file

• Use HANA PlanVIZ to check the performance of


the CDS

Author - Surji t Bawa 9


SAP CDS Performance Analysis

Author - Surji t Bawa 10


SAP AMDP
• Create a class with interface
IF_AMDP_MARKER_HDB

• Implement method with displayed keywords

• Consume AMDP in table function

Author - Surji t Bawa 11


SAP CDS oData
• Use Annotations @OData.publish: true to create oData service from CDS
• Use Transaction /IWFND/MAINT_SERVICE to activate Service
• Use Gateway service to test service
• Use Fiori template to consume and build List report app using CDS oData

Author - Surji t Bawa 12


SAP CDS – Suggested reading

• Association
• Extension
• Performance tuning – using hints, Association
• AMDP debugging
• Keywords and Functions - Case, Cast, Div etc
• Currency and Unit conversions
• Hierarchies
• CDS Roles

Author - Surji t Bawa 13

You might also like