Skip to Content
0
Jan 18, 2023 at 09:36 PM

Do CDS Annotations work while querying from ABAP

112 Views

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 :

image.png

Wrapper CDS :

image.png

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 :)

image.png

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

Attachments

image.png (33.9 kB)
image.png (20.2 kB)
image.png (8.2 kB)