How to Configure Email Notifications in SAP BW Bridge

Estimated read time 10 min read

Almost every SAP BW or SAP BW/4HANA system employs process chains to manage data loads, activate requests, schedule housekeeping tasks, and more. In most of these systems, email alerts are set up to notify you when steps in process chains fail, start late, or run longer than expected. This guide will walk you through the process of configuring email notifications for process chains in SAP BW bridge.

Prerequisites

In SAP BW bridge, you need to provide your own SMTP server to send outbound emails. This server can be within your corporate network behind a firewall or publicly accessible on the internet. Since SAP BW bridge is a public cloud offering, using a publicly available SMTP server simplifies the configuration process. If your SMTP server is within your corporate network, you’ll need to expose it to the internet, such as by configuring it in the Cloud Connector. For detailed instructions, refer to SAP Help. Note that mail destinations are not supported for BW bridge because a BW bridge system is not visible in your BTP account.

Configuration

First, create a communication system that represents the SMTP server.

Logon to your SAP BW Bridge Cockpit.Under Communication Management, open the app Communication Systems.Click New to create a new communication system.Under Technical Data > General, maintain the host name and port of the SMTP server.Switch on Cloud Connector only if the SMTP server is exposed to the Internet via SAP Cloud Connector.Under Users for Outbound Communication, click + to add user and password that can be used by SAP BW bridge to logon to the SMTP server.Save the new communication system.

Then, set up a communication arrangement for outbound emails.

Under Communication Management, open the app Communication Arrangements.Click New to create a new communication arrangement.Choose SAP_COM_0548 as communication scenario and enter a meaningful name for the communication arrangement.As Communication System, choose the one you created before. The Outbound Communication section will automatically show the user configured in that system.Make sure that the Service Status in Outbound Services is set to Active.

Next, choose the events and process chains for which you want to receive email notifications.

In the SAP BW Bridge Cockpit, click on your initials in the upper right corner and select Settings.Under Subscriptions, switch to tab Process Chains and click on Send Dummy Notifications.

 

Close Settings and ensure that you have received a long list of notifications, such as ‘A process chain run for chain %TESTNOTIF_VERY_LONG takes much too long’.

Click again on your initials and Sign Out.Sign on again, click on your initials once more, open the Settings dialog and select Notifications. There, you can disable specific notification types, such as those for completed process chain runs.

Under Subscriptions, you can set up notifications for process chains that you have triggered. By clicking the + icon, you can optionally specify which process chains you want to receive notifications for.

We’re almost there, but there’s an important detail to consider. Process chains in BW bridge are scheduled for the technical user SAP_SYSTEM which does not have an email address. Your SMTP server will typically reject emails sent by SAP_SYSTEM since it lacks a valid sender mail address. However, you can easily set a default sender address by coding and running a small ABAP class.

Open BW Modeling Tools and logon to your ABAP Cloud project.Right-click the project name and select New > ABAP Class.In the New ABAP Class dialog, select a package, enter a name and description for the class, and add the interface IF_OO_ADT_CLASSRUN.

Select a transport request or create a new request.Copy and paste the coding below.CLASS zcl_configure_outbound_mails DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES if_oo_adt_classrun .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_configure_outbound_mails IMPLEMENTATION.

METHOD if_oo_adt_classrun~main.

DATA(config_instance) = cl_bcs_mail_system_config=>create_instance( ).

TRY.
* activate mail config options
config_instance->set_address_check_active( iv_address_check_active = abap_true ).

* set default sender mail address
config_instance->modify_default_sender_address( iv_default_address = ‘noreply+BWBridge@mycompany.com’
iv_default_name = ‘Default Sender’ ).

* set allowed domains for email recipients
config_instance->add_allowed_recipient_domains( it_allowed_rec_domains = VALUE #( ( ‘*@mycompany.com’ ) ) ).

CATCH cx_bcs_mail_config INTO DATA(write_error).
“handle exception
out->write( ‘Oops, something went wrong’ ).
RETURN.
ENDTRY.

out->write( ‘Configuration was saved’ ).

ENDMETHOD.
ENDCLASS.Adapt the email address and the name of the default sender (in lines 23/24) and the allowed domain for email recipients (in line 27). Make sure to use a pattern for the allowed domain for email recipients, including the asterisk (*) as shown in the example above.Activate the class.Right-click your class and select Run As > ABAP Application (Console) or select your class and press F9. You should see the message “Configuration was saved” in the ABAP Console.
See SAP Help for additional details on how to configure outbound mails.

That’s it! You’re now ready to start receiving email notifications for process chains.

You can monitor outbound emails in the app Monitor Email Transmissions. Your business user needs the business role SAP_BR_ADMINISTRATOR to see this app. 

The app shows failed or pending email transmissions. For failed email transmissions, you’ll see the status code and the response which should give you a hint on the root cause of the failure.

You can also use the app to send a test mail.

I hope this guide helped clarify how to receive mail notifications in SAP BW bridge. If you have questions or insights to share, feel free to drop them in the comments! 

 

​ Almost every SAP BW or SAP BW/4HANA system employs process chains to manage data loads, activate requests, schedule housekeeping tasks, and more. In most of these systems, email alerts are set up to notify you when steps in process chains fail, start late, or run longer than expected. This guide will walk you through the process of configuring email notifications for process chains in SAP BW bridge.PrerequisitesIn SAP BW bridge, you need to provide your own SMTP server to send outbound emails. This server can be within your corporate network behind a firewall or publicly accessible on the internet. Since SAP BW bridge is a public cloud offering, using a publicly available SMTP server simplifies the configuration process. If your SMTP server is within your corporate network, you’ll need to expose it to the internet, such as by configuring it in the Cloud Connector. For detailed instructions, refer to SAP Help. Note that mail destinations are not supported for BW bridge because a BW bridge system is not visible in your BTP account.ConfigurationFirst, create a communication system that represents the SMTP server.Logon to your SAP BW Bridge Cockpit.Under Communication Management, open the app Communication Systems.Click New to create a new communication system.Under Technical Data > General, maintain the host name and port of the SMTP server.Switch on Cloud Connector only if the SMTP server is exposed to the Internet via SAP Cloud Connector.Under Users for Outbound Communication, click + to add user and password that can be used by SAP BW bridge to logon to the SMTP server.Save the new communication system.Then, set up a communication arrangement for outbound emails.Under Communication Management, open the app Communication Arrangements.Click New to create a new communication arrangement.Choose SAP_COM_0548 as communication scenario and enter a meaningful name for the communication arrangement.As Communication System, choose the one you created before. The Outbound Communication section will automatically show the user configured in that system.Make sure that the Service Status in Outbound Services is set to Active.Next, choose the events and process chains for which you want to receive email notifications.In the SAP BW Bridge Cockpit, click on your initials in the upper right corner and select Settings.Under Subscriptions, switch to tab Process Chains and click on Send Dummy Notifications. Close Settings and ensure that you have received a long list of notifications, such as ‘A process chain run for chain %TESTNOTIF_VERY_LONG takes much too long’.Click again on your initials and Sign Out.Sign on again, click on your initials once more, open the Settings dialog and select Notifications. There, you can disable specific notification types, such as those for completed process chain runs.Under Subscriptions, you can set up notifications for process chains that you have triggered. By clicking the + icon, you can optionally specify which process chains you want to receive notifications for.We’re almost there, but there’s an important detail to consider. Process chains in BW bridge are scheduled for the technical user SAP_SYSTEM which does not have an email address. Your SMTP server will typically reject emails sent by SAP_SYSTEM since it lacks a valid sender mail address. However, you can easily set a default sender address by coding and running a small ABAP class.Open BW Modeling Tools and logon to your ABAP Cloud project.Right-click the project name and select New > ABAP Class.In the New ABAP Class dialog, select a package, enter a name and description for the class, and add the interface IF_OO_ADT_CLASSRUN.Select a transport request or create a new request.Copy and paste the coding below.CLASS zcl_configure_outbound_mails DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES if_oo_adt_classrun .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.

CLASS zcl_configure_outbound_mails IMPLEMENTATION.

METHOD if_oo_adt_classrun~main.

DATA(config_instance) = cl_bcs_mail_system_config=>create_instance( ).

TRY.
* activate mail config options
config_instance->set_address_check_active( iv_address_check_active = abap_true ).

* set default sender mail address
config_instance->modify_default_sender_address( iv_default_address = ‘noreply+BWBridge@mycompany.com’
iv_default_name = ‘Default Sender’ ).

* set allowed domains for email recipients
config_instance->add_allowed_recipient_domains( it_allowed_rec_domains = VALUE #( ( ‘*@mycompany.com’ ) ) ).

CATCH cx_bcs_mail_config INTO DATA(write_error).
“handle exception
out->write( ‘Oops, something went wrong’ ).
RETURN.
ENDTRY.

out->write( ‘Configuration was saved’ ).

ENDMETHOD.
ENDCLASS.Adapt the email address and the name of the default sender (in lines 23/24) and the allowed domain for email recipients (in line 27). Make sure to use a pattern for the allowed domain for email recipients, including the asterisk (*) as shown in the example above.Activate the class.Right-click your class and select Run As > ABAP Application (Console) or select your class and press F9. You should see the message “Configuration was saved” in the ABAP Console.See SAP Help for additional details on how to configure outbound mails.That’s it! You’re now ready to start receiving email notifications for process chains.You can monitor outbound emails in the app Monitor Email Transmissions. Your business user needs the business role SAP_BR_ADMINISTRATOR to see this app. The app shows failed or pending email transmissions. For failed email transmissions, you’ll see the status code and the response which should give you a hint on the root cause of the failure.You can also use the app to send a test mail.I hope this guide helped clarify how to receive mail notifications in SAP BW bridge. If you have questions or insights to share, feel free to drop them in the comments!    Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author