Human Capital Management Blogs by Members
Gain valuable knowledge and tips on SAP SuccessFactors HCM suite and human capital management market from member blog posts. Share your insights with a post of your own.
cancel
Showing results for 
Search instead for 
Did you mean: 
EC8
Participant
4,509
Hi All,

This is my first blog on SAP. Hope this will find useful & effective in your SuccessFactors Employee Central implementation/support projects.

Introduction:

I will explain you how to create TimeIn Calculation (number of years/ months/days format) for custom fields in Job Information.

Assume EC Consultants are aware of what is TimeIn Calculation, transient value and how to initializing New Entry Date Fields. If you are not aware, please refer below links for more details on this topic:

Problem:

As you all are aware that to calculate or filled standard transient field (time in job, time in position etc.)  a job in provisioning system need to schedule. But with custom field (mentioned below) there are no such provision in SuccessFactors. I will explain in this blog, how to overcome this issue when customer needs such calculations. Let's discuss first what kind of requirements will be and what will be the solution:

Requirement: Customer wants you to create below 2 new fields on Job Information:

  1. Grade Entry Date- Grade Entry Date will be filled automatically when Pay Grade on Job Information is changed or created.

  2. Time in Grade- This field should be calculated and filled in the History UI, Employment Info page and Manager Self Service (MSS) based on Grade Entry Date, in Years/Months,/Days format.


Conclusion:

Let’s discuss on solution for above requirements. As per my experience above requirement can be resolved by creating a complex business rule on Configure Business Rule screen. I will explain you what kind of business rule need to configure for this specific custom transient field.

Grade Entry Date:

  1. First create a custom field on Job Information with Data Type: DATE:

  2. Update RBP (as per customer requirement). Let’s provide VIEW permission to everyone as I want this field to be filled automatically based on business rule.

  3. Create a business rule to fill Grade Entry Date. I need to fill Grade Entry Date on History UI, Employment Info page and Manager Self Service (MSS) based on Pay Grade:


 

- Create a new business rule, name it “SET_JobInfo_GradeEntryDate

- We will use Job Information Model as a base object for this business rule




  • Rule Statements:



  1. If Pay Grade value Is not be equal to Null AND Pay Grade Value Is Not Equal to Pay Grade Previous Value, Then Grade Entry Date field will be equal to Event Date

  2. Else If Pay Grade value Is not equal to Null AND Pay Grade Value Is Equal to Pay Grade Previous Value, Then Grade Entry Date field will be equal to Grade Entry Previous Value



 

Once above rule is configured, then go to "Manage Business Configuration" and Assign Business Rule "SET_JobInfo_GradeEntryDate" on Object "Job Information" on Field "Pay Grade":


Time In Grade

  1. First create a custom field on Job Information with Data Type: STRING & Visibility=View.


 





  1. Update RBP (as per customer requirement). Let’s provide VIEW permission to Super User, Manager, Employee & HR. As value on this field should be filled automatically when Grade Entry Date will be created/updated.

  2. Create a business rule to fill Time In Grade:


 

I need to fill Time In Grade on History UI, Employment Info page and Manager Self Service (MSS) based on Grade Entry Date:

 

- Create a new business rule, name it “CALC_JobInfo_TimeInGrade

- We will use Job Information Model as a base object for this business rule


-  Rule Statements: As I need to fill this field as per Grade Entry Date and in “Years Months Days” format.

Let’s take an example to understand this scenario- Pay Grade of an Employee is changed on 16th Feb 2018. So Grade Entry Date will be 16 Feb 2018 and Time in Grade will be 2 Years 4 Months 23 Days. Today’s date is 11 July 2020.

Now let’s look at business rule:

As I need to fill Time in Grade in “Years-Months-Days” format. Function we will be using is Format() to format the string using template. The template is defined as %s %s %s %s %s %s. This is 6 string values. (%s – a string).

First I need to get value for “Years” and we need to round down number of years. In our scenario, it should be 2 Years (From 16 Feb 2018 to 11 July 2020). I will use below Functions:

Argument: Format Number()

Template= %d

Number= Difference in Years Round Down() from Grade Entry Date till today’s date.

Argument= Years. So Years as a text will be populated on field. So result will be 2 Years:


Then I need to get value for “Months” and Number of Months Round down. In our scenario, it should be 4 Months (From 16 Feb 2018 to 11 July 2020).

  • First Value: I will calculate total number of months from Grade Entry Date till today’s date and divide it by 12 so result will be 28/12= 2.33

  • Second Value= Difference in Years Round Down() that will be 2.

  • Then I will use Minus function. First Value (2.33) Minus Second Value (2) and Multiply it with 12 (0.33 x 12= 3.96) so result will be 4 Months.



 

 

Then I need to get value for “Days”. In our scenario, it should be 23 Days (From 16 Feb 2018 to 11 July 2020). Function is Number= Round().

  • First I need to get First Value= Total Number of Calendar Days from Grade Entry Date to today’s Date (874 days).

  • Then I will calculate Second Value where we will get Total Number of Months from Grade Entry Date till today’s days and convert that value into Days by multiplying with 30.500 (I have used factors= 30.500 as we have different calendar days like 30, 31, 28, 29 so there might be difference in number of Days)

  • Last I need to use Minus function (First Value- Second Value) so Result will be 23 Days



You can refer below complete business rule:


Once above rule is configured, then go to "Manage Business Configuration" and Assign Business Rule “CALC_JobInfo_TimeInGrade" on Object "Job Information" with OnView Event Type:

 


As I have already placed above rules in its respective location. Now let’s check our result:

Go to Employee Profile and check the result on Job Information portlet-

Please review the high lighted fields for the correct result (Today's Date; Jul 11, 2020):

Effective as of: Feb 16, 2019

Grade Entry Date: Feb 16, 2019

Time in Grade: 2 Years 4 Months 23 Days


 

Please share your feedback and comments below.

Thanks,

Utkarsh
4 Comments
Labels in this area