cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

INT4 from CDS not allowing negative numbers in Frontend

Alvaro_AH
Explorer
0 Likes
2,217

We've created a CDS that is being exposed throw oData (@OData.publish: true) as an analytical query for a Fiori Analytical application.

One of the fields exposed is an INT4 data type value as it is the result of the DATS_DAYS_BETWEEN built-in function.

However, when running the Analytical App and adding this field to the results, we are having a frontend error stating "Negative values not allowed for integer fields"

Same happened when running the query on RSRT

Have you ever faced this issue? As a workaround I'm thinking on using some sort of casting on the INT4 returned by the function, but turning this into a decimal does not sounds as the best solution.

Any ideas?

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

Alvaro_AH
Explorer
0 Likes

As a workaround, I've been able to cast to a CHAR datatype, as the field is going to be used as a dimension, not a measurement, and it is working fine in that way.

Only issue is on sorting, as data will be sorted by a CHAR basis, not a numeric. But at least its something.

Answers (1)

Answers (1)

SOeynha
Discoverer
0 Likes

I also faced the same problem. I did a cast to quan. That did the trick for me:

cast (DATS_DAYS_BETWEEN( coalesce( Versand.CreationDate, SDIA.CreationDate ), SDIA.CreationDate) as abap.quan(10, 0 ) )