Show TOC

Configuring a Local Consumer on AS ABAPLocate this document in the navigation structure

Prerequisites

  • The user who configures the notification should have permission to maintain configuration objects in the Integration Directory. This permission is available when one of the SAP_XI_ADMINISTRATOR, SAP_XI_CONTENT_ORGANIZER, SAP_XI_CONFIGURATOR, or SAP_XI_DEVELOPER roles is assigned to the user. For more information, see Roles (AS ABAP) .

  • The SAP_XI_ALERT_CONSUMER role should be assigned to the user who configures the distribution list.

  • The system is configured to send e-mail or SMS. You can check this using transaction SCOT and ask the system administrators to configure e-mail sending. For more information, see SAPconnect (BC-SRV-COM) .

  • The system contains the e-mail addresses of the users who should receive notifications, as well as the address of the user who configures the distribution list. These addresses can be maintained using transaction SU01. For more information, see Assignment of a Company Address and Creating and Editing User Master Records .

  • Make sure the alert rules for which you need to configure e-mail notification meet all of the following requirements:

    • The alert consumer is ALERT-TO-MAIL, and all other rule parameters are configured as needed.

    • The alert rule is enabled and activated.

    For more information, see Modifying Rules .

Context

By setting an alert rule to use a local alert consumer and scheduling a background job for running a dedicated program you can configure a simple notification mechanism. Using this mechanism, the system would generate notifications upon message alert events, and would send these notifications via e-mail or SMS to users who should receive them.

Consider the following about the local alert consumer described here:

  • It applies only to the system in which you configure it. This can be any AS ABAP system where component-based message alerting is activated and an Alert Engine is running.

  • It provides only a basic set of features. In situations where you need an extended set of features you should use SAP Solution Manager, or you can implement your own alert consumer.

Procedure

  1. Access transaction SO23 and create a distribution list, or select an existing one.
  2. In the distribution list, enter the e-mail addresses of the users who should be notified when there are alerts.
  3. Access the ABAP Editor (transaction SE38) and locate the SXMSALERT_SEND_VIA_MAIL program.
  4. Create a new variant or select an existing one.
  5. Enter the values for the attributes described below and then save the variant:
    • Consumer of PI Alert : The name of the local alert consumer added to the alert rule. The default is ALERT-TO-MAIL.

    • Max chunk size for alerts read : The amount of alerts read by the program from the alert queue in the system. The default value is 5000.

    • Max detailed records in e-mail : The number of individual message details that would be included in the e-mail notification. The default value is 20.

    • Distribution List : The name of the distribution list you configured as described above.

  6. Use transaction SM36 to schedule a background job as follows:
    1. Create a new background job, and set the priority and other parameters as needed.

    2. When defining start conditions, set the background job to repeat at regular time intervals. The recommended period is 5 minutes.

    3. When defining the job's steps, specify a step for the SXMSALERT_SEND_VIA_MAIL program and the variant you configured as described above.

    4. Save the background job and then release it.

Results

When the system detects issues for which there are alert rules defined, it creates alerts. The program you configured above would generate collective notifications for each unique combination of alert rule, runtime component, and error label. Then the program would send notifications via e-mail or SMS to the users in the distribution list. For each message listed in the notification, the users can find information about the corresponding alert rule, the ID of the message, the type of error, as well as other parameters of the message header.

After starting the notification mechanism, you can configure it in the following ways:

  • To adjust the number of notifications users receive, you can modify the values of the attributes in the SXMSALERT_SEND_VIA_MAIL program using transaction SE38.

  • The frequency at which the system sends notifications depends on two factors: how often the system runs the background job you created, and how often the system sends mail. You can configure the former using transaction SM37 and the latter using transaction SCOT. This way you can adjust the length of the delay between the occurrence of the alert event, the execution of the background job that creates notifications, and the execution of the system process that sends the notifications via e-mail or SMS to their recipients.