Monday 6 June 2016

How to get abap date in HANA calculated column and calculate date difference

I had a requirement to find the date difference from the field LETZTZUG of table s032 and the current date.
Here the problem was getting the current date. I got the current date using now() function in calculated column functions.
The output of the now() was in yyyy-mm-dd hrs and second. I used date(now()) and got it as yyyy-mm-dd.
With this I was still not able to use daysbetween in order to find the duedate betwen LETZTZUG  and currentdate.
Then I used replace() function to eliminate '-' from the yyyy-mm-dd. So after that I could calculate the daysbetween().
 This will overcome the problem of not having to_dats in calculated column.

How to get abap date in HANA calculated column and calculate date difference

How to get abap date in HANA calculated column and calculate date difference

How to get abap date in HANA calculated column and calculate date difference

And we have the netdue date here.

How to get abap date in HANA calculated column and calculate date difference

Source: scn.sap.com

No comments:

Post a Comment