Skip to Content

Here is a step-by-step example for enabling alert notification for Account changes.

1. Define Connection to Central Alert Server

In transaction SPRO go to path Customer Relationship Management->Basic Functions->Alert
Management->Define Connection to Central Alert Server.

/wp-content/uploads/2015/04/temp1_688826.png

Use search help to select the RFC destination for the system (and client) in which your Central Alert Management is running. The alerts are forwarded from this system by RFC to the central alert server, from where they are delivered centrally. Alert categories must be defined on the central alert server.

If this system is the central system, on which all alert categories are defined, and from which the alerts are delivered, enter NONE as the RFC destination.

2. Define alert classifications

This step is optional. These are useful to group alert categories.

/wp-content/uploads/2015/04/temp2_688827.png

/wp-content/uploads/2015/04/temp3_688828.png

3. Define alert categories

The  category contains various properties and other specifications that define the alerts within that category, for example expiry date, or the escalation recipient. For example, you can create the alert categories Contract Cancelled and Decrease in Sales. When the critical situation defined in the alert category arises, the system recognizes this and sends an alert instance of this category to the recipients determined. The alerts can always be found in the display programs configured for the recipient (UWL, application-specific program, or alert inbox). Additionally, the alerts are sent via eventual external communication channels, such as e-mail, sms, or fax.

/wp-content/uploads/2015/04/temp5_688830.png

/wp-content/uploads/2015/04/temp6_688831.png

On the Container tab page, define any variables that you may want to use in the short text or long text.

/wp-content/uploads/2015/04/temp7_688832.png

/wp-content/uploads/2015/04/temp8_688833.png

On the Long and Short Text tab page, enter texts for the alert category.

/wp-content/uploads/2015/04/temp10_688838.png

You can include text variables referring to elements of the alert container or system symbols.

/wp-content/uploads/2015/04/temp9_688834.png

4. Determine recipients

/wp-content/uploads/2015/04/temp11_688839.png

/wp-content/uploads/2015/04/temp12_688840.png

5. Triggering alerts

Alerts of a particular category must be triggered by an application at runtime. Triggering alerts can be done in various ways. You can call a function module
directly or use middleware components that trigger alerts, such as the Business Object Repository (BOR), Post Processing Framework (PPF), SAP Workflow, or CCMS.

In this example the alert is triggered by function module call in the Save event handler of the UI component view. This is done in transaction BSP_WD_CMPWB – UI Component Workbench.

/wp-content/uploads/2015/04/temp13_688847.png

eh_onsave.

  CALL METHOD super->eh_onsave

    EXPORTING

      htmlb_event    = htmlb_event

      htmlb_event_ex = htmlb_event_ex

    IMPORTING

      ev_success     = ev_success.

  DATA: lr_builheader    TYPE REF TO cl_crm_bol_entity,

        l_t_swcont_alert TYPE TABLE OF swcont,

        l_s_swcont       TYPE swcont,

        lv_bpnumber      TYPE        bu_partner.

  lr_builheader ?= me->typed_context->builheader->collection_wrapper->get_current( ).

  check lr_builheader is bound.

  lr_builheader->get_property_as_value( EXPORTING iv_attr_name = ‘BP_NUMBER’

                                       IMPORTING ev_result    = lv_bpnumber ).

  l_s_swcontelement = ‘BP_NUMBER’.

  l_s_swcontvalue   = lv_bpnumber.

  APPEND l_s_swcont TO l_t_swcont_alert.

  IF l_t_swcont_alert IS NOT INITIAL.

*     build container via macros

    CALL FUNCTION ‘RSRAS_BUILD_CAM_CONTAINER’

      TABLES

        c_t_swcont = l_t_swcont_alert.

  ENDIF.

*** trigger SAP alert

  CALL FUNCTION ‘SALRT_CREATE_API’

    EXPORTING

      ip_category            = ‘ZBP_CHANGE’

      ip_wait_on_commit      = ‘ ‘

    TABLES

*     it_activities          = l_t_activity

      it_container           = l_t_swcont_alert

    EXCEPTIONS

      alert_category_unknown = 1

      alert_no_recipients    = 2

      alert_error_unknown    = 3

      destination_undefined  = 4

      communication_failure  = 5

      system_failure         = 6

      OTHERS                 = 7.

ENDMETHOD.

6. Result

After Save button is pushed on the Account overview page, the alert is sent to the specified recipients.

/wp-content/uploads/2015/04/temp15_688848.png

/wp-content/uploads/2015/04/temp16_688849.png

7. Reference

More info about Alert can be found on the page below.

http://help.sap.com/saphelp_crm700_ehp03/helpdata/en/49/47823a37042221e10000000a42189d/frameset.htm

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply