Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Pavan_Golesar
Active Participant
Hi All,


SAP CDS HINTS



Introduction








Hints can be used to influence preparation, optimization, and execution of SQL statements. Hint can be modeled on view level using annotations, While working with CDS hints we learned few things.


Problem Statement


Following blog Optimize CDS views using dbHints annotation | SAP Blogs we ran into a scenario as below:

CDS Hint annotation:

@AbapCatalog.dbHints: [{dbSystem: #HDB, hint: ‘<hint_name>’}] .“→ which is now deprecated annotation
SELECT *
FROM Z<CDS View>
WITH HINT ( USE_ESX_PLAN )

We faced below error by after calling the CDS in abap statement:

                                        SAP CDS HINTS GRAMMAR ERROR


 


Solution


Hence we have to use the up-to-date annotation as below:
@Consumption.dbHints: ['HINT1', 'HINT2'] ."→ up-to-date annotation

example as shown below:


CDS hints annotation (old and new)


Further calling the above sample CDS into ABAP code as below for successful usage, and found significant performance increase in testing environment.
SELECT * FROM zckub %_HINTS HDB 'USE_OLAP_PLAN' INTO TABLE @DATA(lt_tab).



Conclusion


This is example on how to use and apply CDS dbHints into existing SAP ABAP program.

My Other Blogs:



  1. Exploring SAP BTP ABAP Environment - Step by Step blog for SAP BTP ABAP Environment (including Eclipse and ABAP instance setup). Its awesome blog with 5 YT series

  2. SAP BTP ABAP Environment and ADT Troubleshooting Guide | SAP Blogs - SAP BTP ABAP Environment and ADT Troubleshooting Guide



Share & Connect


Useful? like and share on social media.
Connect with me on :

Thank you,

Pavan Golesar
3 Comments
Labels in this area