Skip to Content
Jul 05, 2019 at 03:06 PM

The function "DATS_DAYS_BETWEEN" is unknown

547 Views Last edit Jul 05, 2019 at 03:07 PM 4 rev

Hi All,

I am trying to use the built-in function DATS_DAYS_BETWEEN in one of my SELECT query in ABAP(SE38 transaction). I know that this will work in Eclipse/Hana studio. But will this work in ABAP program also?

When I press Alt+Tab next to SELECT, the system suggests the list of built-in functions and the DATS_* functions also. I select DATS_DAYS_BETWEEN and It gives the error 'The function "DATS_DAYS_BETWEEN" is unknown' when activating the program. It accepts any other functions, but not DATS_* functions.

Date Functions and Time Functions - This link says that the above date function should work in both ABAP CDS and also Open SQL.

Please let me know how to achieve this date function in SE38 itself.

A sample code snippet:

SELECT SINGLE dats_days_between( vfdat, sy-datlo ) AS days_between 
              FROM lqua
              INTO @DATA(result).