The aim of this article is to introduce you to a tool developed by Abapeur.fr: CPI Logs Analyser (Beta).
This tool, to be integrated into your SAP On-Premise or Private Cloud Edition system (BTP, ABAP Environment and S/4 Hana Cloud are not currently compatible), enables you to define iflow managers created on CPI, and notify them by email in the event of iflow errors.
Please note:
- There are already solutions available to monitor error-prone iflows by email, but here we propose more global error management (no need to configure each iflow) using SAP Cloud Integration APIs.
- We use an SAP system, but you could develop a solution with any tool that can consume the APIs, such as Splunk for example.
1. Activate the standard Custon Business Configuration application
- Follow the activation instructions here: https://fioriappslibrary.hana.ondemand.com/sap/fix/externalViewer/#/detail/Apps(‘F4579’)/S29PCE

- and define a Business Catalog referring to the Custom Business Configuration tile available in this Technical Catalog :

- Manage the necessary authorizations
The tile should now be visible

2. Import project via ABAPGIT
This is the project to import: https://gitlab.com/abapeur/CPI-Logs
This project will install all the objects required for monitoring configuration, including :
- Maintenance tables to add iflow managers to be notified in the event of an error
- A scheduler program in the background that will make API calls to retrieve error messages and send emails.
3. Technical configuration
- Add the necessary authorizations to access and modify table ZI_TABLEINFOSFORCPIEMA


- On BTP, create an instance to access the CPI log APIs ( Plan : api )

- In SM59 add 2 connections
SCPI_API_OAUTH to retrieve the Bearer required for oauth 2.
the URL is present in the instance credentials file:

( Add grant-type=client_credentials at the end of the url )

Then add customer_id and customer_secret

Remember to activate the SSL connection and add the STRUST certificates.

SCPI_API_LOGS calls the CPI APIs to find messages in “FAILED” status.

Host :

No need for user and password here (will be managed in the program via the Bearer obtained)

- Finally, program the z_email_errors_cpi program at the desired time interval. If you wish to check for errors every 5 minutes, for example, program every 5min.

URL : Url of your Integration Suite Instance

EMAIL: Corresponds to the Sender that sends error messages.
- Activate OData V4 service ZUI_TABLEINFOSFORCPIEMA_O4

4. Functional configuration
Once all the technical settings have been made, the solution is ready! All that’s left to do is add the iflow managers so that they can be notified.
- Access the Custom Business Configurations application ( Application F4579 )

- Select the “Table infos for cpi emails” line

- Enter the package you wish to monitor and the e-mail address of the person in charge (it is possible to create several lines for a mailing list or several people in charge).
The package name is visible in CPI :


- The “Last Search in CPI” field is used to retrieve all errors that have occurred since this date/time. When a new entry is created, if it is not filled in, it takes the date and time the line was created. It is also possible to change it manually in the event of a problem, in order to repeat the checks.
- Modifiable directly in Prod, no need to transport from DEV
Configuration complete!
5. Receiving emails
Once you’ve received the error email :
- The title contains the name of the iflow
- Each line of the email contains a link to CPI for a description of the error.

Accessing the link takes you to CPI’s error description.

Please note: The solution currently uses email management configured with SAPConnect via SCOT. You must therefore ensure that you have a Mail server configured:

Conclusion
Here’s a solution for monitoring iflow errors via email.
This is a Beta solution. In case of errors/problems you can report them to us via the Contact Form.
Upcoming enhancements ( Cloud Compliant ):
- Remove the z_email_errors_cpi program and replace it with the application jobs solution.
- Use ABAP Cloud for sending Emails ( example here for On-Premise and Private Cloud and here for Public Cloud and BTP, ABAP Environment ).
- Use ABAP Cloud for HTTP connections.
Once these improvements have been made, the aim is to have a version available for S/4 Hana Cloud and BTP systems, ABAP Environment.