Show TOC

Procedure documentationInstrumenting the Business Process Completeness Check

 

If you want to monitor business process steps with the Business Process Completeness Check, you need to instrument them in the source code of the managed systems. The instrumentation can be done via implicit or explicit enhancement points when enhancing SAP coding, or it can be done directly in customer coding.

For more information on the Exception Management Instrumentation Platform, see Exception Management Instrumentation Platform.

Prerequisites

  • You have configured the business process and the subprocess that you want to as categories and subcategories in the Exception Management Instrumentation Platform configuration

  • You have assigned business process type IDs to the subcategories.

  • You have identified the business process steps that you want to instrument.

    Usually, not all of the process steps and unit calls are critical and need to be instrumented. Consider also the following rules:

    • Remote function calls to other systems have to be instrumented as process steps.

    • To get the correct sequence of the steps, the calling system should be instrumented as well as the called system.

    • Error messages can only be logged for units (function calls and methods).

    • Explicit COMMITS should not occur within a step, but outside of the step.

Procedure

This procedure describes how you can instrument the process steps directly in the custom coding.

  1. Initialize the SAP Business Passport.

    Create a GUID for the business process instances.

    Syntax Syntax

    1. * Create Business Process Instance
    2. ID CALL FUNCTION 'GUID_CREATE'
    3.  IMPORTING
    4.   ev_guid_32 = l_instance_id.
    End of the code.

    Write this GUID to the passport. Use the business process type ID (i_bpt_id) configured in the Exception Management Instrumentation Platform configuration to identify the process.

    Syntax Syntax

    1. * Initially write the instance ID to the passport
    2. /sdf/cl_em_ipa_write=>initialize_process(
    3.  i_bpi_id = l_instance_id
    4.  i_bpt_id = p_ptype).
    End of the code.
  2. Instrument the start of the first process step. Use a descriptive name for the step (Step 1).

    Syntax Syntax

    1. ** EM Instrumentation: create start step via EM-IPA
    2. /sdf/cl_em_ipa_write=>start_step(
    3. i_step_name = 'Step 1').
    End of the code.
  3. Instrument the end of the process step.

    Syntax Syntax

    1. ** create end step via EM-IPA
      
    2. /sdf/cl_em_ipa_write=>end_step( ).
    End of the code.
  4. Between the start of the step and the end of the step, instrument the units (function calls and methods) of the process step. Possible unit types are:

    • ABAP function modules

    • ABAP form routines

    • BAPIs

    • Web service calls

    • ABAP class methods

    Syntax Syntax

    1. /sdf/cl_em_ipa_write=>create_unit_entry(
    2.  i_unit_name = 'ZFM_ORDER_UPDATE'
    3.  i_unit_type = 'ABAP Function Module'
    4.  it_parameter = lt_param
    5.  it_bapiret = lt_msg ).
    End of the code.
  5. In the same manner, instrument further process steps.

  6. Instrument the saving of the data at the end of the business process or at the end of the function call (LUW).

    When the process runs across different systems, at least one save data should exist before the another system is called, if not the data won't be logged.

Note Note

If you want to instrument the process steps in SAP coding, use implicit enhancement options. To display the implicit enhancements options, in the ABAP system, choose Start of the navigation path Edit Next navigation step Enhancement Options Next navigation step Show Implicit Enhancement Options End of the navigation path .

End of the note.