on ‎2023 Jan 18 9:36 PM
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 ?
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.