cancel
Showing results for 
Search instead for 
Did you mean: 

Enhanced Alert Notification email through SAP PI/XI

Former Member
0 Kudos

Hi All

We have configured alert notification through PI Alert configuration and we receive the notification email containing message id whenever a message is failed in the integration server.

We want to modify the default email body so as to include dynamic data from the message fields, whenever a message failes the notification email contains the whole message either in XML format or other.

I would appreciate if anyone can help me remaining in SAP PI system itself. We have SAP Netweaver PI 7.1, sp5.

Regards

Sidra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hasan

The standard alert mechanism will not able to provide you the solution of your requirement. It does not have any functions which can allow to you get the payload data and attach in the alert email.

Only one solution is coming in my mind and I don't think we have other options

1. You need to send all the alert email to a generic mail address.

2. Create one more mail-to-mail scenario where the sender mail adapter will read the alert emails.

3. Use mapping in PI which will read the message id from mail, then call a function module in abap

   which will return the payload data from message id.

   Below are sample code

CALL FUNCTION 'SXMB_GET_MESSAGE_PAYLOAD'

     EXPORTING

       im_msgkey      = ls_msgkey

       im_archive     = ' '

       im_version     = '000'

     IMPORTING

       ex_msg_bytes   = lv_bin_xml

     EXCEPTIONS

       not_authorized = 1

       no_message     = 2

       internal_error = 3

       no_payload     = 4

       OTHERS         = 5.


4. Send the payload data as attachment to the target mail group which will receive the final alert emails.

Former Member
0 Kudos

Dear sir

How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?

Thanks

Regards

karan

Former Member
0 Kudos

Thanks Indrajit

I tested the function in SE37 and i decoded the return string by ECATT_CONV_XSTRING_TO_STRING

but the value returned was only the first line of my XML message, Is is supposed to be like this or  'SXMB_GET_MESSAGE_PAYLOAD' should return the whole XML message?

Thanks for your support.

Regards

Sidra

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Hasan

You can use the  Java Mail API, here you have an example

This example differ a little from your case, but you can use to detect the mapping errors and send a notification with the payload via mail, unfortunately i dont think it can be useful for configuration problems.

Regards.