Professional Documents
Culture Documents
Employee API
Document History
Version No. Date Revision Description
0.1 18-Oct-2021 Draft
0.2 25-Oct-2021 Review
1.0 27-Oct-2021 Final version
Hareesha Tanisetty
Contents
1. Introduction ...................................................................................................................................... 2
2. Overview ........................................................................................................................................... 2
a. What is the need of Compound Employee API? ............................................................................... 2
b. When to use Compound Employee API? .......................................................................................... 2
c. Using the Compound Employee API: ................................................................................................ 3
d. List of SAP SuccessFactors API Servers for SAP SF data centers ..................................................... 9
3. Modes in Compound Employee API ................................................................................................. 9
4. Fetch data from SFEC using Compound Employee from SAP CPI ................................................... 11
5. Scenarios using Delta Mode ........................................................................................................... 14
6. Scenarios using Snapshot Mode ..................................................................................................... 20
7. Additional Scenarios ....................................................................................................................... 26
8. Negative Test Cases ........................................................................................................................ 29
9. Limitations....................................................................................................................................... 30
10. Conclusion ................................................................................................................................... 30
11. References .................................................................................................................................. 31
The purpose of this document is to explain the usage of SFEC Compound Employee API.
Compound Employee Application Programming Interface (API) for SAP SuccessFactors Employee Central
is used to extract employee data out of Employee Central. Compound Employee API is based on the Simple
Object Access Protocol (SOAP). It replicates employee master data from Employee Central to SAP systems,
payroll systems, and benefits systems.
Currently SuccessFactors supports SFAPI (Compound Employee) and OData APIs for integration.
Compound Employee will be used when building Integrations around Employee Master data and for rest
of the scenarios, can leverage OData APIs.
2. Overview
Compound Employee API is commonly used to synchronize employee master data between Employee
Central and other on-demand or on-premises applications. It returns data about new employees and
about changes of employee data. Replication of employee master data by calling the Compound
Employee API happens synchronously, which means that the response is immediately returned.
Therefore, a regular replication of HR data to the third-party systems must be ensured. For this
purpose, replication processes call the Compound Employee API, a SOAP-based web service
inside Employee Central, to retrieve employee master data out of Employee Central.
• Query and QueryMore: A typical retrieval sequence consists of a login call, a CompoundEmployee API
call, and a number of subsequent queryMore API calls.
The API query call specifies the entities to be returned plus the selection criteria. This call returns a
limited number of employees. To retrieve the remaining records, you need to issue a series of
queryMore API calls until all employees are retrieved. In each call, queryMore you need to specify the
session ID provided by the first query response.
• QueryRequest: The CompoundEmployee API query request is made up of a SELECT clause, FROM
clause, and WHERE clause.
The query request of the API call has the following properties:
Property Definition
Param List of optional parameters (supported parameters are startingRow,
maxRow, and traceLevel)
queryString Select statement following an SQL-like syntax
Below is the example of what the query request can look like:
QueryRequest.xml
o SELECT Clause - The SELECT clause of the CompoundEmployee API contains a list of all entities to
be returned as part of the hierarchical query result XML. The following substructures are
supported in the SELECT clause:
▪ person
▪ personal_information
▪ address_information
▪ phone_information
▪ email_information
▪ person_relation
▪ employment_information
▪ job_information
▪ compensation_information
▪ paycompensation_recurring
▪ paycompensation_non_recurring
o WHERE Clause - The WHERE clause in the CompoundEmployee API query request specifies the
conditions that employees need to fulfill in order to be included in the query result. The WHERE
clause consists of subexpressions, which can be combined by the logical operator AND. A
subexpression is made up of field, operator, and value or values.
The WHERE clause of the CompoundEmployee API supports a list of selects parameters.
o Effective Period Selection - Using the select parameters selectFromDate and selectToDate can
further restrict the set of selected employees either by specifying an open period, by using only
one of the parameters or by using both parameters to determine a fixed time range.
o Effective End Date Filter - The EFFECTIVE_END_DATE parameter in the WHERE clause of the
CompoundEmployee API plays a special role, since it isn't directly applied when selecting the data
but is used to filter the result.
Field Description Valid Operators
EFFECTIVE_END_DATE The condition is applied as a filter to all =, >=
segments of the employee that are effective-
dated. Depending on the operator, the
following results are returned:
=: The query returns the entry of an effective-
dated segment, which is valid on the given date
(EFFECTIVE_START_DATE <= given date <=
EFFECTIVE_END_DATE).>=: The query returns
all occurrences of an effective-dated segment
that are valid on the given date or any later
date (given date <= EFFECTIVE_END_DATE).
• QueryResponse: The CompoundEmployee API query response has a defined list of elements and
follows the current Employee Central data model to build a hierarchically-structured XML.
Elements of the Query Response:
Element Definition
hasMore Indicator if more results are available
numResults Number of top-level results
querySessionId Query session ID for paging
sfobject List of employees with subentities, returned as hierarchical XML
Below is the example of what the query response can look like:
QueryResponse.xml
• How the CompoundEmployee API Reacts to Data Purge: Can provides some optional data purge
checks, which can be enabled by the consumers.
a. Snapshot Transmission Mode: In this mode, the API returns the data as it was on the snapshot date,
considering all changes, corrections, and deletions.
b. Delta Transmission Mode: In this mode, the API only returns employee data that was created,
changed, or deleted since the last replication.
Note: The CompoundEmployee API returns employees (persons with employment) only. Persons without
employment are excluded from extraction and not returned. This means that technical users and
employee dependents aren’t returned as sfobject by the API. But dependents are considered as a sub
element of employees.
Previous Fields: In case a field has been changed since the last modified date, a subelement
called previous is added to the field by the CompoundEmployee API. While the field itself contains the
current value of the field, the previous element shows which content the field had before the change.
Event Information: Job information and compensation information require special treatment because
they contain the information about the business events.
4. Fetch data from SFEC using Compound Employee from SAP CPI
A Request Reply is used to connect to receiver SFEC system to fetch the data from SFEC. Compound
Employee API is based on SuccessFactors SOAP receiver adapter to connect a tenant SAP Cloud
Integration to SOAP-based Web services of a SuccessFactors Employee Central system (synchronous or
asynchronous communication).
Follow the below steps to configure the SF Soap adapter for compound employee in SAP CPI:
General:
Parameter Description
Name Enter the name of the channel
Parameter Description
Address URL of the SuccessFactors data center that want to connect to. Can
browse to and select the SuccessFactors data center URL by using
the Select option.
Address Suffix The system automatically populates this field with /sfapi/v1/soap as
selected the SOAP message protocol.
Authentication Select one of the following authentication methods:
• Basic
• OAuth2 SAML Bearer Assertion
Credential Name Credential name for the credentials that has been deployed on the
tenant.
Proxy Type Type of proxy used to connect to the SuccessFactors system – Internet
or Manual.
• Choose Manual, to enter values for the fields Proxy Host and
Proxy Port.
• Proxy Host is the name of the proxy host which will be using.
• Proxy Port is the port number that will be using.
Processing:
Parameter Description
Call Type Default value is Synchronous Query.
Query Parameters consists of queryMode and resultOptions. Below is a list of all the Query Parameters
supported by the Compound Employee API.
querymode – This parameter must be used to switch on and to use snap/delta transmissions.
resultOptions - This parameter is used to switch between different options on how much data shall be
returned in the response.
• “allJobChangesPerDay” - If specified the API returns all job information slices that result from
multiple job changes per day. Normally, in case there are several job slices with the same start
date, the API does not return all job slices. It only returns the job slice with the highest sequence
number because it contains the valid business data. If the parameter value is specified, the
consumer gets all job slices and consequently knows about the historic changes and the events
that triggered each of the changes. The parameter value is not supported in case the queryMode
parameter is set to “Delta”.
Below scenarios covers the high-level explanation of CompoundEmployee API using Delta mode
transmission. When the interface runs in delta mode, the CompoundEmployee API returns the employee
data that was created, changed, or deleted since the last replication.
Two different kind of delta transmission are supported by Compound Employee API, these are:
In the example below, an employee was hired and created in the system in June. In August the
compensation data of the employee was created. In November the compensation data was changed
becoming effective from Nov 1st and again the salary was changed becoming effective from November
5th. The last synchronization of the consumer took place before the change of the compensation data.
In period-based delta transmission and providing Jun 15th to Nov 1st as synchronization period, only
the insertion of the compensation, the change of the salary will be replicated, since these changes affect
the given period and the data, which has already been replicated to the employee in the past. However,
the second change of the salary which will be effective from Nov 5th remains unconsidered and will first
be transmitted in the next period of November, if it becomes effective.
SFEC Screenshot:
SFEC Response:
delta.xml
Based on the last modified date this query returns all the 3 compensation records of an employee i.e., all
changes that happened since the last synchronization.
SFEC Response:
period delta.xml
Based on the toDate and fromDate this query returns only 2 compensation records of an employee i.e.,
only the changes affect the given period.
Below scenarios covers the high-level explanation of CompoundEmployee API using Snapshot mode
transmission. When the interface runs in snapshot mode, the CompoundEmployee API returns the data
considering all the changes, corrections, and deletions as it was on snapshot date.
SFEC Screenshot
Now let's run one query in the SFAPI CompoundEmployee with the parameters snapshot mode using SAP
CPI.
Iflow is designed with a timer to trigger the interface upon deployment and an empty Content Modifier is
added. A Request-Reply is used to fetch the data from SFEC using SuccessFactors SOAP API adapter and
Query1:
In this example, snapshot mode is enabled by setting the query parameter queryMode to snapshot and
in the query includes the snapshot_date = ‘2021-07-02T00:00:00Z’ in the WHERE condition. Here personal
data of an employee is changed and the snapshot date in the query is before the last modified date of the
change, hence the API returns the employee with old records whose last modified date is before ‘2021-
07-02T00:00:00Z’.
SFEC Response:
snapshot_response1.
xml
Query2:
SFEC Response:
snapshot_response2.
xml
Based on the last modified date this query returns all the 5 personal information records of an employee
whose snapshot date is after the last modified date.
a. Effective End Date – To extract the latest record of job information use the below query in
CompoundEmployee API in the full transmission query mode (which is a default query mode – so
no need to explicitly use this parameter in the query). Also note, job information is just an example
– the API will fetch current data from all the portlets.
SELECT person, employment_information, job_information FROM CompoundEmployee WHERE
start_date >= to_date('2021-07-01','YYYY-MM-DD') and effective_end_date = to_date('2021-10-
31','yyyy-mm-dd') and person_id_external IN ('962')
effective_end_date.x
ml
b. renderPreviousTags - When the data of a field is changed and would like to retrieve the changed
data as well as the previous data via Compound Employee API then renderPreviousTags is used
as a parameter.
SFEC Response:
previoustags.xml
Changed
segments.xml
d. allCompensationChangesPerDay - If multiple records exist for the same time slice, it returns all
the compensation information records with same effective start.
allCompensationData
.xml
e. allJobChangesPerDay - If multiple records exist for the same time slice, it returns all the job
information records with same effective start date.
alljobchanges.xml
a. Perioddelta
b. Effective_End_Date
c. allCompensationChangesPerDay or allJobChangesPerDay
9. Limitations
a. A maximum SOAP message size (HTTP content size) can’t exceed 5 MB. This is the limit when
uploading binary attachments using SFAPI.
b. By default, a maximum of 200 rows is returned in a single query or queryMore method. This
number can be set to a value from 1 to 800 by specifying the maxRows parameter in the query
method.
c. Due to performance limitations, its recommended that don't retrieve more than 20,000
employees per integration process run.
10. Conclusion
The document provides an overview of CompoundEmployee API and its functionality in SAP CPI with detail
explanation.