I have the below CDS view. I need to do 1 more thing that the business has requested. Column Name1 has value 'STARBUCKS' in the db table and when user tries to search with 'Starbucks' it does not return anything. Is there a syntax that I can use to make it case insensitive, so it returns values if we just spell it right and not just when we enter it in Upper cases.
define view ZCDSV_XXX_XXXX
as select from epkuatv as a
inner join epku_adr1cp as b
on a.epkunnr = b.epkunnr
{
key a.epkunnr as EUNumber,
b.name1 as EndUserName1,
b.name2 as EndUserName2,
b.street as Address,
b.str_suppl1 as AddressStreet2,
b.city1 as City,
b.region as State Province,
b.post_code1 as Postal Code,
cast(max( case a.atinn when '0000001361' then atwrt end ) as
abap.char(4)) as End User Group,
max( case a.atinn when '0000001361' then atinn end ) as
EUGRPCHAR,
cast(max( case a.atinn when '0000009763' then atwrt
when '0000009639' then atwrt end ) as abap.char(4)) as
EndUserParGroup,
max( case a.atinn when '0000009763' then atinn
when '0000009639' then atinn end ) as EUPARGRPCHAR
}
group by
If you are on 7.51 or higher, you can use the sql command like VXLozano suggested.
Just create a new column in you cds and search on it or use the command in your query.
If you are on 7.50 or lower, you can achive it with a bit of a workaround.
First you need to create a domain with the same length as you current column and make you that lower case characters aren't allowed.
Afterwards you can create a datalement based on the domain.
Now you can cast your column to the new datalement.
cast( b.name1 as ZSD_NAME1_UPPER ) as EndUserName1_UPPER
The new column now contains all names in upper case.
To use this in a search you also need to convert your userinput in upper case.
There are some ways to achive this like the translate command or string template.
Hope it helps!