SAP Knowledge Base Article - Public

2480932 - "Years Of Service" field is fetching incorrect data in Realms Query and Ad Hoc Report


  • "Years Of Service" field is fetching incorrect data in Realms Query
  • "Years Of Service" field is fetching incorrect data in Ad Hoc Report

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


  • Advance Reporting
  • Ad Hoc Report

Reproducing the Issue

Advance Reporting:

  • Home > Analytics > Analytics > Advance Reporting
  • Select "Employee ID" from Global Job Information table
  • Select "Years Of Service" field from Employment Details Table
  • Put a filter on Employee ID - 1234

Advance Report.png

In the Employment details Portlet, Years Of Service field holds value = 5 for the User - 1234

Data in Instance.png

In Advance Reporting this field displays value as 4 for this user.
Expected Result set - Years of Service field display as 5 for user - 1234 in Advance Reporting.

Ad hoc Reporting:

  • Create Ad Hoc Report of "Person and Employment (Info As Of Date)"
  • Select "Employment Detail Years of Service" and Employee ID columns
  • Filter On Employee ID - 1234
  • In Ad Hoc Report "Years of Service" field is fetching value as 4 for user - 1234.

Ad Hoc Report.png


"Years Of Service" field is configured in employmentInfo. This is Custom Field. It can be checked from Admin Center > Manage Business Configuration > EmploymentInfo.

Field Configuration.png

EC Business Rule is configured to calculate the data. This business rule is configured as "On-View" not as "On-Save". Due to Business Rule "OnView" configuration, correct data is not getting fetched in report.

Business Rule - On View.png


Modifying the rule in Employee Central:
If you would like to have the same value shown in the report and in the employment info, you need to configure the rule as an "OnSave" rule.
Otherwise the value can differ, because the "OnView" rule shows another value than written on the database.
Assistance regarding changing the Business Configuration Rule will be taken care by Employee Central Team (LOD-SF-EC).


Create a calculated column in Advanced Reporting:
2515212 - How to get "number of years" an employee is working in the organization in ORD or Advance Reporting?

2707073 - ORD / Report Canvas - Calculate Age / Service Period in Days / Months / Years


  • Years of Service
  • YearsOfService
  • Service In Years
  • Ad Hoc 
  • Realms
  • Advance Reporting
  • Business Rule
  • OnView
  • OnSave
, KBA , LOD-SF-ANA-ODS , Advanced Reporting , LOD-SF-ANA-ADH , Adhoc Reports & Report Builder , Problem


SAP SuccessFactors HCM Core all versions