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
    • CompoundEmployee API

   

Cause

This is the expected behavior.

The CompoundEmployee API <person> tag is associated with the PerPerson (Biographical Information) entity.

<logon_user_name> field in the <person> segment/node is taken from the source the UserAccount object / entity  (the last_modified_on value of this object is not).

   

   

Resolution

As Of 1H 2022 SuccessFactors Release
 
Compound Employee API now supports a new segment called Identity Information.
The segment is supported in the standard query mode & is retrieved by including "identiy_information" in the SELECT statement
Changes in the UserAccount can now trigger a replication, as a last_modified_on value associated specifically with the User Account is now returned, which wasn't possible in previous versions with the <logon_user_name> property.
    

We recommend this as the primary solution for capturing username changes for replication.
For further information, please refer to: New Identity Information Segment for Employee Central Compound Employee API

  

Before 1H 2022 SuccessFactors Release

The above functionality was not available as standard before the 1H 2022 Release.

The below workaround was documented to provide some alternative prior to the release & now to potentially address situations where it is not possible to include "identity_information" in the SELECT statement of the query
(e.g. some standard packages which may have hard-coded queries)

  

It involves updating the PerPerson (Biographical Information) in parallel to updating an employee's username.

  • The PerPerson update results in an updated <last_modified_on> timestamp of the <person> node & because the <logon_user_name> is rendered under the <person> node of CE API response, 
    From replication perspective, it looks like the <last_modified_on> has been updated with the <logon_user_name> change and is subsequently considered for replication

 

Please evaluate the feasibility of implementing this approach within your scenario & fully test it from end-to-end to understand if it is applicable:

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.

 

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.

        

See Also

The UserAccount/username (i.e. logon_user_name in CE API) can also be changed via the UI using Manage Login Accounts

For more information see: 2859043 - Manage Login Accounts tool 

Keywords

person, SFAPI, CompoundEmployee, logon_user_name, last_modified_on, User, username, upsert, update, CE, last, modified, date, time, identity information, , KBA , LOD-SF-INT-CE , Compound Employee API , How To

Product

SAP SuccessFactors HCM suite all versions