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.
cds is for modeling entity relationship, not for sql stuff.
why you need that parameter? expect performance improvement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in this particular case , its to select Materials but keying in their ranges rather than exact Material number . Additionally we will be putting in search by Material text , Vendor Number etc functionalities but have excluded other details intentionally to make the question concise.
Also , we are currently on NW 7.4 so do not have option to expose directly as OData. So this select will eventually feed a odata service (using SADL model or using OpenSQL query inside appropriate methods ).
| 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.