SAP Knowledge Base Article - Public

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


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.


Employee Central - Business Rules

SAP SuccessFactors HCM Suite


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


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.


Step 3:

  1. Create Rule - View in Edit Mode


View Rule


Step: Add Rule to Manage Business configuration or BCUI

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


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"/>


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


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?


Business Rules, Calculate Service Length, Custom Field, custom-double, Employment Detail, Years of service, seniority, Age , KBA , LOD-SF-EC-EMP , Employment Information (Employment & Termination 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


SAP SuccessFactors HCM Core 1711