SAP Knowledge Base Article - Public

3075524 - OData API error : "ServiceCreateFailedException: can not get personId"

Symptom

When creating a new user profile in SuccessFactors the API returns the following error: "ServiceCreateFailedException: can not get personId.".

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

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Reproducing the Issue

1. You created a user profile in SuccessFactors by upserting the objects in the following sequence:

  • User Upsert
  • PerPerson Upsert
  • EmpEmployment Upsert
  • EmpJob Upsert
  • PerPersonal Upsert

2. Another scenario is you are replicating the data to the SuccessFactors System, and you are getting the error.

3. The error below returned:
"ServiceCreateFailedException: can not get personId 

Cause

Previously it was recommended in the implementation documentation that a user profile be upserted in the sequence outlined above, including an Upsert on User.

This in turn could lead to the error: "ServiceCreateFailedException: can not get personId". The issue occurred when the User Id was the same as an already existing person_id_external in the system.

Resolution

As a result of this behavior, the sequence that objects need to be created has been updated in the documentation to avoid this collision going forward:

  • The first step "User entity upsert" is unnecessary for adding a new employee, so skipping this step can prevent the error mentioned.
  • This is possible because when creating the employment record it will also create a user record.
  • The person_id_external value will be generated by the first Upsert, which will then be on PerPerson object.
  • With that in mind, the new recommended sequence is as follows:
    • At a minimum, you can insert the PerPerson, EmpEmployment, EmpJob, and PerPersonal entities to add an employee. The order in which you perform the Upsert operations is critical. Be sure to follow it: 
      1. PerPerson
      2. EmpEmployment
      3. EmpJob
      4. PerPersonal

See implementation guide for further reference: Adding a New Employee | SAP Help Portal 

In case you used the previous order (upserting User) and you are not being able to follow the new order mentioned above, please try using Check Tool to fix the error:

  1. Open Check Tool and search for "User Management" application:



  2. Run the "OrphanPersonGOs" check, it should find the user IDs which are not properly configured and should be causing the error
  3. Use the "Quick Fix" button so the user IDs get fixed
  4. After it finishes, try running the Upserts again

If the above, check tool does not fix your issue you can use below steps to fix the issue.

Please use the below check tool to remove those orphan person ID:

-> Check Tool
-> Employee Central Core
-> User with the orphan Person IDs would be visible. (OrphanPerson)
-> Run 1 Check

Then follow 2786737 - How to delete an orphaned Person ID with Compound Delete functionality - SAP for Me delete those orphan personID.

Once you delete the Orphan Person Id External and Orphan Person ID you can re-run the replication and check if user get replicated or not/ upsert the user again

See Also

2619357 - The order to create an Employee using OData APIs - SAP for Me

Keywords

Can not get personId, upsert, perperson, api, adding a new employee, purge, purged, check tool, user management, OrphanPersonGOs , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , LOD-SF-PLT , Platform Foundational Capabilities , Problem

Product

SAP SuccessFactors HCM Core all versions ; SAP SuccessFactors HCM Suite all versions

Attachments

image.png
image.png
image.png
image.png
image.png