This topic describes the Control-M for SAP Event Watcher best practice. The SAP Event based scheduling utility is a Control-M for SAP capability that enables jobs to be triggered in a specific order and conditions to be raised or deleted, based on events within the SAP System.
This best practice procedure describes how to activate Event Management, define an event rule with order job and conditions actions associated with it, run the extractor and view the ordered job and view conditions that are added to Control-M/Server.
Ensure you have installed the following:
Setting up Event Watcher Management:
You need to set up managing events to watch and execute Control-M jobs in a specific order, and add or remove active conditions based on events within the SAP system. This enables the integration of Control-M managed batch processes and flow events occurring with the SAP system.
To activate the Event Watcher for a specified connection profile:
The following window appears:
This ensures that when the Event Watcher is activated, no old existing events are watched.
The Clear Events action changes the status of any new event that occurred previously, to Confirmed. This ensures that when the Event Watcher is activated, no old existing events are watched.
The Event Watcher is now activated to watch for events for a specified connection profile.
To add an event:
The Add Event dialog box appears.
NOTE: * catches any SAP_Test events with any parameter value.
See the screenshot below for an example of the Event ID and Parameter:
To order a job for event confirmation:
The Add Control-M Job to Order dialog box appears.
NOTE: The job name and folder name should already have been defined in Control-M before running the Event Watcher.
In the case of a sub-table, use "/" to separate between table names.
See the screenshot below for an example of a Control-M Job to order.
The expanded Add Control-M Job to Order dialog box appears.
The Add Variables window appears.
See the screenshot below for an example of a variable.
NOTE: Structure: %%<variable name> <variable value>
This procedure describes how to add conditions to events so that Control-M for SAP can perform the required procedure when the specified condition has occurred.
To add conditions to event confirmations:
The Add Control-M Condition window appears.
If the Name parameter is left empty, the condition created in Control-M is named in the following way:
sap_<Event_ID>_<Event_Param>
If the Event ID parameter value is SAP_END_OF_JOB, the SAP event parameter value is truncated, and the job count number is omitted from the condition.
See the screenshot below for adding a condition:
You can now close the CCM.
Raising a SAP event
This procedure describes how to enable a specific SAP background processing event to be raised (triggered).
Before you begin
Do one of the following:
To raise a SAP event:
ctmr3req -SAPR3-ACTION raise_event -SAPR3-ACCOUNT <account_name>
-SAPR3-EVENT_ID <event_ID> -SAPR3-EVENT_PARAM <event_parameter>
<Agent home directory>\CM\SAP\EXE\ctmr3req -SAPR3-ACTION raise_event
-SAPR3-ACCOUNT <account_name> -SAPR3-EVENT_ID <event_ID>
-SAPR3-EVENT_PARAM <event_parameter> [-Agent <agent_name>]
Example: Windows
ctmr3req -SAPR3-ACTION raise_event -SAPR3-ACCOUNT PI4 -SAPR3-
EVENT_ID SAP_TEST -SAPR3-EVENT_PARAM this is test value
Event raised successfully.
Starting the Extractor service
You need to ensure that the Extractor Management service (Windows) or process (UNIX) is running to use the Event Watcher. Only one Extractor Management service (Windows) or process (UNIX) can be running at the same time for each SAP system.
To start the Extractor service:
start-xt
To Monitor the Control-M for SAP job ordered as a result of the SAP Event confirmation:
The Job properties appear.
In the General tab, the folder name and job name is the same as specified in the event rule.
In the Variables area, you can see the variables that are automatically created together with the variable defined in the Event Watcher CCM.
To view the condition that was added to Control-M/Server:
Example: Type the following:
ctmcontb -list * 0715
Output:
Date: 15 February 2016. Page: 1
Conditions list
---------------------------------------------------------------------
CONDNAME CONDATE
---------------------------------------------------------------------
sap_ER1_my 0715
Result: Success
Since we defined the condition without a condition name, the default name was created:
sap_<EVENT ID value>_<EVENT Parameter value>
Parent Topic |