Skip to Content
-1
May 25, 2023 at 07:20 AM

Sap fiori case error

155 Views

HI,guys, i've got a problem with case statement in my cds view.
I try to delete decimal part, but only if it's eqals to 0.
field1 here's intitializes with floor(Menge).


Here's my code. (It's work, values with decimal part which eqals 0 get floor(Menge) value,values with decimal part NOT equals 0, get 0 value. But when i tru to replace "else 0", with "else Menge" all values get Menge value. Why
it's works like this. And what i need to do to remove decimal part if it eqals to 0. So first img is with "else 0",second
with "else Menge".

1.jpg

2.jpg


        case 
         when field1 = Menge   then floor(Menge)
          else 0
        end as field2

Attachments

1.jpg (56.1 kB)
2.jpg (72.8 kB)