Symptom
An API user with only "View Current" permission for Compensation Information (no "View History") is able to retrieve all historical records of EmpPayCompRecurring through the Employee Central OData API when fromDate and toDate parameters are specified in the query.
The same user does not see compensation history in the Employee Profile (UI), and the API correctly returns only the current record when asOfDate is used or when no date parameters are specified.
Environment
SAP SuccessFactors Odata API
Reproducing the Issue
Prerequisites:
- An API user with a permission role containing:
- Employee Central Effective Dated Entities > Compensation Information > Compensation Info Actions → View Current only (no View History)
- Employee Data > Pay Components → View for the relevant pay component(s)
- No Administrator Permissions assigned (no "Manage Integration Tools", no "Employee Central API" such as "Employee Central HRIS OData API (read-only)" or "(editable)")
- Authentication configured (e.g. OAuth2 Bearer token or Basic Authentication with "Allow Admin to Access OData API through Basic Authentication")
Steps:
-
Query EmpPayCompRecurring using fromDate and toDate parameters:
GET /odata/v2/EmpPayCompRecurring?fromDate=1900-01-01&toDate=2999-12-31&$filter=userId eq '<userId>'&$format=json&$select=payComponent,paycompvalueResult: All historical records within the date range are returned.
-
Query the same entity using asOfDate:
GET /odata/v2/EmpPayCompRecurring?asOfDate=<today>&$filter=userId eq '<userId>'&$format=json&$select=payComponent,paycompvalueResult: Only the current effective-dated record is returned.
-
Query the same entity without any date parameter:
GET /odata/v2/EmpPayCompRecurring?$filter=userId eq '<userId>'&$format=json&$select=payComponent,paycompvalueResult: Only the current effective-dated record is returned.
Cause
This is the expected behavior of the Employee Central OData API.
The "View Current" permission grants the API user access to query EmpPayCompRecurring records. When fromDate and toDate parameters are explicitly used, the OData API returns all effective-dated records within the specified date range, irrespective of "View Current".
The "View Current" permission controls the default query behavior (when no date parameters or asOfDate is used) and the visibility in the Employee Profile (UI), but does not restrict date-range queries using fromDate/toDate.
As confirmed by the EC OData API development team: querying only respects the "View Current" permission as an access grant. With this permission, OData can query all history and future records when a date range is explicitly specified.
Resolution
To retrieve only the current record without exposing compensation history, use one of the following approaches:
Option 1 — Use asOfDate with the desired date:
GET /odata/v2/EmpPayCompRecurring?asOfDate=<date>&$filter=userId eq '<userId>'&$format=json&$select=payComponent,paycompvalue
Option 2 — Omit all date parameters from the query:
GET /odata/v2/EmpPayCompRecurring?$filter=userId eq '<userId>'&$format=json&$select=payComponent,paycompvalue
Both options return only the current effective-dated record, consistent with the "View Current" permission behavior.
Option 3 — If fromDate/toDate must be used for other integration purposes, filter the results in the consuming system to keep only the record with the latest effective date (startDate) per user.
Additional note: Ensure all date parameters are correctly spelled (e.g. fromDate, not ftomDate). The system ignores unrecognized parameters. If fromDate is misspelled but toDate is present, the API processes the request with only toDate and may return all records up to that date.
See Also
2732680 - USER x ADMIN permission modes - SuccessFactors OData API Permissions
2639949 - OData API is not respecting the Role Based Permission Settings
2316798 - How to restrict API access to specific Employee Central Entities and Fields
Keywords
EmpPayCompRecurring, EmpPayCompRecurring history, restrict compensation history API, fromDate, toDate, asOfDate, view current, view history, RBP, compensation information, permission, effective-dated, API returns history, base salary, pay component , KBA , LOD-SF-INT , Integrations , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT-ODATA , OData API Framework , Problem
SAP Knowledge Base Article - Public