Skip to end of metadata
Go to start of metadata

HowTo: Enhancement for End-User Experience Monitoring


Content

  1. Overview
  2. Enhancements points in EEM application
    1. Script Notification
  3. Step by step description
    1. Enhance Source Code
    2. Show Implicit Enhancement Options
    3. Create Enhancement
  4. Examples
    1. Change the status of an execution
    2. Sending email/SMS Notification
  5. Appendix
    1. z_eem_check_downtime

Overview

This document describes how to enhance the End-user Experience Monitoring (EEM) for customer needs by using implicit enhancement options.
General information about the SAP Enhancement Framework can be found here.

Enhancements points in EEM application

Script Notification

When a script is executed on an EEM Robot the result and the response times are sent to the SAP Solution Manager by calling the function module AI_EEM_SCRIPT_NOTIFICATION.

This function module can be used to:

  • Change the status of an execution
  • Trigger a Mail/SMS Notification

Step by step description

This chapter describes how to create an enhancement step by step.

Enhance Source Code

Choose the function module in the editor and select from menu Enhance Source Code:

Show Implicit Enhancement Options

Choose from menu Edit->Enhancement Operations->Show Implicit Enhancement Options:

Result
Implicit Enhancements are displayed:

Create Enhancement

Select the displayed enhancement ideally the one before the event ENDFUNCTION and choose from menu
Edit->Enhancement Operations-> Create Enhancement

In the following pop-up choose 'Code':

Enter a meaningful name and description create a Composite Enhancement Implementation (like ZEEM below) which can be assigned to a customer development class.

Examples

 The following examples make only sense for SAP Solution Manager 7 EhP1 (7.01).

Change the status of an execution

In this example the downtimes of the involved systems from SAP Solution Manager Downtime Manager (Transaction SOLMAN_DOWNTIME_MGMT) are read and if a downtime was planned the status of the execution (ls_scenario_exe-availability) is set to a predefined value.


Sourcecode

Sending email/SMS Notification

In this example an own developed class is called which decides based on some persisted rules if a mail has to be send to some maintained recipients. Class ZCL_EEM_MAIL is an enhanced copy of the tutorial CL_BSP_TUT_MAIL.

Examples for sending mails are described in online help by copying class CL_BSP_TUT_MAIL

Appendix

z_eem_check_downtime


z_eem_check_downtime
FUNCTION z_eem_check_downtime.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(TECH_SCEN_NAME) TYPE  SMSY_GROUPNAME
*"     REFERENCE(TIMESTAMP) TYPE  TIMESTAMP
*"     REFERENCE(END_TIMESTAMP) TYPE  TIMESTAMP OPTIONAL
*"  EXPORTING
*"     REFERENCE(DOWNTIME) TYPE  ABAP_BOOL
*"     REFERENCE(DT_FROM) TYPE  TIMESTAMP
*"     REFERENCE(DT_UNTIL) TYPE  TIMESTAMP
*"----------------------------------------------------------------------

  DATA: lt_sids TYPE cl_eem_technical_scenario=>gt_lsid,
        l_sid LIKE LINE OF lt_sids.
  DATA: lt_downtimes TYPE tsdtsdur,
        ls_downtime LIKE LINE OF lt_downtimes,
        compkey TYPE dtscompkey.

  CALL METHOD cl_eem_technical_scenario=>get_technical_abap_systems
    EXPORTING
      tech_scen_name    = tech_scen_name
    IMPORTING
      technical_systems = lt_sids.
  LOOP AT lt_sids INTO l_sid.
    REFRESH: lt_downtimes.
    compkey = l_sid.
    TRY.
        CALL METHOD cl_dts_query_service=>get_downtimes
          EXPORTING
            ip_component_key  = compkey
            ip_component_type = if_dts_reader=>c_comptp_smsy
*    ip_from           =
*    ip_until          =
*    ip_category       = IF_DTS_READER=>C_CAT_PLANNED_DOWNTIME
          IMPORTING
            et_downtimes      = lt_downtimes
            .
        IF end_timestamp IS INITIAL.
          LOOP AT lt_downtimes INTO ls_downtime WHERE dt_from < timestamp AND dt_until > timestamp.
            downtime = abap_true.
            dt_from = ls_downtime-dt_from.
            dt_until = ls_downtime-dt_until.
            RETURN.
          ENDLOOP.
        ELSE.
          LOOP AT lt_downtimes INTO ls_downtime WHERE dt_from < timestamp AND dt_until > timestamp OR
            dt_from < end_timestamp AND dt_until > timestamp.
            downtime = abap_true.
            dt_from = ls_downtime-dt_from.
            dt_until = ls_downtime-dt_until.
            RETURN.
          ENDLOOP.
        ENDIF.
      CATCH cx_dts_api .
    ENDTRY.

  ENDLOOP.
ENDFUNCTION.
  • No labels