SAP Knowledge Base Article - Public

2909730 - explanation of <logon_user_name> and <last_modified_on> fields - SFAPI CompoundEmployee

Symptom

You just upserted/changed the username field in the User entity (using OData or SFAPI).

Then, you execute one query in the SFAPI CompoundEmployee and you notice that the field <logon_user_name> located under <person> tag do not have the modified timestamp in the <last_modified_on> field.

Environment

  • SAP SuccessFactors HXM Suite
    • SFAPI CompoundEmployee

Cause

This is the expected behavior.

The SFAPI CompoundEmployee <person> tag is tied with the last modified field of the PerPerson entity.

This information of the <person> segment is captured from the source USERS_SYS_INFO or USER_ACCOUNT (internal SF tables - not visible via API neither UI).

The logon user is published as a calculated element in the segment person.

Resolution

In order to provide some alternative, find below one workaround that can be implemented.

The SFAPI CompoundEmployee query is picking the last_modified_on of the initial XML tags <person> of the PerPerson entity and not from the User entity.

Can you please evaluate in your scenario if you can implement the PerPerson upsert along with the User upsert? Doing both upserts, the SFAPI CE will see the <logon_user_name> modified timestamp in the last_modified_on field.

Example of the SOAP User upsert that do not change the last_modified_on from the CompoundEmployee:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<upsert xmlns="urn:sfobject.sfapi.successfactors.com">
<type>User</type>
<sfobject>
<type>User</type>
<externalId>cgrante</externalId>
<username>cgranteOLD2</username>
<status>active</status>
</sfobject>
</upsert>
</Body>
</Envelope>

Example of SOAP - response of the query in the CompoundEmployee after this change:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<queryResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<sfobject>
<id>4581</id>
<type>CompoundEmployee</type>
<person>
<country_of_birth>USA</country_of_birth>
<created_by>sfadmin</created_by>
<created_on_timestamp>2018-04-19T20:25:24.000Z</created_on_timestamp>
<custom_string2>tested</custom_string2>
<date_of_birth>1978-10-02</date_of_birth>
<last_modified_by>666</last_modified_by>
<last_modified_on>2019-09-16T16:03:10.000Z</last_modified_on>
<logon_user_id>cgrante</logon_user_id>
<logon_user_is_active>true</logon_user_is_active>
<logon_user_name>cgranteOLD2</logon_user_name>
<per_person_uuid>C2A3756538CB4E9CB51C27BA35DDC410</per_person_uuid>
<person_id>4581</person_id>
<person_id_external>cgrantePR</person_id_external>

As you can see above the logon_user_name was changed on cgranteOLD2 and the last_modified_on was in the past 2019-09-16T16:03:10.000Z

Another way to confirm the change is doing one query directly in the User entity:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<query xmlns="urn:sfobject.sfapi.successfactors.com">
<queryString>select externalId,username,lastModified from user where username='cgranteOLD2'</queryString>
</query>
</Body>
</Envelope>

Response:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<queryResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<sfobject>
<id>USR-4541</id>
<type>User</type>
<externalId>cgrante</externalId>
<username>cgranteOLD2</username>
<lastModified>2019-09-18T07:02:03.000-04:00</lastModified>
</sfobject>
<numResults>1</numResults>
<hasMore>false</hasMore>

--------

Thinking about one solution, the change is only triggered when we also change the entity PerPerson.

Sample.

Upsert in the PerPerson:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<upsert xmlns="urn:sfobject.sfapi.successfactors.com">
<type>PerPerson</type>
<sfobject>
<type>PerPerson</type>
<person_id_external>cgrantePR</person_id_external>
<custom_string2>tested2</custom_string2>
</sfobject>
</upsert>
</Body>
</Envelope>

Response:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<upsertResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<jobStatus>OK</jobStatus>
<message></message>
<objectEditResult>
<errorStatus>OK</errorStatus>
<editStatus>UPSERTED</editStatus>
<index>0</index>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</objectEditResult>
</result>
</upsertResponse>
</S:Body>
</S:Envelope>

Query in PerPerson:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<query xmlns="urn:sfobject.sfapi.successfactors.com">
<queryString>select custom_string2,person_id, person_id_external,last_modified_on from PerPerson where person_id_external='cgrantePR'</queryString>
</query>
</Body>
</Envelope>

Response:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<queryResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<sfobject>
<id>PER-4581</id>
<type>PerPerson</type>
<custom_string2>tested2</custom_string2>
<person_id>PER-4581</person_id>
<person_id_external>cgrantePR</person_id_external>
<last_modified_on>2019-09-18T07:24:15.000-04:00</last_modified_on>
</sfobject>
<numResults>1</numResults>

Example of SOAP - response of the query in the CompoundEmployee after the User and PerPerson changes:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<queryResponse xmlns="urn:sfobject.sfapi.successfactors.com" xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<sfobject>
<id>4581</id>
<type>CompoundEmployee</type>
<person>
<country_of_birth>USA</country_of_birth>
<created_by>666</created_by>
<created_on_timestamp>2019-09-18T11:24:15.000Z</created_on_timestamp>
<custom_string2>tested2</custom_string2>
<date_of_birth>1978-10-02</date_of_birth>
<last_modified_by>666</last_modified_by>
<last_modified_on>2019-09-18T11:24:15.000Z</last_modified_on>
<logon_user_id>cgrante</logon_user_id>
<logon_user_is_active>true</logon_user_is_active>
<logon_user_name>cgranteOLD3</logon_user_name>
<per_person_uuid>C2A3756538CB4E9CB51C27BA35DDC410</per_person_uuid>
<person_id>4581</person_id>
<person_id_external>cgrantePR</person_id_external>


According the sample above, doing upsert in the User and PerPerson, you will have the logon_user_name field updated according your business requirement.

Keywords

<person>, SFAPI CompoundEmployee, <logon_user_name>, <last_modified_on>, User, username, upsert, update, SAP SuccessFactors HCM HXM Suite, CE, last modified date time , KBA , LOD-SF-INT-CE , Compound Employee API , How To

Product

SAP SuccessFactors HXM Suite all versions