cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Do CDS Annotations work while querying from ABAP

0 Likes
1,247

I have a requirement of using fuzzy search for searching materials. From my research so far i was able to determine this can be done in Two Ways :

1. Using CONTAINS( param , search_string, FUZZY(0.8) ) in AMDP and calling AMDP within CDS

2. Using CDS Annotations

Q.1 What approach would be best suited to use ?

Additionally , While trying option 2 , i could see that we cannot put the search Annotation on input param so was forced to put it in field selection. This meant i needed a wrapper CDS around original CDS. Roughly the CDS along with its params looks like this. ( Yes There are whole lot of conditions needed to make this better ).

CDS with Search Annotations :

Wrapper CDS :

But when i try to call it in ABAP , i am not able to do a fuzzy search or even a regular search usign the wrapper CDS. The original CD does work but due to lack of input params brings a bug huge list 🙂

Q.2 I am new to CDS so can anyone help in what i could be doing wrong ?

View Entire Topic
dominikeiraelias
Product and Topic Expert
Product and Topic Expert

The search annotations are only evaluated by the RAP framework if the view is exposed via a service: https://help.sap.com/docs/BTP/923180ddb98240829d935862025004d6/adding-search-capabilities