Previous Topic

Next Topic

Book Contents

Book Index

Control-M for SAP intercept - best practice

Control-M has the ability to intercept jobs submitted adhoc in SAP from either SM36 or as a background process. This topic addresses how we integrate and what is needed from Control-M for intercepting and controlling these adhoc jobs. It affects the production SAP processes by submitting jobs that use a lot of resources. For example, an end user submits a background process that then releases over 400 child processes. These child processes then require an incredible amount of CPU and memory to process. They have no control over these.

SAP Extraction Installation

As part of the install for the SAP Application plug in, the extraction component is added. For Windows a service is created called Control-M for SAP Extractor. For Unix/Linux there is an executable called start-xt located in <ctmagent_install>/cm/SAP/exe. Starting this executable starts the extraction process.

In a Unix/Linux environment there is a command in the same exe directory called sapcmbe.sh. This command is used to start/stop the SAP Container and also to check the status of both the SAP Container and the extractor. The command should be run using the install user, not root. Using the command ./sapcmbe.sh status should give this result if nothing is active:

hou-sc-sager% cd ctm_agent/ctm/cm/SAP/exe

hou-sc-sager% ./sapcmbe.sh status

Getting Control-M for SAP status...

Linux-x86_64

Control-M for SAP is not running, at 127.0.0.1 port:38180

Control-M for SAP Extractor process is not running

Build number: 20160119-2026

If the SAP Container is running but the extract is not it looks like this:

hou-sc-sager% ./sapcmbe.sh status

Getting Control-M for SAP status...

Linux-x86_64

Control-M for SAP is running at 127.0.0.1:38180 from: '/home/ctmuser/ctm_agent/ctm/cm/SAP'

Control-M for SAP Extractor process is not running

Build number: 20140119-2026

After using the ./start-xt the result of sapcmbe.sh status should look like this:

hou-sc-sager% ls *xt

Readme.txt p_ctmxt shut-xt start-xthou-sc-sager% ./start-xt

Starting Control-M for SAP Extractor

p_ctmxt started. PID : 18766

nohup: redirecting stderr to stdout

hou-sc-sager% ./sapcmbe.sh status

Getting Control-M for SAP status...

Linux-x86_64

Control-M for SAP is running at 127.0.0.1:38180 from: '/home/ctmuser/ctm_agent/ctm/cm/SAP'

Control-M for SAP Extractor process is running, PID 18766

Build number: 20140119-2026

*** If you are using sapcmbe.sh to start the SAP Container user an & for background:

./sapcmbe.sh start &

To define the Extractor Properties in CCM:

  1. From the CCM, right click Control-M for SAP and click Extractor Management.

    S_BEST_SAPEX_CCM

    NOTE: Ensure that you have already defined a SAP Connection Profile.

    The Control-M for SAP - Extractor Management window appears:

    S_BEST_SAPEX_Extract

    NOTE: For XBP 3.0 we really do not use the Extraction priority or Extraction Criteria.

  2. Set the Spawned jobs and Intercepted jobs priorities in order and change the default for Interval Time to 20 seconds. By default it is 120.
  3. In the Connection Profile Name field, select the connection profile you want to use.
  4. In the SAP Interception Profiles tab, click Load for the SAP CRITERIA_MANAGER definitions.

    NOTE: These Profiles are usually set and defined in SAP. Even though we can see and update them here, it should still be a SAP responsibility. The SAP Interception Profiles are where they define what is to be intercepted.

    There are four fields that can be looked at in SAP to determine if a job should be intercepted. The most commonly used are either Jobname or Creator. These allow SAP to choose only the job or submitter to be intercepted. Client and Class are not used very often.

    S_BEST_SAPEX_Inter

    Once the Profile definition in SAP CRITERIA_MANAGER has been selected and set to active, SAP starts to intercept those jobs. If you were looking in SAP in the SM36 screen, you would see the status of Intercepted. These jobs stay in intercepted status until Control-M intercepts and initializes them.

Defining the Control-M SAP Control-M Interception rules

While the SAP Interception Profiles tab shows what is being intercepted in SAP, it is the Control-M Interception Rules tab that determines what Control-M will intercept and what it will do with the jobs once they are intercepted.

In this example you will see two definitions for intercepting SAP jobs. The second line is a default that cannot be deleted. It is what happens to any intercepted job that we have not created a rule for. Basically any job without a rule will be brought in to run using the default_order executable in the same directory as the other CM executables. If this file is not changed it brings jobs in with a ctmcreate command:

CTMCREATE -agent Default -TASKTYPE JOB -JOBNAME SAP_ABANDONED -MEMNAME %1 -MEMLIB UNUSED -OWNER %3 -NODEGRP %ag_logical_name% -APPLTYPE SAP -APPLFORM "SAP R3" -APPLVER 46C/46D -CMVER 610 -AUTOEDIT %%%%SAPR3-ACCOUNT %3 -AUTOEDIT %%%%SAPR3-JOBNAME %1 -AUTOEDIT %%%%SAPR3-DETECT_OPTION 1 -AUTOEDIT %%%%SAPR3-JOB_MODE RUN_ORG -AUTOEDIT %%%%SAPR3-JOB_COUNT Specific_Job -AUTOEDIT %%%%SAPR3-JOBCOUNT %2 -AUTOEDIT %%%%SAPR3-SUBMIT_ASAP X -AUTOEDIT %%%%SAPR3-JOBCLASS C -AUTOEDIT %%%%SAPR3-XT_SOURCE I >> %ue_log_file%

Notice that the JOBNAME will be SAP_ABANDONED. The MEMNAME will be the jobname of the intercepted job, the OWNER will be the Connection Profile and the JOBCOUNT will be pulled from SAP. You can change this file and put %1 for JOBNAME to make the jobs unique.

In our example you will see another entry saying that any job starting with SAP* will use a template called SAP_JOB created in folder WFS_SAP. It is important to understand that in the template, any fields such as Quantitative/Control Resources, conditions, actions or any Control-M functions will be used. You can define this template so all jobs use the same Quantitative Resource and only x number of these can run at once. SAP properties will be overridden by what is intercepted from SAP.

S_BEST_SAPEX_Extract2

How Does This Relate to Child Processes

If a SAP job is submitted through Control-M and you have defined it as a parent with child processes, the Control-M extraction process builds a job in Active Jobs for each child. This is based on what you have put in the SAP job definition.

If a SAP user has submitted a parent job from within SAP and we have the Interception rules defined to use a template that spawns child processes, then each child will be built as a Control-M job using the same properties as the parent. They can all be controlled using Quantitative Resources and use an action setting.

NOTE: If we intercept a parent job and do not have it defined to spawn child processes, the parent only stays active until all of the child processes are spawned. We do not know if they all complete successfully. The ABAP program that the user runs, is defined in the SAP job. It does not use the user of the Control-M SAP Account unless no user is defined in the job. In this screen shot you will see the program ZQA_MANY_VARIANTS will run with the DEV user and the ZQA_SIMPLE will run with the user defined in the Control-M for SAP Connection Profile.

S_BEST_SAPEX_steps

Does This Increase Task Counts

Dynamically creating these intercepted jobs, which creates a job in Control-M Active Jobs. They do count toward task counts. It is important that the Prospect or Customer understands this and for them to intercept the correct jobs.

Summary

SAP Interception is important to control adhoc SAP workload.

Parent Topic

Best Practices