You are on page 1of 20

Job control and Parallel processing

Thomas Bollmeier
IBU Financial Services, NAD, Tools & Technology

Job control : Requirements 

Control of the start of processes depending on the technical and business processing status of other processes 
Example : Mass processing of account extract only after successful processing of account balancing. 

Synchronisations of parallel sub processes 
That is follow up processes should start only after end of all parallel sub processes

=> Use of a job control

¥ SAP AG 2001, Title of Presentation, Speaker Name 2

Speaker Name 3 . use in the daily end processing Processes in the parallel processing Definition of flow plans in the Customizing ‡ Predecessor-Successor ±Relationships between Report processes Flexible generation of flows through customer reports ‡ BAPI JobControlFS.Job control : Performance features Processes are specialisations of an abstract process class ‡ Advantage : can be expanded easily ‡ Implemented process classes: ‡ ‡ Report processes (Attributes: Report name. Title of Presentation. Variant.startProcess ‡ Possibility of the status query through BAPI JobControlFS.createNetwork Start of Reportprocesses through external Job control possible ‡ BAPI JobControlFS.getDetail planned ¥ SAP AG 2001. Mass run-ID).

Job control : Design Assigned DB-Tables: Process flow pattern :  TBANK_RFL_TEMPL  TBANK_RFL_TREP  TBANK_RFL_TREL Process flow:  BANK_PROCFL_FLOW  BANK_PROCFL_REL Process:  BANK_PROCFL_PROC  BANK_PROCFL_LOG Report process:  BANK_REPORTS  BANK_REP_PARAMS ¥ SAP AG 2001. Title of Presentation. Speaker Name 4 .

) Status check. BANK_OBJ_PROCFL_LOCK_PROC Start Checks [Start check negative] [Lock can not be set ] BANK_OBJ_PROCFL_WAIT_FOR_PRED [at least one predecessor aborted] BANK_OBJ_PROCFL_REL_PROC BANK_OBJ_PROCFL_GET_MODE [else] [asynchronous processing] BANK_OBJ_PROCFL_START_ASYNC BANK_OBJ_PROCFL_START_SYNC ¥ SAP AG 2001. 3.) Check whether external start is expected. 2. Title of Presentation.: XSTART_EXTERN). then the code XREST_ALLOWED must be set for the process. The status must have the value 'not yet started' . If the start counter is (START_COUNT) > 0 .) Check for restart .Jobsteuerung: Prozessablauf I BANK_API_PROCFL_START BANK_OBJ_PROCFL_GET_PROC(procid) Following checks are done : 1. (code. Speaker Name 5 .

As Parameter P_ID the ID of the process to be started is transferred. Speaker Name 6 . JOB_CLOSE( end job ) SUBMIT startreport JOB_CLOSE( startjob ) Der Report RBANK_PROC_END starts the flow at the process end Its Parameter P_ID during calling is supplied with the ID of the process to be closed. :cl_procflow BANK_OBJ_PROCFL_START_SYNC startreport end report :cl_procflow BANK_OBJ_PROCFL_END ¥ SAP AG 2001. It runs even during aborting of startjob and ensures such a defined process end even in case of aborting. Title of Presentation. JOB_OPEN( end job ) SUBMIT end report The Report RBANK_PROC_START is called.Jobsteuerung: Prozessablauf II :cl_procflow BANK_OBJ_PROCFL_START_ASYNC BANK_OBJ_PROCFL_GET_JOBDATA :R/3-Job control JOB_OPEN( startjob ) endjob is planned as successor of startjob .

Jobsteuerung: Prozessablauf III :cl_procflow BANK_OBJ_PROCFL_START_SYNC BANK_DB_PROCFL_SET_STATUS (aktiv) Reading of the method of the process class . which implements the method AT_START of the interface if_proc Process:Proce ss class :cl_ooman :DB-administration BANK_API_OOMAN_GET_METHOD Method name BANK_OBJ_PROCFL_EXPORT_ID Process::AT_START COMMIT BANK_OBJ_PROCFL_REL_PROC BANK_OBJ_PROCFL_GET_CHILDS BANK_API_PROCFL_START * [for all child processes] BANK_OBJ_PROCFL_GET_MODE BANK_OBJ_PROCFL_END [in case synchronous mode] ¥ SAP AG 2001. Title of Presentation. Speaker Name 7 .

which implements the interface method AT_END_OF_PROCESS of the interface if_proc . aborted] BANK_OBJ_PROCFL_LOCK_PRC [Locking not possible ] Get the method. Speaker Name 8 .Jobsteuerung: Prozessablauf IV BANK_OBJ_PROCFL_END BANK_DB_PROCFL_GET_STATUS closed. Title of Presentation. BANK_OBJ_PROCFL_WAIT_FOR_CHILDS cl_ooman::BANK_API_OOMAN_GET_METHOD <Prozeßklasse>:AT_END_OF_PROCESS: BANK_DB_PROCFL_SET_STATUS DB::COMMIT_WORK status = closed / aborted BANK_OBJ_PROCFL_REL_PROC BANK_OBJ_PROCFL_GET_FATHER [else] [No father process available ] BANK_OBJ_PROCFL_START_SUCC ¥ SAP AG 2001.

Speaker Name 9 . Title of Presentation.g. Date values ) can be defined as selection variables (in the table TVARV)  Stipulation of predecessor.Job control : Customizing Definition of a flow pattern from Report processes in IMG  Create and maintenance of variants per Report of the pattern  Dynamic Variables (e.successor±relationships  If necessary definition of own reports for inclusion in Report-Flow pattern  Stipulation of the behaviour during restarting ¥ SAP AG 2001.

startProcess  Report RBANK_JC_START BANK_JC_START  Planning as background job possible  Transaction Monitoring and control of the procedural flow through report RBANK_JC_OVERVIEW (Transaction: BANK_JC_OVRVW)  Network plan diagram  Restarting  Stopping a flow (ÄEmergency stop ³) ¥ SAP AG 2001. Title of Presentation. JobControlFS. Speaker Name 10 .Job control : Start and control of a flow Start through  BAPI JobControlFS.createNetwork bzw.

Title of Presentation.Parallel processing : Concept Framework for Applications . which are to be parallelised Classification of the quantity of objects to be processed in to work packages Processing of the work packages in to parallel background jobs Generation and Synchronisation of the background jobs through Financial. Speaker Name 11 .Services-Job control ¥ SAP AG 2001.

PackAdmCreate Start of the parallel processing through BAPI is supported Transactions for automatic generation of Callback-FuB and for checking the interface consistency  BANK_PP_GEN und BANK_PP_CHECK ¥ SAP AG 2001. Speaker Name 12 . Title of Presentation.Parallel processing : Performance features Number of parallel jobs + Distribution to Server(groups) adjustable in the customizing Standard-Package templates enable reusability of once prepared object classification by many randomly paralleised mass processings Definition of the packages as Interval or as discrete Object list BTE and BAPI for definition of packages through customer  0BANK010  ParallelProcessingFS.

.: requested number of open Obj.* + at_start + at_end_of_process generated 1 Application {abstract} Mass run Mass run-ID Application type current StartNo current realStartNo... Title of Presentation. number of returned Obj..* Pack template 0. Code.* work package work reserve-ID PacktNo Object-ID Status ¥ SAP AG 2001..* Work package header work reserve-ID PackNo. .* work reserve .. of repetitions No.2 Start Data Mass run-ID Simulation code No. 1 .number of objects in status <xx> 0.Interval limits 1.Parallel processing : Data model I Job control parallel sub process Account closing (example) 1.* 1 Pack templateobjects PVerw-ID PacktNr Object-ID 1 0..Type of packs 1 0.Job-ID .PVerw-ID .. Speaker Name 13 .* Pack administrator PVerw-ID Kz.1 0.* 1 1. 1 1..Jobstatus 1 1.PackNo.work reserve-ID . current step No..* 1 General process 1.. maximal step Status Process {abstract} . Standard Def. last step No.

Speaker Name 14 . BANK_WORKL_CNT  Work reserve header  BANK_WORKL_PACK  Work package (objects)  BANK_WORKL_OBJ ¥ SAP AG 2001.Parallel processing : Data model II Assigned DB-Tables  Mass course (run)  BKKMPARUNHD. Title of Presentation. BANK_PP_STEPDATA  Package administrator  BANK_PACKMAN_HD  Package template (pattern)  BANK_PACKMAN  Package template objects  BANK_PACKMAN_OBJ  Work stock(reserve)  BANK_WORKL_HD. BKKMPARUN.

Parallel processing : Flow I BANK_MAP_PP _START :Mass runAPI :Mass runOBJ :Application BANK_OBJ_PP_PREPARE _START Method 0100: Start of a mass run BANK_API_WORKL_ CONSTRUCTOR :work reserve -API BANK_API_PACKMAN _CONSTRUCTOR [if I_PACKMANID_EXT initial] :PVerw-API Method 0205: generate package templates Method 0120: Set Parameter Call in UPDATE TASK.. = 'X' BANK_OBJ_PP_EXECUTE _STEP BANK_OBJ_PP_START_CONTAINER Method 0160:Checks prior to start of a mass run In process flow within a update(entry) work process (WP-Types 2 and 6) BANK_OBJ_PP_START_CON TAINER is called with the addition STARTING NEW TASK ¥ SAP AG 2001. Title of Presentation. if I_X_TRIGGER.. Speaker Name 15 .

Title of Presentation. aborted. repeat current step] Mass run::BANK_OBJ_PP_CONT_WITH_STEP [Status closed. Speaker Name 16 . If the maximal step number is not yet reached and the run status not 'aborted' or 'in asynchronous processing'. ¥ SAP AG 2001. the current step is repeated. in asynchronous processing] Mass run ::BANK_OBJ_PP_PREPARE_START Application ::Method 0300 After Synchronisation with the help of Object status counter (Table BANK_WORKL_CNT) and the job status a mass run status is determined. the next step is started.Parallel processing : Flow II Mass run ::BANK_OBJ_START_CONTAINER Application ::Method 0160 Mass run::BANK_OBJ_PP_JOB Mass run::BANK_OBJ_PP_JOB Mass run::BANK_OBJ_PP_JOB Mass run ::BANK_OBJ_PP_DET_STAT_AT_EOSTEP [Status Start next step . If the percentage of the objects in the status 'reset' exceeds the threshold value stored in the Customizing (TBCAMPPAPPL) .

Parallel Processing: Flow III :Mass runOBJ BANK_OBJ_PP_JOB Method 1400: Start of processing in a parallel Job :PVerw-API * [ till no unprocessed package is available ] BANK_API_WORKL_GET_PACKAGE BANK_API_PACKMAN_GET_LIMITS BANK_OBJ_PP_PACKAGE Method 1000: initialise package :work reserve :Application Method 1100: select data First processing of package without preselection BANK_API_WORKL_GET_OBJECTS BANK_API_PACKMAN_GET_OBJECTS [1. Speaker Name 17 .Pack processing] Follow up processing of the package or first processing with preselection [Follow up processing] BANK_DB_WORKL_GET_PACKOBJ Method 1200: select data for list BANK_API_WORKL_CHANGE_STATUS Method 1270 Method 1260: check data BANK_API_WORKL_CHANGE_STATUS Method 1270 Method 1300: process data End of the package processing loop BANK_API_WORKL_CHANGE_STATUS Method 1410: End of the processing in a parallel Job ¥ SAP AG 2001. Title of Presentation.

Title of Presentation.Parallel processing : Connecting an application Maintenance of the System-Customizing (Transaction BANK_CUS_PP)  Definition of a type of application  Implementation and assignment of the Callback-Functions Calling the functional module BANK_MAP_PP_START or BANK_MAP_PP_RESTART (during restart ) ¥ SAP AG 2001. Speaker Name 18 .

Turing(‚) (Eds. Heidelberg. 347th. Speaker Name 19 .1³  \\pwdf0626\infocenter\protected\2001\09\06\2694861e939edf4b8c12f8fa44c1ba a7. Neumann(‚). J. New York. Knuth.Other Literature  Design-Document on Job control in the InfoCenter  Title ÄJob control ³  \\pwdf0626\infocenter\protected\2001\07\27\c42375be8f46ba44a509b675a7bd b151. Ed. E.): ÄThe Art of Parallel Processing³. Title of Presentation. A. D. Knallinger. v. ISBN: 0-123-4567-8 ¥ SAP AG 2001..doc  Titel  H. Berlin.doc  Developer docu for parallel processing in the InfoCenter ÄParallelisation 2. 1999.

used under license for technology invented and implemented by Netscape. AIX®. NT®. and OS/400® are registered trademarks of IBM Corporation. HTML. OSF/1®. Word®. WINDOWS®. SAP EarlyWatch. SAPPHIRE. SAP. JAVA® is a registered trademark of Sun Microsystems. AS/400®. OS/2®. SAP Business Workflow. Speaker Name 20 . DHTML. S/390®. All other products mentioned are trademarks or registered trademarks of their respective companies.. RIVA. DB2®. R/2. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Parallel Sysplex®. INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks of Informix Software Incorporated. UNIX®. Inc. Title of Presentation. SAP ArchiveLink.           ¥ SAP AG 2001. ORACLE® is a registered trademark of ORACLE Corporation. IBM®. EXCEL®. Massachusetts Institute of Technology. Inc. PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation. All rights reserved  No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. R/3. JAVASCRIPT® is a registered trademark of Sun Microsystems. Microsoft®.Copyright 2001 SAP AG. World Wide Web Consortium. Management Cockpit. XHTML are trademarks or registered trademarks of W3C®. SAP Logo. BAPI. RS/6000®. ABAP. mySAP. MVS/ESA®.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. DB2/6000®. WebFlow. X/Open®. XML.com Logo and mySAP. and Motif® are registered trademarks of the Open Group. OS/390®.