Skip to Content
0
Jan 22, 2019 at 02:47 PM

CDS View- CASE WHEN limitation

329 Views

Hi,

I have a requirement to run DATS_DAYS_BETWEEN function only if right parameter date is non blank. However CASE statement doesn't allow me to use function in WHEN statement. We want to keep such records so filtering them beforehand may not help.

CASE

WHEN AR.bldat ='00000000'

THEN '00000000'

ELSE cast(dats_days_between(cast(today_date as abap.dats), AR.bldat) as abap.dec(5,0))

END as days

Kindly assist.

Thank you.

Viren