cancel
Showing results for 
Search instead for 
Did you mean: 

User key date (-) posting date difference in SAP HANA

Former Member
0 Kudos

Hi Experts,

Greetings for the day...!!

I am new to HANA studio and working on a assignment in my project.

My requirement is to find the difference between the "user keyed date" & "posting date(BUDAT)".

We have function to find the difference between 2 dates.  But, in my case one of the date is user entry(can be any user date choice) and is not available in my calculated columns to find the difference.

I am working on graphical calculation view.

Any inputs on how to achieve my requirement.

Looking forward your valuable inputs.


Regards,

Ragha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks a lot for the quick responses.

I have created a user parameter with type: DATE and applied below function.  But, i was getting type error.  I further checked with BUDAT type and it is NVARCHAR:8.

So, I corrected userkeyparameter type to NVARCHAR:8.

But, still i am getting below error.  Can you let me know if I am missing anything here.

pfefferf
Active Contributor
0 Kudos

Change the type of your input parameter back to "date" and convert the "BUDAT" value using the "date" function to a date.

E.g.

daysbetween('$$KEY_DATE$$', date("BUDAT"))

Answers (4)

Answers (4)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Florian/All,

Unfortunately it is also giving the error.

daysbetween('$$KEY_DATE$$', date("BUDAT"))


Below is input parameter property screen.

Any detailed comments on this please...

pfefferf
Active Contributor
0 Kudos

Hi,

you are pressing the "Validate Syntax" button in the expression editor? Ignore that wrong error. Please test the view, it will work.

Regards,

Florian

former_member208449
Active Participant
0 Kudos

Hi,

Yes, it works Florian. Even though validation fails, it is working.

Rag,

Please try the same.

pfefferf
Active Contributor
0 Kudos

Yes, I tried it to (otherwise I would not suggest it to do so ). There are some constellations in which the syntax validation check reports errors which are no errors.

Former Member
0 Kudos

Hi Florian,

Yes, it is working for me too.  

It solved my one issue.

Another issue ,  i need to find the oldest BUDAT for each PO and it can repeat the same BUDAT(i.e. oldest date compared to all the PO dates)  for that entire PO rows.

Again this to be done in graphical only.

any expert comments on this Florian.

Thanks is advance.

pfefferf
Active Contributor
0 Kudos

Hello Ragha,

is it an option for you to pass your "user key date" as input parameter to the graphical calculation view? With that you are able to use the available date functions, like "daysbetween" to calculate a difference. The function of course dependends on that what difference you wanna calculate.

Regards,

Florian

former_member208449
Active Participant
0 Kudos

Hello

You can create an input parameter and use it in the calculated column expression editor to find the difference.