Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
About the Author:

I work as a Developer in Cloud Platform Integration and work predominantly in building and maintaining CPI adapters. Adapters are used to integrate systems with different platform. I specialize in CPI Successfactors Adapter, which is used to integrate systems with Successfactors.

Why This Article:

One common mistake that user does is to copy the payload template from Soap UI and use it as a payload in Successfactors CPI adapter.

Successfactors CPI adapter takes simple xml as payload and the adapter will take care of creating the Soap Envelope around the payload before sending the data to Successfactors system.

We will explain it step by step with a simple example.

What to expect in this article:

In this article, we will explain how an Upsert operation is performed using Successfactors CPI Adapter.

 

Scenario: Update records of user with empid 1001



  • Create an Integration Project




We use Content Modifier to pass payload to Successfactors CPI adapter and SFTP adapter to get the response from the Upsert operation from the Successfactors CPI adapter. Adding SFTP adapter is optional, it can be replaced with any other adapter of your choice and you may also choose not to use any adapter if the response from the adapter is not required.

  • Model Upsert Operation in Successfactors CPI Adapter.




In the Successfactors “Processing” tab enter the Successfactors Address and Credential Name and click on “Select”.



Model operation requires you to connect to the Successfactors system. Enter the Successfactors connection details and click on Connect.



In the Entity Selection dialog select the table that needs to be updated. In our scenario we are updating User table.



Select Operation as “Upsert” and select the fields that needs to be updated. externalId and Status are mandatory fields. Click on Finish.

 

  • Add the payload to the Content Modifier.




The sample payload is given below.
<?xml version="1.0" encoding="UTF-8"?>
<Users>
<User>
<department>Talent Management</department>
<division>Industries</division>
<email>eee@successfactors.com</email>
<empId>1001</empId>
<externalId>aaaa</externalId>
<firstName>Alex</firstName>
<hrId>USR-17</hrId>
<jobCode>Human Resources Manager (HR-MGR)</jobCode>
<lastName>eee</lastName>
<location>San Mateo (US_SFO)</location>
<status>active</status>
<timeZone>CST</timeZone>
<username>Hello13</username>
</User>
</Users>

Add the payload for the selected fields as shown. The payload should be a simple xml.

Save the changes and deploy the iflow.

Conclusion:

In this article we explained how Upsert operation can be performed using CPI Successfactors Soap Adapter. You can now go ahead and try out few scenario.
6 Comments
Terry_Chompaa1
Discoverer
0 Kudos
Thank you for the stuff can you help with using Upsert of the ODATA API
former_member116445
Discoverer
0 Kudos
Hello, thanks for you post, I have a question, performing an perEmail upsert of many users I get an error if any row failing:

<data contentType="null" contentLength="537"><![CDATA[{error text :
An exception has occurred. These are the details..
UPSERT operation status; Job Status:{ERROR}, Message:{}
UPSERT operation FAILED; Total:3, Successful:2, Failed:1, Not Processed:0
Index:{0}, Edit Status:{UPSERTED}, Error Status:{OK}, Message:{}
Index:{1}, Edit Status:{NOEDIT}, Error Status:{ERROR}, Message:{Global Person ID is invalid.,
failed record info: {email_address=bbbbhotmail.com, email_type=3964, person_id_external=bbsbb, isPrimary=true}}
Index:{2}, Edit Status:{UPSERTED}, Error Status:{OK}, Message:{}

Is there any way to continue execution and obtain respond operation on body flow with the ox and error execution on respond operation?. like this (manual edited xml, just to represent what I want):

 

<upsertResponse xmlns="urn:sfobject.sfapi.successfactors.com"
xmlns:ns2="urn:fault.sfapi.successfactors.com">
<result>
<jobStatus>ERROR</jobStatus>
<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>
<objectEditResult>
<errorStatus>OK</errorStatus>
<editStatus>UPSERTED</editStatus>
<index>1</index>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/>
</objectEditResult>
<objectEditResult>
<errorStatus>ERROR</errorStatus>
<editStatus>NOEDIT</editStatus>
<index>2</index>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true"/>
</objectEditResult>
</result>
</upsertResponse>

Regards

César
0 Kudos

​I have a problem in accessing upsert functionality of SuccessFactors from CPI. I am using Succesfactors odata v2 adapter in CPI but I am unable to find the Upsert Enitity .



 

 

I cannot find the upsert Entity in the SuccessFactors OData v2 in CPI. But I am able to access the same using Postman. Other odata functionalities are accessible from CPI using Oauth2 saml bearer token. Upsert functionality belongs to function-import  operation of SuccessFactors adapter. Is it implemented in SuccessFactors adapter?



Cannot find the upsert entity in SF adapter



Postman Client





In the screenshot, I am able to access the same upsert odata in postman with the same oauth token. I am unable to find the same in CPI. Please provide the solution for this issue.


Thanks in advance.



pmhatre12
Explorer
0 Kudos
hi expertise

is it possible to add where condition on upsert query ? and how

i want upsert payroll id for particular company code only.
JunwooPark
Participant
0 Kudos

..

JunwooPark
Participant
0 Kudos

I tried following this blog and got an error.

com.sap.it.rt.adapter.sfsf.wsclient.SfsfWsClientFaultException: Problem during invoking SuccessFactors Web service. SOAP faultCode S:Server, faultString SFAPI Domain Error!, errorCode INVALID_REQUEST_MESSAGE, errorMessage: Invalid request message! Error: For Update/Delete operation, the required Id field is missing!. Occurred at row 1!, cause: org.apache.cxf.binding.soap.SoapFault: SFAPI Domain Error!

As a result of checking the SFAPI dictionary, the requried fields are exteranlId(id ??) and status.

But this blog doesn't have about this. so I add <id>USR-179</id>

after add <id>USR-179</id>

Error Details
com.sap.it.rt.adapter.sfsf.core.exception.SfsfBusinessException: UPDATE operation status; Job Status:{ERROR}, Message:{} UPDATE operation FAILED; Total:1, Successful:0, Failed:1, Not Processed:0 Index:{0}, Edit Status:{NOEDIT}, Error Status:{ERROR}, Message:{USER_NOT_FOUND Field name:hrid Field value:USR-17 Cannot find user by user id. InternalId = USR-17.. }