SAP Knowledge Base Article - Public

2892425 - ODATA API: EmpJob Upsert fails with - XXXXXX is an invalid external code for Cost Center

Symptom

You are creating / updating Employee Central job information of an employee using ODATA API upsert operation.

When upserting to the EmpJob entity, the creation / update fails with either or both of the below error messages:

  • XXXXXX is an invalid external code for Cost Center
  • XXXXXX is an invalid external code for Position

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

Environment

  • SuccessFactors BizX 
  • EC ODATA API

Reproducing the Issue

This issue can be quickly reproduced by performing the below steps:

  1. Navigate to Manage Data
       
  2. Create a new Cost Center and / or Position (Code: validationTest & Effective As Of: 01/01/2020)
        
  3. Hire an employee via ODATA API (costCenter:  validationTest & start Date: 01/01/2019)

  4. The upsert will fail with error: "validationTest is an invalid external code for Cost Center"

Cause

The same data issue is occurring for both the Cost Center & Position fields located in the Job Information (EmpJob)

 

  • The startDate value provided in the EmpJob upsert is outside the effective period of the Cost Center / Position
    i.e. The Cost Center / Position is not effective (does not exist) on the provided startDate
       
  • The startDate value provided in the EmpJob upsert is outside the effective period of the Cost Center / Position
    i.e. The Cost Center / Position is not effective (does not exist) on the provided startDate

Resolution

To resolve this issue, we must ensure that that the startDate of the job information upsert, is within the effective periods of both the Cost Center / Position

  1. Navigate to Manage Data > Cost Center (or Position)
       
  2. Select the Cost Center / Position which is having issues
       
  3. Check the Effective as of value for this Cost Center 
        
  4. Ensure that the startDate of the EmpJob Upsert is after the Effective as of value of the Cost Center / Position     

 

Assuming the Cost Center / Position is currently Active, the above steps should clear the validation error displayed in the 'Symptoms' section

See Also

For further information on the EC ODATA APIs, See: Employee Central OData API Reference Guide

Keywords

Invalid, externalCode, costCenter, Cost Center, Positoon, job information, EmpJob, upsert, startDate, effective as of, data issue, validation , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT , Integrations , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HXM Suite all versions