Date conversion directly in CDS View entity

Hello everyone,

I want to change the value of a Date field directly in my CDS View; I want to convert this value to the last day of the previous month. It seems very simple as a need but in CDS View I have trouble 🙂

I tried to use the functions dats_add_months, dats_add_days, combined with cast and substring but I always run into compilation problems, in short I can’t do it, in pure ABAP it would take a few seconds 🙂

I was suggested to possibly go through an AMDP function, what do you think?

For example if I have the value 20241015, the converted value will be 20240930, if I have the value 20240123 the converted value will be 20231231.

Thank you very much for your help.

Scroll to Top