Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
nageshwar_reddy
Contributor

If you are in a brand new ECC implementation which has a phased approach with only essential systems in the landscape in phase one, what are the options you have to handle application errors? If the program is scheduled to run in the background, how do you notify business users? If it is an incoming interface with errors while processing the data in ECC, how do you notify the business users? If you are constrained to use only the ECC infrastructure that is available in phase one, how do you handle the application errors? If you have program/interface specific notification requirements, like each program/interface having different set of business users to be notified, how do you handle?

Under the above constraints and requirements, the approach i used couple of years back was to use distribution list and emailing functionality that is available in ECC to notify business users. The advantages of this approach is that this is very simple and meets the requirements and it is very easy to implement.

The steps to implement the solution are:

1. Create the distribution list

2. Use the distribution list wherever required

The below screenshots briefly show how to create distribution list. Additional information on this is available at multiple places SCN and SAP help.

Use transaction SO23 / SBWP=> Distribution List to create a distribution list.

Add recipients. Many options are available for adding recipients. 

Use the following code to send the email to a distribution list.

**********************************************************************
* FORM    :  send_notification
*********************************************************************
FORM send_notification .
  DATA: wa_maildata TYPE sodocchgi1,
              it_reclist TYPE TABLE OF somlreci1,
              wa_reclist TYPE  somlreci1.
  wa_maildata-obj_name = 'TESTOBJ'.
  wa_maildata-obj_descr = text-030.
  wa_maildata-sensitivty = 'P'.
  wa_reclist-receiver = 'ZNR_I0001'.
  wa_reclist-rec_type = 'C'.
  APPEND wa_reclist TO it_reclist.
  CLEAR wa_reclist.
  wa_mailtxt =  'Do not reply to this system generated email'(032).
  append wa_mailtxt to it_mailtxt.
  CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = wa_maildata
      document_type              = 'RAW'
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      object_content             = it_mailtxt
      receivers                  = it_reclist
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      OTHERS                     = 8.
  IF sy-subrc <> 0.
    sy-subrc = 0.
  ENDIF.
ENDFORM. "send_notification

Assumptions:

All business users are maintained in the system with correct email addresses.

SCOT configuration is complete and set up to send emails.

Additional details on distribution list are available at Working with Distribution Lists

3 Comments