Technical Articles
CPI Extensibility – Message Monitor Overview
Hi Community,
I hope everyone are safe and doing good during these challenging times. I am Venu Ravipati. I am a SAP integration consultant working on SAP technologies like SAP XI, SAP PI/PO, CPI, S/4HANA, SAP BTP.
Introduction:
CPI is the best in class integration software as a service to integrate any SAP, non-SAP, on-premise and cloud applications with vast integration content and capabilities. While CPI provides rich functionality out of the box, if there are use cases where we need to build custom solutions for CPI, this blog explains the concepts of CPI extensibility using APIs. In this blog i am going to provide details of one of the CPI extensibility use case. Integration consultants who worked on SAP PI/PO, know the message monitor overview page of SAP PO which provides overview of the number of successful, error and scheduled messages in different time frames like hourly, daily, weekly etc. Let us see how we can leverage APIs of CPI to build similar monitor overview page for CPI. So let’s get started.
Side by side extensibility is one of the extensibility patterns to extend S/4HANA applications using SCP. The side by side approach helps to develop extensions to standard applications without making any change to the standard application. This is possible using the white listed APIs from api business hub. The same side by side extensibility approach can be used to implement CPI extensions as well. The implementation of side by side extension needs knowledge of SCP services and cloud native development using SAP cloud application programming model and SAP Cloud SDK. More information on side by side extensibility can be found in below documentation.
https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/
CPI APIs are available and can be used to access the data of CPI tenant like Integration scenarios, message processing logs etc. The list of all CPI APIs and documentation is available in SAP api business hub and SAP help portal below.
https://api.sap.com/package/CloudIntegrationAPI?section=Artifacts
CPI provides an API for getting the deployed integration scenarios. Below is the endpoint for the API.
https://<cpihost>/api/v1/IntegrationRuntimeArtifacts
More details on the API parameters and and response data structure can be found in SAP api business hub.
API is available for getting message processing logs of CPI. For an integration scenario, the count of all messages of different processing status (i.e. COMPLETED, FAILED, RETRY) can be obtained from the API as below
https://<cpihost>/api/v1/MessageProcessingLogs/$count
For Example, the API call for getting count of messages for a day will look like below
We can run tests on the API data using SAP api business hub or using a rest client like postman. Testing CPI APIs is very simple and only needs a CPI user with administrator access.
Using these APIs, the side by side extension is built on SCP CF environment using SAP cloud application programming model and SAP cloud SDK. There is great content and sample applications in the community on these areas. Below is the SAP help documentation
https://help.sap.com/doc/2324e9c3b28748a4ae2ad08166d77675/1.0/en-US/js-index.html
The final monitoring overview page looks like below with message monitoring overview for different time ranges.
Conclusion:
I hope this blog left you with an understanding of CPI extensions using APIs. We can use the APIs standalone in postman to answer different questions easily like for example, 1. Which integration scenarios have most traffic in in last 2 days and how many messages?. 2 . What are the total number of integration errors in this week?. If an extensibility use case exists, a side by side extension can be built on SCP. Please share your valuable comments and feedback. If i error anywhere, please correct me ?. If you are interested in this topic, stay tuned for more blogs in this area.
I finally want to thank all the community and members Vadim Klimov, Eng Swee Yeoh, Raffael Herrmann, Wouter Lemaire, DJ Adams, Marius Obert, Thomas Jung, Appala Naidu Uppada, Mandy Krimmel, Sriprasad Shivaram Bhat, Fatih Pense, Ariel Bravo Ayala and many others whose blogs, answers and insights helped and inspired me.
Thank you all and have a wonderful day…
References:
API business hub:
https://api.sap.com/package/CloudIntegrationAPI?section=Artifacts
Side by side extensibility:
https://extensibilityexplorer.cfapps.eu10.hana.ondemand.com/ExtensibilityExplorer/
SAP CPI API help:
SAP cloud application programming model (CAPM)
SAP cloud SDK
https://help.sap.com/doc/2324e9c3b28748a4ae2ad08166d77675/1.0/en-US/js-index.html
Hello Venu,
thank you, very interesting approach.
I know the CPI APIs for monitoring and I understood the basic concept of the side-by-side extentions.
But can you give some more details ?
Thank you
Regards
Thorsten
Hi Thorsten,
Thanks for your comment.
Yes. SAP Cloud SDK for Java Script is used as back end and SAPUI5 as front end. The sample application i used as reference is https://github.com/SAP-samples/cloud-sdk-team-calendar
I was using Cloud Foundry runtime environment. I guess we can not run Node.js applications on Neo as Neo does not have Node.js runtime.
Please let me know if you have any further questions.
Thank you,
Venu
Hi Venu,
How to filter the processing time of messages using the API?
Hi Venu,
When the customer wants to monitor by message type, does CPI has the menu or the way?
Thank you.
Best Regards,
Lena
Hi Lena,
Sorry for the delay. I see an option of message logs filtering using "Application Message Type". I haven't tried it yet.
please check out the link
https://help.sap.com/viewer/368c481cd6954bdfa5d0435479fd4eaf/Cloud/en-US/314df3f8f4334dd8829c62e865cc6d02.html
Thank you,
Venu
Hi Venu,
Thanks for the shout out!
For this approach, being able to run on CF makes it seem more native. Can you elaborate on user authentication?
Regards,
Fatih
Hi Faith,
User authentication is using default SAP IDP. It can use any custom IDP as well if one is configured.
Thank you,
Venu