ABAP CDS view how to use CASE and SUM together

Viewed 43

I have a scenario where I have to use CASE and SUM in an CDS VIEW SQL statement and I cannot add net_val to the group by statement. Is there a way to use CASE and SUM together

case when sum( net_val ) < 0 then 'DEBIT' 
     when sum( net_val ) > 0 then 'CREDIT'
end as DEBIT_CREDIT_STATUS
0 Answers
Related