SAP Knowledge Base Article - Public

2860216 - SFOData.PerEmergencyContacts Query (primaryFlag) filter returning unexpected result.

Symptom

Query of SFOData.PerEmergencyContacts using primaryFlag='Y' filter returns record whose primaryFlag is set N.

The response is suspected to be incorrect/inconsistent.

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

Sample Case :

2860216.png

1. Query : use filter > primaryFlag eq 'Y'

https://<API_URL>/odata/v2/PerEmergencyContacts?$select=name,personIdExternal,relationship,createdBy,createdDateTime,createdOn,lastModifiedBy,lastModifiedDateTime,lastModifiedOn,phone,primaryFlag,personNav/personIdExternal,relationshipNav/id&$expand=personNav,relationshipNav&$filter=primaryFlag eq 'Y'&$format=json

2. Response :

PEC_KBA.jpg

Environment

SAP Successfactors HXM Suite

Reproducing the Issue

1. Query SFOData.PerEmergencyContacts with filter primaryFlag = 'Y'

2. Response shows record not respecting the filter selection

Cause

SFOData.PerEmergencyContacts / PerEmergencyContacts entity has below business keys.

The records with primaryFlag=N in the sample is read due to the data record of the Emergency Contact for both the primary record set to 'Y' has the same business key relationship + Name + personIdExternal.

Note that since the business keys, in this sample the data record above is considered a duplicate or inconsistent data.

Resolution

1. Review the validity of use case of having an Emergency contact with same  Relationship and Name.

2. The correct use of having a second number for an Emergency Contact is to use the property 'secondPhone' for adding alternative phone number to the same contact (same name and relationship)

See below field.

KBA PerEmergency.JPG

Moving forward Employee Central Engineer for API will plan to enhance business key validation for future consideration in SF Employee Profile UI. In order to prevent this data entry of multiple records having same business key.

See Also

What are Business Keys ? Odata API Employee Central Reference Guide

Keywords

SFOData.PerEmergencyContacts, PerEmergencyContacts , primaryFlag, business key, secondPhone, inconsistent filter primaryFlag , 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 HCM Suite 1511 ; SAP SuccessFactors HCM Suite 1602 ; SAP SuccessFactors HCM Suite 1605 ; SAP SuccessFactors HCM Suite 1608 ; SAP SuccessFactors HCM Suite 1611 ; SAP SuccessFactors HCM Suite 1702 ; SAP SuccessFactors HCM Suite 1705 ; SAP SuccessFactors HCM Suite 1708 ; SAP SuccessFactors HCM Suite 1711 ; SAP SuccessFactors HCM Suite 1802 ; SAP SuccessFactors HCM Suite 1805 ; SAP SuccessFactors HCM Suite 1808 ; SAP SuccessFactors HCM Suite 1811 ; SAP SuccessFactors HCM Suite 1902 ; SAP SuccessFactors HCM Suite 1905 ; SAP SuccessFactors HCM Suite 1908 ; SAP SuccessFactors HXM Suite 1911 ; SUCCESSFACTORS BIZX SUITE 2005 ; SuccessFactors HCM Suite 1204 ; SuccessFactors HCM Suite 1207 ; SuccessFactors HCM Suite 1210 ; SuccessFactors HCM Suite 1302 ; SuccessFactors HCM Suite 1305 ; SuccessFactors HCM Suite 1308 ; SuccessFactors HCM Suite 1311 ; SuccessFactors HCM Suite 1402 ; SuccessFactors HCM Suite 1405 ; SuccessFactors HCM Suite 1408 ; SuccessFactors HCM Suite 1411 ; SuccessFactors HCM Suite 1502 ; SuccessFactors HCM Suite 1505 ; SuccessFactors HCM Suite 1508