on 2020 Apr 02 12:20 PM
Hi All,
I am doing a scenario where I need to fetch the data from SFSF LMS using Odata and send the report to third party. While I am doing the get call using SAP CPI Successfactor adapter I am getting error like below:
Error details: "com.sap.gateway.core.ip.component.exception.ODataProcessingException: HTTP/1.1 500 Internal Server Error, cause: org.apache.olingo.client.api.communication.ODataServerErrorException: HTTP/1.1 500 Internal Server Error"
Entity I am calling are:
Endpoint: /learning/odatav4/public/user/learningplan-service/v1
Entity: LearningItemDetails , LearningItemDocuments,
Endpoint: /learning/odatav4/public/user/learningHistory/v1
Entity: LearningHistories, learninghistorys etc.
sample adapter screenshot:
Could anybody help me where is the actual issue.
Regards,
Souvik
Hi Souvik,
I totally agree with this being not a good design/solution in your case. This could work for some calls but when you need to share all the data, it is not a good idea at all.
Since you want to share it with third parties you could use the export function of the LMS Module in SuccessFactors. There is a possibility to export this data in a .CSV file which can place that file on your Successfctors SFTP. Once your file is stored there you can fetch the file from the SFTP into your CPI flow. In this flow you can then use the CSVto X converter and share it in your preferred format at the end. Being JSON XML and email or something different. You could schedule this or even expose the endpoint of the CPI (maybe use API-management with it) and then your flow can act as a middleware to pick up your data from the SFTP en answer with the data as response.
Kind regards,
Dries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi driesvv
Thanks for sharing your thought. I also asked the same thing to our SF LMS team generating the report then do the conversion in CPI as per the requirements.
Regards,
Souvik
Hi Souvik,
I used those Learning APIs myself some time ago and had similar requirements. The problem here is that the Learning APIs are very limited and you have to apply the filters for almost every request. You can create a work around by looping over requests and build them up based on parameters. This would mean a lot of calls which is no best practice at all. Or you build some logic and cache the result in a NodeCache or you replicate necessary data somewhere else and use it in cpi afterwards. There are a lot of possibilities as work around, but in this case it is finding the one that will have the best performance.
Sad those API's are so limited.
Kind regards,
Dries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi driesvv ,
For workaround you are mentioning, I need to build the parameter for each call as a result there will be huge number of call for building one flow or file. Because for each item or each user or each combination of parameter value I need to call SF LMS Odata API and capture the record one by one is a very much complex and not a good design as well from my view. As LMS API is only returning one item/record per call.
What is your thought on this?
Regards,
Souvik
Hi Souvik,
Did you try to perform the request in a tool like Postman first?
I would say, double check it there first and see if it works.
This SAP Help Documentation describes the consumption of the "Learning OData APIs":
Rgearding the LearningItemDetails I think it is mandatory to pass the following filters If I remember correctly:
GET /learning/odatav4/learningPlan/v1/LearningItemDetails
?$filter=lisCriteria/itemID eq '1147305822'
and lisCriteria/itemTypeID eq 'COURSE'
and lisCriteria/revisionDate eq 1147304737000
If you can make such a call working in Postman try it in CPI and maybe you can try it with HTTP first (and use OAuth) like in this blog:
https://blogs.sap.com/2019/11/17/cloud-platform-integration-oauth2-credentials/
Afterwards you can try to go back to the OData request. But I think the mandatory filter is missing in your case and maybe the HTTP request.
Kind regards,
Dries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi driesvv,
Thanks for the response.
Yes I was not applying any filter condition. After applying the filter I am getting the details for only one Item. But the requirement is to get all the records for object LearningItemDetails and send it to 3rd party. So my question is how do I achieve such scenario? I tried multiple way but no luck. Please let me know how I overcome such scenario?
I have tried the below scenario as well. Here also I am not able fetch the data with out using filter. It will be challenging thing to integrate via SAP CPI if we are not able to fetch the data without filter.
GET /learning/odatav4/curriculum/v1/CurriculumItemStatuses?$filter=cisCriteria/targetUserID eq 'user'and cisCriteria/curriculumID eq 'curriculum_id'and cisCriteria/rootCurriculumID eq 'root_curriculum_id'
Please suggest here.
Regards,
Souvik
Regards,
Souvik
User | Count |
---|---|
69 | |
13 | |
10 | |
10 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.