Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Martin_Lauer
Product and Topic Expert
Product and Topic Expert
0 Kudos
h4. Introduction   In this blog I will not describe how to setup the Job Monitoring  (http://help.sap.com/saphelp_smehp1/helpdata/en/8e/3ad6f807e147669036d2a6aed597aa/frameset.htm) of the Business Process Monitoring Framework  (http://service.sap.com/bpm) for [SAP CPS Job Chains | http://www.redwood.com/education/tutorials/] as this is demonstrated in a {code:html}tutorial{code} of the SAP Online Knowledge Products for the Process Scheduling Adapter  (Process Scheduling Adapter for SAP Solution Manager for everybody). 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 {code:html}Scheduling{code} 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  (http://service.sap.com/sap/support/notes/1345018).    In the second part of this blog I will show how to use the Job Management Work Center to monitor the status of {code:html}Scheduling{code} jobs.  h4. Requesting new Job Chains   At the beginning of the {code:html}Job Scheduling Management{code} process there is always a [Job Request | Creating a Job Request with SAP Solution Manager]. 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.  To the new Job Chain two steps will be added and each step executes a single Job Definition of type +SAPR3+, e.g. +SAP_AbapRunPrint+.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.   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.     After saving the new Job Chain Definition, start application {code:html}Job Request{code} from the Job Management Work Center  (http://service.sap.com/sap/support/notes/1117355) 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.   Enter report and variant for each of the two steps and send the 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. h4. 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  (http://service.sap.com/sap/support/notes/1117355) and assign the required roles.     Select sub view +Central Process Scheduling+ of view +Job Monitoring+ from the Navigation Panel.  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.  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.  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.    In the last step of the query definition, a new category for my new query gets created.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. If the CPS Job was scheduled from a Job Documentation, I can navigate to the corresponding document via function +Display - Job Documentation+. 
6 Comments