SAP: Event History Monitor

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at https://www.stonebranch.com/integration-hub/Terms-and-Privacy/Terms-of-Use/

Introduction

This Universal Task queries the SAP Event history table for a selected SAP Event & Parameter. If the Event is found, it gets confirmed, so that it is not triggered again. Optionally, a task can be launched based on the occurrence of an Event & Parameter.

Software Requirements

Software Requirements for Universal Agent

  • Universal Agent for Linux or Windows Version 7.0.0.0 or later is required.

  • Universal Agent needs to be installed with python option (--python yes).

Software Requirements for Universal Controller

  • Universal Controller 7.0.0.0 or later is required.

Software Requirements for the Application to be Scheduled

SAP Credentials (Username and Password) to connect via the XBP-RFC Interface to SAP ERP System is required.

Key Features

Some details about Universal Tasks to monitor the SAP Event History:

  • Query the SAP Event history table for a selected SAP Event & Parameter.

  • For the Parameters, wildcards “*” are supported.

  • Confirm Events in the SAP History Table ( SM62). When the Event and Parameter have been identified, the Event is confirmed in SAP so that the monitor will not trigger a second time (optional setting).

  • Launch a task in Universal Controller based on the occurrence of an Event & Parameter.

  • The Universal Task is supported on Linux and Windows Agents.

  • An automatic re-start of the task can be achieved by adding an action to the Universal Task, which restarts the task in the case of status success.

  • This Universal Task supports SAP Application Server and SAPNWRFC.INI Destination connections.

  • You can set different log-levels for the Universal task, which provides you more information in case of issues.

Import the SAP Event History Monitor Universal Template

To use the SAP Event History Monitor Template, you first must perform the following steps:

  1. This Universal Task requires the /wiki/spaces/UC71x/pages/5178443 feature. Check that the/wiki/spaces/UC71x/pages/5177877 system property has been set to true.
  2. Download the provided ZIP file.
  3. In the Universal Controller UI, select Configuration > Universal Templates to display the current list of /wiki/spaces/UC71x/pages/5178076.

  4. Click Import Template.
  5. Select the template ZIP file and Import.

When the template has been imported successfully, the Universal Template will appear on the list. Refresh your Navigation Tree to see these tasks in the Automation Center Menu.

Configure SAP Task for Batch Input

For Universal Task SAP Event History Monitor, create a new task and enter the task-specific Details that were created in the Universal Template.

Field Descriptions for SAP Task for Batch Input

Fill Out the Universal Task for each SAP Event and Parameter to monitor.

FieldDescription

Agent

Linux or Windows Universal Agent to run the USAP commands.

Agent Cluster

Optional Agent Cluster for load balancing.

SAP Connection Type

[ Application Server Connection, SAPNWRFC.INI Connection ]

The Universal Task support SAP Application Server and SAPNWRFC.INI Destination connections.

Application Server Connection:

  • Client: SAP Client to connect to; for example, 100

  • SAP SysNr: SAP System Number; for example, 00

  • ASHOST: SAP Application Server hostname or IP; for example, walldorf

SAPNWRFC.INI Connection:

  • Client: SAP Client to connect to; for example, 100

  • Destination: name of the destination entry in the file sapnwrfc.ini; for example, walldorf


Note

The file sapnwrfc.ini needs to be in the home directory of the user executing the task.

If no user credentials are provided, this is:

  • Linux: /opt/universal/uagsrv

  • Windows: C:\Program Files\Universal\UAGSrv

SAP ASHOST

SAP Application to connect to.

This field is visible only if SAP Connection Type = “Application Server Connection”

SAP CLIENT

SAP Client ( 3 digits ); for example, 100

The Imported calendar will have the SID as prefix

Imported Calendar Name:

<SID>_<SAP CLIENT>_<SAP CALENDAR ID>

SAP SysNr

SAP System Number ( 2 digits ) e.g. 00

This field is visible only if SAP Connection Type = “Application Server Connection

SAP Destination

SAP Destination in the nwrfc.ini.

This field is visible only if SAP Connection Type = “NRFW.ini Connection

USAP Dir

Directory where the USAP binary is stored

Linux: /opt/universal/usap/bin

Windows: C:\Program Files\Universal\USap\bin

Event ID

Name of the Event to Scan for in the SAP Event History Table.

Event Parameter

Name of the parameter to scan for. Note: wildcard “*” is supported ; for example, ua* searches for all event parameters beginning with ua.

to scan for any Event Parameter, enter “*”.

“*” also matches if no Event Parameter is provided in SM62.

Event Status to Select

[ New, Confirmed, Any Status ]

  • NEW: scan only for new Events (default).

  • Confirmed: scan only for confirmed Events.

  • Any Status: scan for any status of Events.

Universal Controller URL

Universal Controller URL.

For example, https://192.168.88.40/uc

Task(s)

Name of the tasks to start in case a new event has been identified. Multiple tasks are separated by a Comma.

e.g., FINANCE_REPORT1, FINANCE_REPORT2, FINANCE_REPORT3

If no task is specified, the UT runs in monitoring mode and goes to success in case an Event has been identified; for example, you can add the Event Monitor to a Workflow. (Note: In that case, remove the action, which automatically re-starts the UT in if status is “success”)

Confirm Events

[ Confirm , New ]

Default is “Confirm”.

Confirm: This ensures that the same event only triggers the event monitor once.

New: Leaves the event in status “New”, mainly for testing purpose.

USAP loglevel

Log level of the Universal Connector for SAP

trace | audit | info | warn | error

rfc_logon_retry_interval in s

interval in seconds between an new logon attempt to SAP.

Per default, 10 retries will be performed; for example, 120s means every 120s a new logon attempt to SAP is performed. If after 10 retries no logon to SAP was possible the Task fails.

Loglevel

Universal Task logging settings

[DEBUG | INFO| WARNING | ERROR | CRITICAL]


Example for SAP Event History Monitor Task

The following example monitors the SAP Event: UAC_TEST with Parameter: UAC in the SAP Event History.

If the Event occurs in the SAP Event history table with status “NEW”, the Task “Collect_Orders” is launched and the Event is confirmed in SAP.

In the following example, the Parameter “Multilaunch” is enabled. This means that if several events are found with the status “New”, the task “Collect_Orders” will be launched for each confirmed event.

Event Configuration in SAP

The SAP History Event Task Monitor scans for Events in the SAP Event history.

An Event only shows up in the Event history if an appropriate event criteria profile has been set-up in SAP by using transaction SM62.

Note

Optionally, a criteria profile can also be set-up via an SAP Task of command group “Set CM Profile” in Universal Controller.

The following screen shows an example of the set-up in SAP using SM62.

Event History Table

The following provides and example of the Event history table in SAP (SM62).

Only Events showing up here can trigger the SAP Event History Monitor UT.

Task Monitor Trigger mode

You can create a Task Monitor trigger from this task by adding an action to the Universal Task, which restarts the task in the case of status success.