on 2015 Sep 08 12:42 PM
Hey Experts,
i'm developing a CDS-View in ABAP for HANA and i need a CASE-Statement with an arithmetic expression in it.
Error on above image is unexpected word "(".
I have also tried a few other ways like casting or subtracting in a between clause but nothing works.
Looking forward to your answers.
Simon
Request clarification before answering.
Hi Simon,
please find the restrictions in CDS CASE expressions in ABAP Keyword Documentation.
So, I think you'll have to use a workaround like a view-on-view, wherein the underlying view calculates the field you'd like to use as right hand side (rhs) of the conditional expression.
Cheers,
Jasmin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
case
when fkimg > 10
then 'dummy'
when netwr between 10 and 100
then 'dummy'
else
'fit'
end as invoiceuse ,
i have used this above code to build cds view it dnt throwed any error
and when you want to compare same field then try like,
case fkimg
when 0
then 'bad'
when 10
then 'good'
else
'better'
endcase as result.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 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.