Blogs

Monitoring Job Chains with SAP CPS by Redwood and SAP Solution Manager
Martin Lauer SAP Employee
Business Card
Company: SAP AG
Posted on May. 28, 2009 05:45 AM in ABAP, Application Server, Run SAP, SAP Developer Network, SAP NetWeaver Platform, SAP Solution Manager

Subscribe.Subscribe
Print. Print
Permalink Permalink

Introduction

 In this blog I will not describe how to setup the Job Monitoring of the Business Process Monitoring Framework for SAP CPS Job Chains as this is demonstrated in a tutorial of the SAP Online Knowledge Products for the Process Scheduling Adapter. In said tutorial the Job Monitoring is configured for a simple CPS Job Definition and not for a Job Chain, but that makes no difference as the Job Chain is a black box for SAP Solution Manager (for now). It is therefore possible to use the available alerts like Cancellation or Run Time to monitor complex Job Chains and simple Job Definitions. 

What will be demonstrated is how to define generic CPS Job Chains to allow end users to request new simple Job Chains. The purpose is to mimic an ABAP/SM36 job with several steps and this is also explained in SAP note 1345018.

In the second part of this blog I will show how to use the Job Management Work Center to monitor the status of CPS jobs.

Requesting new Job Chains

At the beginning of the Job Scheduling Management process there is always a Job Request. Since a CPS Job Definition executes only one program, a Job Chain has to be requested to offer equivalent capabilities as transaction SM36, which allows a job to consist of several steps.

To mimic several job steps, a new Job Chain in created in SAP CPS.

Create Job Chain 

To the new Job Chain two steps will be added

Add steps to chain

and each step executes a single Job Definition of type SAPR3, e.g. SAP_AbapRunPrint.

Add job to step

 Since the Job Chain shall be specified in the Job Request by an end user, the parameters of the Chain and its Jobs have to be exposed. Therefore the next step is the definition of Job Chain parameters, e.g. program, variant and user, for each step of the Job Chain. In the example below, I also assigned a default report BTCTEST because this allows the definition of n steps chain for which only m (m<n) reports were supplied by the end user. Note that it is also possible to define parameters that are valid for all steps, e.g. print parameters. Just map such parameters to all steps. 

Add Chain parameters

Now the Job Chain parameters have to be mapped to the Job Definition parameters of each steps. In this example I map Job Chain parameter PROGRAM_STEP_1 to parameter ABAP program of Job Definition SAP_AbapRunPrint executed by step 1. 

Select Job Definition and map parameters

This completes the Job Chain definition, which is not ready to be used. If Job Chains with different number of steps are desired, I recommend to combine Job Chain. The screenshot below shows the combination of a 2 step with a 3 step Job Chain into a 5 step Job Chain.  

Composition of Chains 

After saving the new Job Chain Definition, start application Job Request from the Job Management Work Center of SAP Solution Manager. From the value help for field Job Definition select the newly created generic Job Chain Definition (here: Z_JOB_WITH_2_STEPS). Afterwards the Job Request screen will update and show the parameters define for the Job Chain. 

Create Job Request for generic Chain

Enter report and variant for each of the two steps and send the request.

Enter Chain parameter in Job Request

Of course it is possible (and in some cases desired) to convert the generic Job Chain into a custom Job Chain to tap the full potential of SAP CPS, e.g. to define condition for step execution, status actions for creation of alerts from an error status and many more. The custom Job Chain would finally be scheduled from a Job Documentation, but you can always go back to teh request and find out what was originally requested.

Monitoring CPS Jobs

In this section I will demonstrate how to use the Job Management Work Center to monitor CPS jobs. 

Call transaction SOLMAN_WORKCENTER to start the Work Center application. Select tab Job Management to navigate to the Work Center. if you cannot access the Job Management Work Center, please read SAP note 1117355 and assign the required roles. 

Select sub view Central Process Scheduling of view Job Monitoring from the Navigation Panel.

CPS Sub View in JSM Work Center

Create a new query (Click on Define new Query link above table in Content Area) using the  Job Selection function and specify the Job Status of interest, e.g. here I select Completed jobs.

Create query based an generic selection

Alternative: Create a new query (Click on Define new Query link above table in Content Area) using the  Job Filter function and specify the CPS Job Filter (can be defined in SAP CPS). Here I select the filter to get all jobs.

Maintain Query for CPS jobs

Next step is to define which Queries are evaluated be the query. To do click onto the selection option of query parameter Queue and select the relevant queues via the available value help.

Select CPS queues 

In the last step of the query definition, a new category for my new query gets created.

Define new category

After completion of the query definition, the query can be executed (Please note the Refresh link at the bottom of the table). In this example I selection query All Jobs (using the CPS Job Filter) and also set a filter into the table to see only jobs that contain the term CHAIN in their name. The query result list containes the Job ID, Status and Type together with its Queue.Execute new CPS query

If the CPS Job was scheduled from a Job Documentation, I can navigate to the corresponding document via function Display - Job Documentation.

Display assigned Job Documentation

I hope you enjoyed my demonstrations and start using SAP CPS together with SAP Solution Manager.

Martin Lauer is a software developer for the SAP Solution Manager.


Add to: del.icio.us | Digg | Reddit


Comment on this articlePlease post any questions, comments or suggestions and visit our site on SAP Service Market Place http://service.sap.com/jsm.
Comment on this weblog
Showing messages 1 through 2 of 2.

Titles Only Full Threads Oldest First

  • Interesting !
    2009-05-29 05:06:09 Olivier CHRETIEN Business Card [Reply]

    Thanks for this blog that we will study because it addresses a big problem of CPS which is that we loose multi steps jobs.
    We have a lot of users who don't want to define their jobs with CPS just because of this problem.


    With the standard way of importing multi steps jobs in CPS, we gat one job per step with the same name. This is very confusing...


    Regards,
    Olivier

  • Screen shots and instructions
    2009-05-28 09:17:35 Jim Spath Business Card [Reply]

    This material should probably be in the wiki, maybe with a blog post describing how long it takes to set up, skill prerequisites, and other user experiences.


    Jim


Showing messages 1 through 2 of 2.