cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch the difference between 2 months in HRS function

Former Member
0 Kudos

Hi all

Could you please let me know how to fetch the difference between 2 months.

For example, employee is reactive from 20th May. This has to be compared with the current Time evaluation period. If I am executing Time evaluation in May, the difference should be zero months. This is neeeded for me...

I am trying with HRS=YDEOXX. But it is not working properly.

Please let me know where I am wrong.

Regards

Hari

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member182377
Active Contributor
0 Kudos

Hi Hari L,

If your query is answered you can close the thread by marking correct and helpful answers which would be by benefited by others.

Thanks

Sriram

Sanky
Active Contributor
0 Kudos

Hi Hari,

Check the below link which could be helped you regarding your query if comparison of two dates.

http://scn.sap.com/docs/DOC-59283

I think you would like to compare between Inactive date to active date duration. Am I correct? if it's so then you have to store the information in IT41 and above link will give you an idea how to compare this two dates.

But my question when it should be calculate and another thing could not understand your sentence that "if I am executing time evaluation on May, then difference should be zero"-- Please elaborate more with example.

Regards,

Sankarsan

former_member182377
Active Contributor
0 Kudos

Hi Hari.

What is suggest you is have date  in IT41 and maintain re-active date there for example 01.01.2015,

for example if the time evaluation date is 20.01.2015,

you can use operation HRS=YDAA03, assume 03 would be your date type..

so the answer is 20 .

Thanks

SRiram

former_member182377
Active Contributor
0 Kudos

Hi Hari,

You need to maintain the date type in IT41 if you want to find the difference between two dates,

HRS=YDAAXX - where XX is your date type , for example.

M2 is the service date which i have stored in infotype 41 as 01.01.2010 and i am running time evaluation on 01.01.2015,

i have written PCR like this

HRS=YDAAM2

answer come as 1826 days including leap year which is 365*4+366 results come in positive,,

Hope you understand now..

Thanks

Sriram

former_member182377
Active Contributor
0 Kudos

Hi Hari,

If the date you have maintained in IT41 is lower than the time evaluation running date.. then results would be positive i mean comes with + sign.

If date type in 41 is higher than the time evaluation running date , then results would be negative comes with - sign..

Hope you got the clarity

Thanks

Sriram

venkateshorusu
Active Contributor
0 Kudos

Have you maintained date type XX in IT0041, If not maintain it and then check.

Regards

Venkatesh