on 10-30-2014 1:28 PM
Dear Friends,
I need to calculate total years of service for an employee at bex level. I have 0entrydate( hire date) as attribute under 0employee.
Total Yrs in service = (0entrydate - sy-datum ) / 365.
in columns i hav creatd Formula1.. but im stuck. pls tell me step by step
Thanks
vasu
HI Vikram,
1) Create formula variable with processing type as "Replacement Path" and take 0entrydate as reference characteristic for that variable.
2) Create new formula and subtract (0entrydate-Sy-datum)/365.
Regards,
PRK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vasu,
Just an addition for Praveen's suggestion. While creating the formula variable make sure that you have chosen infoobject with key value and select "date" as dimension from currency/unit type tab. And create another formula variable with customer exit. In the exit set the variable as sy-datum.
Then you can add a formula such as:
NODIM(variable_1 - variable_2) / 365
to find the total years.
Besides that if you are using a standart infoprovider 0PA_C01 it has a keyfigure 0SRVCLENKYF that directly shows the period of work in years.
hope it helps
Regards
Yasemin..
Dear All,
I thank you every one for your valuable input and time. Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Friends,
Thankyou all for the input. Its working fine. I have 2 issues now..
1. ( sy-datum - Date1) / 365 = 29.8737654 -how to round off this value to 29
2. If my date1 is blank how to handle...
Thanks
Vasu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vasu,
1. ( sy-datum - Date1) / 365 = 29.8737654 -how to round off this value to 29
For this check any functions under mathematical header in BEx
2. If my date1 is blank how to handle...
For this use
1 Create new formula(FDATE) and use formula like COUNT(Date1)
2 Now FDATE returns 1 or 0, (1 Means there is date in Date1, if not returns 0.
3 Create New formula IF FDATE = 1 then only perform your logic.
Regards,
Nanda
Hi Vijay,
For your question 1, refer to Nanda's answer above..I think there is a formula like ROUNDUP or ROUNDDOWN or CEIL or FLOOR..
For question 2, in the formula you have created, just revise it with this equation:
(DATE1 > 0) * ( (sy-datum - date1) / 365 ) + 0
OR
(DATE1 = 0) * 0 + ( (sy-datum - date1) / 365 )
Just choose between the two (2)..That formula will give you ZERO value if date1 is empty..
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.