Let me start by saying that SAP has given a standard integration between SuccessFactors Employee Central and SAP Fieldglass. For more information please refer this.
Following the standard way you can enable the configuration in both SuccessFactors Employee Central and SAP FG and use the standard Integration package in SAP CPI-PI. Process is pretty simple as shown below. It starts with a vacant position in Employee Central.
The standard integration may not support your client’s Contingent workforce requirement due to various reasons including some mentioned below –
- Doesn’t want to manage positions for contingent workers manually in Employee Central
- Create requisition and register directly in SAP FG and not from Employee Central
- Want to automate creating positions in Employee Central when worker is registered in Employee Central by CPI
- Want Extension and Termination of contingent workforce by the interface in CPI
In such cases we can build a custom integration in SAP CPI to support the client specific requirements. We built a custom interface for one of our client and in this blog I would like to share some information which may be a starting point for you if you are planning to create a custom integration between SAP SuccesFactors Employee Central and SAP FG.
We received input data from SAP FG via a flat file (SFTP). We handled Hire, Extension and Termination of contingent workers via the custom interface. The action to be performed was fed by FG. The work order was defaulted and vendor was mapped from the input.
Correct order of API to hire contingent worker:
- Basic user
- Employment details
- Personal information
- Work order
- Job information
Position for contingent worker:
Our client expected the integration in SAP CPI to create positions for contingent workforce before registering them in Employee Central. The position object has a number of attributes. All such information feed was sent by SAP FG. The inbound feed had the manager id of the contingent worker. The manager’s position’s attributes like Legal entity, Business unit, division, sub division, department , cost center and location code were used to create a new position for the worker. The position external code was auto generated via UI in SuccesFactors Employee Central and we didn’t find an API to generate the next number from number range for position so we created a variable to store last run timestamp and used it to fetch all the positions created in SuccesFactors Employee Central based on the condition where createdDateTime is greater than or equal to LastSuccessfulRunDate. The obtained position IDs are sorted and incremented by one to create a new position.
3 default job classification for different types of workers were mapped in the integration. Ex if input has Profile worker there was a default job created for all profile workers in SuccesFactors Employee Central which was mapped to the worker.
Default values via API:
Since clients prefer to capture minimal information in their system of record for contingent workers we have to default values while registering them in SuccesFactors Employee Central via API. Example 01/01/1900 for Date of birth, Default value for pay grade etc.
New Person id:
Use API generateNextPersonID to generate the next in number range and pass it while hiring workers via API. There are chances that concurrent API calls can occur or someone creates a new hire in UI at same time so you may get an error saying duplicate id exists. To prevent this you can enable below option in ‘Company Logo & Settings’.
Enabling this option will change the process how Employee IDs are generated, instead of creating the IDs based on a config table they will be generated based on a Database sequence. It is recommend to use this option in case you receive application errors caused by duplicate Employee IDs.
Extension and Termination:
Extension : Modify workorder information using the field “Is this an extension” = Yes and Termination reason = “Planned end date”
Termination : Modify workorder information using the field “Is this an extension” = No and Termination reason = as per requirement (may come in the feed from SAP FG)
The other data of the worker is updated automatically.
Since this is a highly complex custom integration it requires a good amount of testing. Let me list down some learnings we had.
- Decide on the start date while creating a new position and make sure hire date in input >= start date on position. This goes for other effective dated objects where you have to check the dates.
- Capture exceptions to make sure the complete interface doesn’t fail when one input record has an issue.
- In a global system there may be default objects created (Ex for position POS9999999) to support a scenario or interface. In this custom integration when you read objects to find next number in the number range you have to ignore default objects. Ex. Position in our case.
- If you want to create a link between contingent worker record in SuccesFactors Employee Central and SAP FG you may use an employee attribute in a portlet in Employee Central which is not used for contingent worker. While registering the worker in Employee Central via API you can use any field in EC (which is not required for workers) to store a value from SAP FG.
- If interface fails while creating a worker in Employee Central. Ex. there’s an exception due to some reason after creating 2 portlets then rest of the update was done by HR admin. So you need to agree whether you will purge such incomplete worker profiles or someone will update the rest manually.