and more in a single search tool across platforms. Read the announcement here. |
02/06/2023 06:34 AM
We have to write some identity attributes that are generated on EIC side back to the source system SAP HCM.
I see there is no UPDATEUSERJSON in the SAP connector like e.g. in the REST connector. Can anyone advise with a best practice how to achieve this?
Thanks beforehand!
Solved! Go to Solution.
02/06/2023 05:46 PM
You can use actionable report/rule
02/06/2023 09:44 PM - edited 02/06/2023 09:45 PM
Hello,
You cannot write back to SAP HCM through the connector. This can be achieved through a custom java class. Use the "Custom Action" option in the update rule and call your java class from there. You can create a JCoDestination & execute your function module by passing the required arguments to your method.
Sample method (just for reference):
public String callHCMFunctionModule(JCoDestination ABAP_AS, String personID, String sapID, String startdate) throws Exception {
System.out.println("Calling HCM Function Module BAPI.............");
// Connect
JCoFunction function = ABAP_AS.getRepository().getFunction("ZM_FUNCTION_MODULE");
System.out.println("get function..........");
// Set params
function.getImportParameterList().setValue("PERNR",personID);
function.getImportParameterList().setValue("SAPID", sapID);
System.out.println("Getting date..........");
function.getImportParameterList().setValue("BEGDA", startdate);
// Execute
function.execute(ABAP_AS);
System.out.println("getting export parameters.............");
System.out.println(function.getExportParameterList().getFieldCount()+".............");
if (function.getExportParameterList().getFieldCount()==0)
throw new Exception("Error in data");
String message = "";
return message;
}
Thank you and regards,
Swathi Hari
02/07/2023 12:04 AM
Hi Swathi,
that helps a lot, much appreciated.
Thank you
André