cancel
Showing results for 
Search instead for 
Did you mean: 

How to Gather Error Logs in sap CPI.

Akhil0434
Explorer
0 Kudos
717

Hi All,

 

I have a requirment, Once i get the data into CPI, i split the each record and will post to two APIs in paralell, My req here when ever there is an error i need to send an email of all errors with source data, each record i send an email, but how to merger all these records into, Since im using router, i cant able to use gather option and even gather is not working in exception subprocess, Can anyone help on this requirment.

 

Thank You!

#cpi#sapcpi#gather#ErrorHandling

View Entire Topic
Shriaunsh
Explorer
0 Kudos

Hi @Akhil0434 

sounds like you need to handle errors and send consolidated error reports via email.

Here are a few suggestions to help you achieve this:

  1. Use a Data Store: Instead of sending an email for each error immediately, you can store the error details in a Data Store. Once all records are processed, you can retrieve the stored errors and send a single email with all the error details. As suggested by @manoj_khavatkopp A Good and Clean approach!!

  2. Exception Subprocess with Aggregator: Although you mentioned that the Gather step isn’t working in the exception subprocess, you might want to try using an Aggregator pattern. This can help you collect all error messages and then process them together.

  3. Of Course Custom Script 😅: You can use a Groovy script to collect error messages. Store each error in a list and then, at the end of the process, compile these errors into a single email.

Here’s a rough outline of how you might implement the Data Store approach: I too would have done the same in your shoes!!

Step-by-Step Guide

  1. Create Data Store:

    • In your SAP CPI tenant, create a Data Store to hold error messages. You can name it something like “ErrorDataStore”.
  2. Store Errors:

    • In your exception subprocess, add a step to store each error message in the Data Store. Use a unique key for each entry to avoid overwriting.
  3. End of Processing:

    • After all records are processed, add a step to retrieve all error messages from the Data Store.
  4. Compile Errors:

    • Combine all retrieved error messages into a single string or document.
  5. Send Email:

    • Use the compiled error report to send a single email with all the error details.

Hope this helps!! Ciao! Cloud Integration