1

I am replicating the Successfactors Employee Central Data (including FO, MDF, BG elements and etc.) via OData API to local database for third party integration.

It is able to trace changed records by filtering last modify date. However, the deleted record is not able to capture from OData API. Hence I cannot delete the record in my local database when corresponding EC record is deleted.

Is there any way I can get the deleted records from the API or other sources? Thanks.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
mcjai
  • 558
  • 4
  • 9
  • what API do you use? standard SF or your custom? – Suncatcher Oct 26 '21 at 09:35
  • @Suncatcher I am using Standard SF OData APIs. – mcjai Oct 26 '21 at 09:40
  • so you enabled API for SG Central objects and using some of [these ones](https://api.sap.com/package/SuccessFactorsEmployeeCentral/odata)? Are there only standard objects or MDF too for which you wanna trace deletion? – Suncatcher Oct 26 '21 at 09:44
  • Yes, basically I am consuming all available APIs (OData V2 API) in your link mentioned as well as custom MDF APIs we made. I would like to trace deletion of both standard objects and MDF too. – mcjai Oct 26 '21 at 09:55

1 Answers1

1

OData API is not able to handle this task.

Extract from SF OData API doc:

Don't use our OData APIs when:

● Your system cannot consume either OData APIs or SOAP for an initial data load. In this case, you would go for Import/Export with a CSV. Automation via FTP would also be a possibility.

You need employee replication field level delta, snapshot, or read modified employees only, then SOAP Compound Employee API is your tool of choice. You can find more information in the guide Implementing the Employee Central Compound Employee API.

● You only need to read data, then the SOAP Compound Employee API would also be your tool of choice.

However with SFAPI (SuccessFactors CompoundEmployee API) it's easy. SFAPI has a special parameter changedSegmentsOnly that does exactly just what you want, the API returns only changed segments with an action code not equal to NO_CHANGE in delta transmission.

You make a query, for example, for changed employee data:

<urn:query>
 <urn:queryString>select person,
                         personal_information,
                         address_information,
                         email_information,
                         phone_information,
                         employment_information,
                         job_information,
                         compensation_information,
                         paycompensation_recurring,
                         paycompensation_non_recurring,
                         direct_deposit,
                         national_id_card,
                         payment_information
                         from CompoundEmployee
                         where person_id_external = 'cgrant'
 </urn:queryString>
 <urn:param>
     <urn:name>resultOptions</urn:name>
     <urn:value>changedSegmentsOnly</urn:value>
</urn:param>
 <urn:param>
     <urn:name>maxRows</urn:name>
     <urn:value>50</urn:value>
 </urn:param>
</urn:query>

This API query will return you all the employees that were changed or deleted.

enter image description here

After that you can filter your response by that field.

ADDENDUM: any change to MDF entity, both standard and custom, can be tracked via OData Audit logs. How to enable them:

  1. Go to this setting in API center

enter image description here

  1. Enable this switch. It can be enabled for SFAPI as well

enter image description here

  1. This way all API calls payloads will be saved and you will be able to see what entity was changed with each call

enter image description here

Prerequisite: the object must be visible by API and MDF version history must be enabled

More about API types for SuccessFactors:

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Thanks. I am aware of SOAP Compound Employee API and tried to use this API to solve my task. Indeed, It can help to delete some records if the entity is included in CompoundEmployee API, but the limitation is Background Element and non employee entities are still not able to capture, eg. Background_element_award, picklist, cost_center and etc. I would at least handle the BG Element for employee information integrity, do you have any insights that I can add BG Element into Compound Employee API? Thank you so much. – mcjai Nov 01 '21 at 02:00
  • It's not clear what are you trying to do, either to delete records or log their deletion. Background Elements are just People Profile UI elements and nothing more, they do not store data, they expose MDF objects. If the entity is present in [OData API Data Dictionary](https://www.sapspot.com/wp-content/uploads/2020/08/Guide8-1024x387.png) then it can be tracked by OData API audit, if this is [allowed by API settings](https://www.sapspot.com/wp-content/uploads/2020/08/Guide11-1024x595.png). This also applies to MDF picklists. Added info how to enable audit logs, see the question – Suncatcher Nov 02 '21 at 17:28
  • Do you mean that Background Elements (I created from Manage Business Configuration-->Employee Profile-->Background Elements) also are MDF objects? I thought they are different. And yes, they are presented in OData API and I need to trace their deletion. 1. Can Background elements be added into SOAP Compound Employee and consume from SOAP API? 2. Can I conclude that if the data is available in Compound Employee, we can trace the deletion from SOAP Compound Employee API, otherwise we have to trace the deletion from API Audit log? Thank you. – mcjai Nov 03 '21 at 04:30
  • 1
    1. Yes. 2. Yes. SFAPI Data Dictionary behaves the same as OData Data Dictionary and you can query any custom MDF (cost center, picklist, etc) that exist in it. If you miss your custom MDF entity in SFAPI DD you can add it (refer to SAP Note [2597777](https://launchpad.support.sap.com/#/notes/2597777) to know how) and do not forget to set the [supportedOperations](https://imgur.com/RlU0Dv1) to UPSERT, DELETE, QUERY. All in all, your original question was about OData API, not SOAP API, please raise a new question if you interested in SFAPI – Suncatcher Nov 03 '21 at 07:06
  • Thanks you so much. I would further study SFAPI and raise new question if necessary. – mcjai Nov 03 '21 at 08:04