SAP Knowledge Base Article - Public

2620429 - How to - Creating a Business Rule to Calculate Service Length Using Custom Field (custom-double) in Employment Details

Symptom

You wish to calculate a Service Length Using a Custom Field and maintain this information in the Employment Detail Information Portlet

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

Employee Central - Business Rules

SAP SuccessFactors HCM Suite

Resolution

This kind of calculation is possible with Employee Central, on instances without Employee Central such calculation will not be possible.

Step 1:

  • Go to Manage Business Configuration
  • Click on employmentInfo
  • Select Custom-double
  • Save

As seen below

1service.png

Step 2: Grant a Permission

  • Open the Permission Role for user whom you like to grant access to all jobs.
  • Click on Permission
  • Under Employee Data: Grant Permission
  • Click on Save Changes.

2service.png

Step 3:

  1. Create Rule - View in Edit Mode

3service.png

View Rule

4service.png

Step: Add Rule to Manage Business configuration or BCUI

  • Go to Manage Business Configuration
  • Click on employmentInfo
  • Select above rule
  • Save

rulee.png

View Code in Succession Data Model XML

<hris-element id="employmentInfo">

<label>Employment Details</label>

<label xml:lang="en-US">Employment Details</label>

<trigger-rule event="onView" rule="Calculate_length_in_Service"/>

Example:

  • Hire date: 24/05/2013
  • Length of service Today:19/03/2018

5service.png

PS: Do not use model rules, please use employmentInfo (Employment Details) base object.

See Also

  • 2345108 - How to - Creating a Business Rule to Calculate Age
  • 2577292 - How to calculate age on a specific event date in Online Report Designer?

Keywords

Business Rules, Calculate Service Length, Custom Field, custom-double, Employment Detail, Years of service, seniority, Age , KBA , LOD-SF-EC-EMP , Employment Information (Employment Details) , LOD-SF-PLT , Platform Foundational Capabilities , LOD-SF-EC-PER , Person Data (All Person Data Types) , LOD-SF-EC-ROD , Advanced Reporting (Employee Central ODS/ORD) , How To

Product

SAP SuccessFactors Employee Central all versions