SAP Knowledge Base Article - Public

2657419 - Matrix manager gets concatenated instead of being overwritten while using Upsert Call on User ODATA API Entity

Symptom

  • Matrix manager gets concatenated instead of being overwritten while using Upsert API Call for User ODATA Entity.
  • This can be checked in the UDF File downloaded from Admin Center > Employee Export > Select 'Valid users only' under Specify Export Options > Export User File:

208_Paint.PNG

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Reproducing the Issue

  1. Upsert the Matrix Manager for a user who is already having a Matrix Manager in the system:

      > For example the sample employee with userId 205 already has a matrix manager with userId 207 in the system

      > This can be checked in the UDF File downloaded from Admin Center > Employee Export > Select Valid Users only under Specify Export Options > Export User File

      > Check the column MATRIX_MANAGER for the sample userId 205

    207_paint.PNG

  2. Now you want to change the matrix manager for the sample userId 205 from 207 to 208, so you make an API call such as below:

    API Request Header: POST https://apisalesdemo4.successfactors.com:443/odata/v2/upsert

    API Request Payload:

    {
     "__metadata":

     {
      "uri": "User(userId='205')"
     },
     "matrixManager": {
      "__metadata": {
       "uri": "User(userId='208')"
      }
     }
    }

  3. Check the matrix manager for the sample employee 205:

    > This can be checked in the UDF File downloaded from Admin Center > Employee Export > Select Valid Users only under Specify Export Options > Export User File

    > Check the column MATRIX_MANAGER for the sample userId 205

    > MATRIX_MANAGER would have been concatenated to 207|208

    208_Paint.PNG

Cause

  • This is an expected behavior;
  • When you already have a matrix manager for a user and you send a new matrix manager in the upsert request the ODATA API upsert call will add the new manager along with the old manager;
  • Since the relation between an employee and matrix manager is one to many (1:N), everytime you try to upsert the employee with a new matrix manager, ODATA API will append the matrix manager instead of overwriting it. 

Resolution

If you want to overwrite an existing matrix manager for an employee, you must use the $purgeType=record parameter. Please refer to this page for more information: SAP SuccessFactors HXM Suite OData API: Reference Guide - Upserting Users with Parameter purgeType.

Keywords

Matrix_Manager, Matrix Manager, User, Upsert Call, ODATA API Entity, Concatenate, Overwritten, PUT, POST, DELETE, purge, purge type, purgetype, added, replace, append , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , Problem

Product

SAP SuccessFactors HCM suite all versions