2025 Mar 05 1:08 PM - edited 2025 Mar 07 1:39 PM
Hello,
I am using CDS to extract material classification data, transpose it to columns and expose to odata. It went well untill I discoverend that we have negative decimal values in the classification fields. Those values get zeroed in the cds conversion.
I created 2 cds views.
1 cds. Selects material classification data.
Select OBJEK, ATFLV from AUSP
2 cds. Transposes classification row data to columns using function MAX to get only one value.
max ( case cl_name when 'TOTAL' then
case when alt_value <> 0 then alt_value else 0
end else 0
end ) as total.
I used CDS function MAX to return decimals but it does not convert NEGATIVE floating quantity fields AUSP-ATFLV = -0,0018 (-1.8000000000000000E-03).
MAX returns 0 if the value is negative. I am on version NW 7.5 but even the newer FLTP_TO_DEC cannot use negative literal.
Function AVG returns floating type values but I do not need average calculation.
Can anyone help to find a solution?
Regards,
Egle
P.S. I found a solution by my self. Mark a new field when fltp value is negativ. Convert negativ to positiv befor aggregation MAX. Convert to negativ value in a following CDS after a CDS with MAX.
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do you understand what max do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 5 | |
| 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.