SAP Workflow Monitoring

61
Best Practice: SAP Workflow Monitoring SAP Workflow Monitoring Best Practice for Solution Management Version Date: July 2007 The newest version of this Best Practice can be obtained through the SAP Solution Manager Contents 1 Introduction ............................................................................................................................. 3 1.1 Applicability, Goals and Requirement................................................................................. 3 1.2 Preliminary Information...................................................................................................... 5 2 SAP Workflow Functionality..................................................................................................... 7 3 SAP Workflow Monitoring and Analysis ................................................................................. 10 3.1 SAP Workflow log............................................................................................................ 10 3.2 Monitoring and Analysis Tools.......................................................................................... 16 3.2.1 Backlog Monitoring and Analysis .............................................................................. 19 3.2.1.1 Transaction SWI1 Selection report for SAP Workflows ................................... 19 3.2.1.2 Transaction SWI2_FREQ Work Items per Task .............................................. 23 3.2.1.3 Transaction SWI2_ADM1 Work Items Without Agents.................................... 26 3.2.1.4 Transaction SWI6 SAP Workflows for Object ................................................. 29 3.2.2 Error Monitoring and Analysis................................................................................... 32 3.2.2.1 Transaction SWI2_DIAG Diagnosis of SAP Workflows with errors.................. 33 3.2.2.2 Transaction SWUD SAP Workflow Diagnosis................................................. 34 3.2.2.3 Transaction SM58 tRFC Monitor .................................................................... 42 3.2.2.4 Transaction SWPR Restart SAP Workflow ..................................................... 44 3.2.2.5 Transaction SWPC Continue SAP Workflow .................................................. 44 3.2.2.6 Transaction PFTC General Task Maintenance .............................................. 45 3.2.2.7 Transaction SWDD SAP Workflow Builder .................................................... 47 3.2.2.8 Transaction SWO1 Business Object Builder .................................................. 47 3.2.2.9 Transaction SWEQADM Event Queue Administration .................................... 49 3.2.2.10 Transaction SM37 – SAP Workflow related Job Monitoring ............................. 50 3.2.2.11 Error handling roadmap .................................................................................. 50 3.2.3 Performance Monitoring and Analysis ...................................................................... 52 3.2.3.1 Transaction SWI5 – Workload analysis ............................................................ 52 3.2.3.2 Transaction ST03 (ST03N) Workload Monitor ................................................ 56 3.2.3.3 Transaction STAD Statistical Records ............................................................ 57 3.2.3.4 Transaction ST12 Single Transaction Analysis ............................................... 58 3.2.4 Resource Monitoring ................................................................................................ 59 3.2.4.1 Transaction SMQS Qout Scheduler ............................................................... 59 3.2.5 Further Information .................................................................................................. 60 3.2.5.1 Troubleshooting ............................................................................................... 60 3.2.5.2 Literature ......................................................................................................... 60

description

SAP Workflow Monitoring

Transcript of SAP Workflow Monitoring

Page 1: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

SAP Workflow Monitoring

Best Practice for Solution Management

Version Date: July 2007 The newest version of this Best Practice can be obtained through the SAP Solution Manager

Contents 1 Introduction.............................................................................................................................3

1.1 Applicability, Goals and Requirement.................................................................................3 1.2 Preliminary Information......................................................................................................5

2 SAP Workflow Functionality.....................................................................................................7 3 SAP Workflow Monitoring and Analysis .................................................................................10

3.1 SAP Workflow log............................................................................................................10 3.2 Monitoring and Analysis Tools..........................................................................................16

3.2.1 Backlog Monitoring and Analysis..............................................................................19 3.2.1.1 Transaction SWI1 ­ Selection report for SAP Workflows...................................19 3.2.1.2 Transaction SWI2_FREQ ­ Work Items per Task ..............................................23 3.2.1.3 Transaction SWI2_ADM1 ­ Work Items Without Agents....................................26 3.2.1.4 Transaction SWI6 ­ SAP Workflows for Object .................................................29

3.2.2 Error Monitoring and Analysis...................................................................................32 3.2.2.1 Transaction SWI2_DIAG ­ Diagnosis of SAP Workflows with errors..................33 3.2.2.2 Transaction SWUD ­ SAP Workflow Diagnosis.................................................34 3.2.2.3 Transaction SM58 ­ tRFC Monitor....................................................................42 3.2.2.4 Transaction SWPR ­ Restart SAP Workflow.....................................................44 3.2.2.5 Transaction SWPC ­ Continue SAP Workflow ..................................................44 3.2.2.6 Transaction PFTC ­ General Task Maintenance ..............................................45 3.2.2.7 Transaction SWDD ­ SAP Workflow Builder ....................................................47 3.2.2.8 Transaction SWO1 ­ Business Object Builder ..................................................47 3.2.2.9 Transaction SWEQADM ­ Event Queue Administration ....................................49 3.2.2.10 Transaction SM37 – SAP Workflow related Job Monitoring .............................50 3.2.2.11 Error handling roadmap ..................................................................................50

3.2.3 Performance Monitoring and Analysis ......................................................................52 3.2.3.1 Transaction SWI5 – Workload analysis ............................................................52 3.2.3.2 Transaction ST03 (ST03N) ­ Workload Monitor ................................................56 3.2.3.3 Transaction STAD ­ Statistical Records ............................................................57 3.2.3.4 Transaction ST12 ­ Single Transaction Analysis ...............................................58

3.2.4 Resource Monitoring................................................................................................59 3.2.4.1 Transaction SMQS ­ Qout Scheduler ...............................................................59

3.2.5 Further Information ..................................................................................................60 3.2.5.1 Troubleshooting...............................................................................................60 3.2.5.2 Literature.........................................................................................................60

Page 2: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

2

3.2.5.3 Background Information and References .........................................................60 3.2.5.4 Feedback and Questions .................................................................................60

3.2.6 APPENDIX: Work Item Archiving..............................................................................61 3.2.6.1 Transaction SWW_SARA ................................................................................61

Page 3: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

1 Introduction

1.1Applicability, Goals and Requirement This Best Practice gives an overview on SAP Workflow monitoring, the main tools and their functions. This enables each responsible team to monitor SAP Workflows optimally, according to their responsibilities.

This Best Practice describes the SAP Workflow monitoring activities, which should be carried out in a particular productive environment and on a continuous/permanent basis. Therefore, this Best Practice will not take into account customizing activities that are considered already complete.

In order to ensure good performance of the entire SAP system, you should take into consideration that creating many SAP Workflow logs can cause the SAP Workflow related tables to grow significantly in the database. In the appendix you will find recommendations on how to archive work items.

This Best Practice document consists of the following sections: Section 1 Introduction

• This section explains the purpose of this document.

Section 2 SAP Workflow Functionality

• This section gives you a short introduction to SAP Workflow.

Section 3 SAP Workflow Monitoring and Analysis

• This is the main section, which introduces to you various tools to monitor SAP Workflow and analyze errors effectively:

o SAP Workflow log

SAP Workflow log contains all the important data for administration and monitoring of an SAP Workflow. The SAP Workflow log is the best tool available for getting an overview of an SAP Workflow instance and analyzing it.

Different transactions are explained in detailin the section 3.2 Monitoring and Analysis Tools. Backlog Monitoring and Analysis

Work Item Monitoring enables you to display Work Items. You can see how many Work Items are executed per type or task.

o Error Monitoring and Analysis

In this section, you will find various tools to analyze errors and also to restart erroneous Items.

o Performance Monitoring and Analysis

The transactions explained here will help you to evaluate SAP Workflow performance and investigate a performance bottleneck.

o Resource Monitoring

With resource monitoring, you can ensure if enough resources are available to execute SAP Workflow.

Section 4 Further Information

• Additional information is provided.

Appendix: Work Item Archiving

• Work Item Archiving is mentioned here. Many performance issues can be caused by the fact that SAP Workflow items are not archived.

Goal of Using this Service The SAP Workflow and its functions often play a central role in the SAP systems. To run an operation without errors and delays, it is important that all process steps in the SAP Workflow are monitored. SAP Workflow monitoring ensures that the business processes run in a smooth and reliable way. This

Page 4: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

4

Best Practice documentation supports the implementation of SAP Workflow monitoring and the development of the SAP Workflow monitoring concept.

Alternative Practices You can have SAP experts deliver this Best Practice on­site by ordering a Solution Management Optimization (SMO) service for SAP Interface Management. This service is exclusively available within an SAP Support Engagement (that is, SAP MaxAttention, SAP Safeguarding or SAP Premium Support).

Staff and Skills Requirements System and SAP Workflow administrators and other persons responsible for SAP Workflow management make up the target group for this document. It is necessary to specify an SAP Workflow administrator. This administrator monitors the business SAP Workflows and ensures undisturbed operation. The responsibilities and different tasks must be defined in an SAP Workflow monitoring concept.

To implement this Best Practice, you require the following teams:

Application Management Team

This team provides the information on the business background of the interfaces used and knows the business requirements for the interfaces:

• Business department

• Solution support organization (for example the Basis Support or the Application Support)

• Implementation project team

Business Process Operations Team

The Business Process Operations team will be responsible for applying the resulting procedures derived from implementing this best practice. They include the following groups:

• Persons designated to perform business process oriented monitoring and ensure that the process runs smoothly (for example, the Business Process Champion for each business process)

• All parties in your Solution Support Organization and IT department involved in monitoring focused on the application aspects (Application Support, Development Support, Program Scheduling Management)

SAP Technology Operations Team

• All parties in your Solution Support Organization and IT department involved in monitoring focused on the system administration side (Program Scheduling Management, Software Monitoring Team, System Administration Team including the System Administrator)

Business Process Champion

• The Business Process Champion is the person in the business department that is responsible for the successful execution of the business process. He/she coordinates all activities necessary for the business process. Therefore, he/she is usually responsible for the escalation paths in case of problems. The business process champion is often a second level in the escalation procedure, if the application monitoring team needs to escalate an issue.

Necessary or Useful Trainings

q BIT600 – SAP Business SAP Workflow

q BIT601 ­ SAP Business SAP Workflow ­ Build and Use

q BIT603 ­ SAP Business SAP Workflow and Web Scenarios

q BIT610 ­ SAP Business SAP Workflow ­ Programming

q ADM105 ­ Advanced R/3 System Administration

Page 5: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

5

q ADM315 ­ Workload Analysis

System Requirements The information in this document refers to releases SAP R/3 Enterprise 4.70 and higher. For system access, use the SAPGUI.

Duration and Timing SAP Workflow monitoring should be carried out in all parts of the business process which use SAP Workflow. Monitoring should be carried out at least once per day, depending on usage of SAP Workflows.

1.2Preliminary Information There are several ways of defining SAP Workflows: An SAP Workflow is the automation of a business process, during which documents, information or tasks are passed from one participant to another for actions, according to a set of procedural rules. SAP Workflows link separate business tasks together into a business process. The SAP Workflow supplies the right information, at the right time, to the right people, distributing the work according to business rules.

The following supplies another more common definition:

An SAP Workflow is the computer­supported modeling and execution of a business process. An SAP Workflow Management System is a computer system, which can define, perform and monitor SAP Workflows. These descriptions are based on the SAP Workflow Management Coalition (WFMC) definition. The WFMC is a non­commercial organization, which standardizes and encourages the use of SAP Workflow systems. SAP participates in the WFMC.

The use of SAP Workflow within business processes returns different benefits. The SAP Workflow Management Systems improve the communication between processors through integration in a mailing system. The system determines the processor of an SAPWorkflow activity by specified rules (competences) and assigns each activity to the appropriate processor. SAP Workflows allow monitoring deadlines to ensure that each activity is performed within its deadline and use statistical functions to analyze processor and group workload and efficiency.

As a simple example, we could use an approval procedure using an SAP Workflow Management System for a material requirement request. The following figure shows the graphical presentation of this process. The following explains the process steps involved and the persons belonging to this SAP Workflow.

Page 6: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

6

Figure 1 ­ Approval procedure for a material requirement request

An employee creates a material requirement request, thus starting an SAP Workflow. The material requirement request is presented electronically to the employees’ superior for approval. The manager can approve or reject the request. Should approval be given, the employee is informed. There may be subsequent steps (for example, create a purchase order and send it to a supplier).

If the manager rejected the request, the employee is informed and can decide whether to revise or abandon the request. The employee can abandon the request, at which point the material requirement request is deleted in the system and the SAP Workflow ends. If the employee decides to revise the request, the request change function is offered in the next step, and the changed material requirement request is resubmitted to his or her manager for approval.

Page 7: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

7

2 SAP Workflow Functionality An SAPWorkflow is a sequence of steps, which are processed either by people or by the system. SAP Workflow links together separate business tasks into a business process. It provides an active flow of information:

• Supply the right information, at the right time, to the right people

• Distribution of work according to business rules

• Exception handling and deadline monitoring

Five questions for every part of an SAP Business SAP Workflow process are:

• What?

• When?

• In what order?

• How?

• Who?

SAP Workflows are widely used to automate different business processes. For example, SAP Workflow was used to automate the routine administrative procedure of new user creation. It includes the creation of a new user request and changing user’s logon data.

SAP Business SAP Workflow lies on an integration level above the transaction / application level. It uses existing application functions (for example, transactions, reports and function modules). These functions are not changed, but they are linked to each other according to the requirements of the business process.

SAP Workflow terminology: The following table describes SAP Workflow terminology. It gives an overview of the technical objects, their definitions and gives an example. The example used is the process of purchase requisition for ordering a printer for an office. This figure shows a graphical overview of the SAP Workflow terminology and all technical objects involved in SAP Workflow process.

Figure 2 – Overview of SAP Workflow terminology and technical objects

Page 8: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

8

Terminology Definition Example SAP Workflow definition

The set of rules which define the SAP Workflow paths (routes). The routes may be linear, parallel or circular (loop).

The method of processing a purchase requisition. It includes the whole process, starting with the query and ending with creation of the purchase order.

SAP Workflow instance

Usually only referred to as the SAP Workflow. Is a single SAP Workflow execution.

The processing of a purchase requisition for an office printer.

Task These actions are guided by the SAP Workflow. Tasks are carried out by users (dialog tasks) with a defined role in the SAP Workflow or by programs (background tasks).

Does a printer already exist in the office?

Work item A task instance processed as a single SAP Workflow step.

Check the office for existing printers.

Processor Person processes a task via a work item.

The person with the request, the manager approves the request, the member of the IT department and member of the purchasing department organise the delivery

Roles These define the functions of the persons involved in the SAP Workflow.

Requester, Approver

Container This is the data collection used in the SAP Workflow.

A specified office, the ordered printer

Data flow The set of rules describes which data will be sent to which process steps.

In the purchase requisition process, the required data is: office room number and information about the office equipment. Data regarding the requestors cost center is not necessary.

Object Created at runtime and the specific instance of a previously defined object type that has been assigned values

Method (Object type component)

The operation that can be executed on an object

Attribute (Object type component)

The property or characteristic of an object

Event The status change of an object that is published throughout the system

Step The elementary module of an SAP Workflow definition

Page 9: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

9

Figure 3 – A business process SAP Workflow in an SAP system

Page 10: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

10

3 SAP Workflow Monitoring and Analysis To ensure the smooth and reliable flow of the business processes, it is very important to define persons in your solution support organization that take care of management and monitoring the SAP Workflows. There are some activities that should be carried out, in order to check if the processes based on SAP Workflows have run completely without errors and, in case of errors, to figure out the causes of them and try to solve them.

Therefore, should some SAP Workflow instances not run correctly, the responsible team should analyze them to find what generated the incorrect flow. This analysis can be carried out thanks to a central tool called the SAP Workflow log. In the chapter on SAP Workflow Monitoring and Analysis the main transactions are illustrated that can help to find out which SAP Workflow instances are affected by problems and how to analyze them.

3.1SAP Workflow log The SAP Workflow log contains all the important data for administration and monitoring of an SAP Workflow and acts as an entry point for further activities. The SAP Workflow log is the best tool available for getting an overview of an SAP Workflow instance and analyzing it. It is very important to keep in mind that an SAP Workflow log is automatically created by the system for every SAP Workflow instance, so that you do not have to switch on or customize anything in order to see it. Once an SAP Workflow starts, different SAP Workflow logs are created. The SAP Workflow log puts together all information that is created or used during the execution of the business process in a central place, the latter being identified by the SAP Workflow instance. These logs can also be displayed whilst an SAP Workflow is running and until it is completed. By means of these logs, you can see which steps have already been processed and which steps are still to be processed.

The SAP Workflow log can be accessed by transactions explained in the following chapter of this document or directly from the work item inbox and outbox (transaction SBWP). In the next figure, the inbox for Manager1 is displayed. On the right side of the next figure, all work items with status ready are listed. By clicking on the button Display SAP Workflow log the system shows the SAP Workflow log for the selected work item.

Figure 4 – Business workplace of ‘Manager 1’

Page 11: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

11

An SAPWorkflow log can be displayed through different views: Technical View and Standard View. The difference is the information displayed. In the logs, all details regarding the SAP Workflows are saved, however they can only be completely displayed in the technical view.

Figure 5 – SAP Workflow log – technical view

The technical view was designed for the developers and SAP Workflow administrators, since it contains the history of an SAP Workflow instance with all its steps (including all technical information) and therefore, it is the most useful tool for searching for possible errors.

As our purpose is to describe the monitoring activities for an SAP Workflow administrator, we will now describe just the Technical View in more detail.

The general information about the SAP Workflow instance is shown in the upper part of the screen: the SAP Workflow name, the SAP Workflow instance, the instance number or work item­ID, the start date and time, started by and the current status. In the body of the technical view, you find the chronology of the SAP Workflow instance. It appears as a graphical table with two levels and shows all the steps of the SAP Workflow instance in a chronological order.

Here is a short introduction on how to interpret this table. The first level of the graphical table corresponds to the first header line of the table. Line items which belong to the first level of the table are marked with arrows ‘b’ in the next figure. The first line item represents the start of the SAP Workflow instance, the line items that follow represent its tasks ­ they may be steps of the same SAP Workflow or steps of sub­SAP Workflows. In order to see all of this information it may be necessary to scroll left/right on the screen. On the first level of the table, for each line item the table shows: ­ An overall error status in the column named error. A green traffic light appears if no errors

occurred in the step ­ A status indicator (column status) that shows the status of the work item ­ The work item­ID (column ID) ­ The SAP Workflow step number (column Node Number) ­ The description of the steps (column Task) ­ The result of the tasks (column Result) ­ The execution date (column Date) ­ The execution time (column Time) ­ The current processing time (column Processing time)

Page 12: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

12

Figure 6 – SAP Workflow log in view with technical details

The second level of the graphical table corresponds to the second header line of the table. Line items which belong to this second level of the table are marked with arrows b in next figure. The line items on the second table level are only visible after expanding the second level by clicking on the icon

in the first column of the graphical table. For each line item on the second level of the table, the table shows: ­ An overall error status in the column named ‘error’. A green traffic light appears if no errors

occurred in the step; ­ The assigned agent (column Agent) ­ The executed action within this step (column Executed Action) ­ The execution date (column Date) ­ The execution time (column Time) ­ The processed object (column Object) ­ The name of the processed object (column Object name) ­ The processed object 2 (column Object 2) ­ The name of the processed object 2 (column Object name 2) ­ The corresponding context of the user (column User Context)

Page 13: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

13

Figure 7 – SAP Workflow log in view with technical details

If an SAP Workflow has an error status, you can see in the technical view, in which step the error occurred and all the error messages that were created. For this property, the technical view is the most suitable view for the investigation of the SAP Workflow run.

The technical view shows technical knots and control structures and offers additional data for

example, Container elements , Agents data , SAP Workflow data and graphical SAP

Workflow logs . The Status of the single work item is also displayed. To display this additional data, you must click on the symbols shown above.

Page 14: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

14

Graphical SAP Workflow log The Graphical SAP Workflow log shows the already processed steps within the graph of the SAP Workflow definition. This is very useful, since you can see the direction of a particular SAP Workflow instance at a glance (the system shows the process of the SAP Workflow instance by means of a green line; please refer to next figure; In printed versions, the process line is fatter than the other lines related to the SAP Workflow definition).

Figure 8 – SAP Workflow log in graphic

Page 15: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

15

There are three possibilities of viewing the graphical SAP Workflow log if you are in the technical view:

By clicking on the button (marked with arrow ‘a’);

By clicking on the symbol directly in the log (marked with arrow ‘b’);

By selecting GOTO ­> Graphical SAP Workflow log (marked with arrow ‘c’) or pressing F9.

However, you will get the highest hierarchy level if you choose point (a) or (b) of the SAP Workflow

instance. By clicking on symbol you will get the graphical log of the (sub)­SAP Workflow represented in the step you want to analyze.

Figure 9 – SAP Workflow log in view with technical details

It is important to emphasize, that you must select the view with error indicators in the menu (Path: Views > Other views > View with error indicators, in order to display the errors, which are indicated in the log with the symbol .

Page 16: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

16

Figure 10 – SAP Workflow log in view with technical details

By clicking on the error symbol, the system displays an analysis of the error which may describe the cause of the error. You can access the information contained in this analysis.

Figure 11 – Er ror diagnosis for a work item

By double­clicking on a specified item, you can view the full, more technical error description. In this technical description, you find an error message code (for example: Message no. BBP_WFL052). This message code is useful for searching for SAP Notes in order to manage the problem.

3.2Monitoring and Analysis Tools Monitoring can be done using the standard reports that are available in the system. They also provide the possibility to use the general report functions, for example, sorting, filter, layout change, etc. Another possibility is to define search criteria to restrict the list of SAP Workflows to be monitored suitably. For instance, you can search for SAP Workflows that contain a particular task, component or for SAP Workflows started in a defined period of time (today, last week, last month, last year, all).

A short overview of the main transactions is provided here. In the following subsections, we will explain the listed transactions needed to view the above mentioned reports in more detail.

Page 17: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

17

1. Work Item Monitoring

Transaction code

Short text Explanation

SWI1 Searching and displaying Work Items of all types

You can search and display work items of all types according to various criteria to check status.

SWI2_FREQ Searching and displaying Work Items per Task

You can search and display work items grouped per task and display work items of the same task.

SWI2_ADM1 Searching and displaying Work Items without agents

You can search and display work items without agents to determine next actions.

SWI6 Searching and displaying Work Items with object type

You can search and display work items with specific Business Object instances and to analyze the status of SAP Workflow.

2. Error Monitoring, Analysis and Restarting

Transaction code

Short text Explanation

SWI2_DIAG Listing Work Items with errors and displaying error diagnosis

You can list work items by cause of error.

SWUD SAP Workflow Diagnosis You can use this transaction for SAP Workflow Diagnosis which is very useful if you discover that a particular SAP Workflow is not working correctly.

SM58 tRFC monitor You can monitor and restart hanging Work items in the tRFC queue.

SWPR Restarting SAP Workflow You can restart SAP Workflows after error.

SWPC Continuing SAP Workflow You can continue SAP Workflows that hang after a system crash.

PFTC General Task Maintenance You can check the definition of a task.

SWDD SAP Workflow Builder You can trace the flow and investigate a specific step.

SWO1 Business Object Builder You can display and test an object used in SAP Workflow.

SWEQADM Event Queue Administration You can monitor event queue.

SM37 Monitoring SAP Workflow related jobs

You can monitor SWW* jobs scheduled by WF­BATCH.

Page 18: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

18

3. Performance Monitoring and Analysis

Transaction code

Short text Explanation

SWI5 Workload Analysis You can establish the workload of individual organizational objects (users, positions, jobs, work centers or organizational units), using the workload analysis.

ST03 (ST03N) Workload Monitor You can display information on system load from various viewpoints and timeframe.

STAD Statistical record You can display a statistical record of a single step.

ST12 Single Transaction Analysis You can analyze a single step using the Integrated performance analysis tool with ABAP (SE30) and Performance Trace (ST05).

4. Resource Monitoring

Transaction code

Short text Explanation

SMQS Qout Scheduler You can monitor system resources for tRFC with Qout Scheduler

Page 19: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

19

3.2.1 Backlog Monitoring and Analysis Work Item monitoring

Transaction code

Short text Explanation

SWI1 Searching and displaying Work Items of all types

You can search and display work items of all types according to various criteria to check status.

SWI2_FREQ Searching and displaying Work Items per Task

You can search and display work items grouped per task and display work items of the same task.

SWI2_ADM1 Searching and displaying Work Items without agents

You can search and display work items without agents to determine next actions.

SWI6 Searching and displaying Work Items with object type

You can search and display work items with specific Business Object instances and to analyze the status of SAP Workflow.

3.2.1.1Transaction SWI1 ­ Selection report for SAP Workflows A useful step in monitoring an SAP Workflow is to check its status. The best report for carrying out such a check is the report Work Item Selection – transaction SWI1. Transaction SWI1 allows the selection and view of all types of work items resulting from the search criteria that have been defined.

This report enables the selection and the view of all kinds of SAP Workflows by means of different selection criteria. It is particularly helpful when searching for non­visible Work Items, since they are neither in waiting nor in any SAP Workflow inbox. Moreover, using this report you can get an overview of special types of Work Items, for instance background Work Items (Work Item type B), to check if they were completed.

Page 20: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

20

Figure 12 – Transaction SWI1 – selection screen

If you execute the transaction without defined search criteria, all the Work Items from the last hour will be displayed by default. If you enter a Work Item ID in the selection screen, the system will ignore the other search criteria.

After executing the transaction, you will get a list – depending on the search criteria –containing information such as Work Item number, status of the Work Item, SAP Workflow task that created the Work Item, and so on.

Figure 13 – Transaction SWI1 – work item list

The layout of this list can be changed, for example by adding or removing columns from the list. You can define a personal layout by selecting Settings ­> layout ­> change from the menu.

Figure 14 – Transaction SWI1 – Layout settings of the work item list

You can select:

• Columns to be displayed

• Sort order of the work items displayed

• Filter the list

• To specially customize the view and display of the list

Page 21: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

21

The next figure displays how to manage this in the system. Click the Tab Columns and choose the columns you want in order to modify the layout.

Figure 15 – Transaction SWI1 – change layout of the work item list

To display the Work Item details, double­click on the item. The details screen is different depending on the type of the work item. We want to show two examples for the type F – Sub­SAP Workflow and type B – Background Step.

Figure 16 – Transaction SWI1 – List of work items

For type F – Sub SAP Workflow you will get the log of the SAP Workflow parent by double­clicking on the corresponding item in the above figure. This contains the history of the entire process, including all sub­SAP Workflows.

Page 22: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

22

Figure 17 – Transaction SWI1 – SAP Workflow log (sub­SAP Workflow)

For a background type SAP Workflow step, the SAP Workflow administrator will get detailed information about the work item by double­clicking on the corresponding work item type Background. To display the SAP Workflow log, double­click on the icon Log.

Figure 18 – Transaction SWI1 – SAP Workflow log (Background job)

When the status of the Work Item shows an error, you should look at the SAP Workflow log using the menu Edit ­> Display SAP Workflow log. Here, you can see errors that have occurred. The SAP Workflow log is described in more detail in the corresponding section of this document.

Page 23: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

23

3.2.1.2Transaction SWI2_FREQ ­ Work Items per Task Transaction SWI2_FREQ lists work item per task and allows determination of SAP Workflows within a specific time frame and a special work item type. You can search and select work items by Monitoring period, Work item type and Task filter:

The only parameter that needs to be specified is Monitoring period. Other parameters are optional.

Figure 19 – Transaction SWI2_FREQ – selection screen

It is possible to select/list the work item by using a special work item type (for example, only background types) and additionally, the filter functionality can be used (filter for a special ‘application component’). In this screen the selections used are dialog work items today. The following figure Work item per task shows the results of this selection. Here, we see a list of work items sorted by task types. The different tasks may be carried out more than once depending on task type.

Page 24: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

24

Figure 20 – Transaction SWI2_FREQ – Work items per task

If you double­click on a special task, you get a list of work items that are related to the chosen task type. The following figure shows the chosen task.

Figure 21 – Transaction SWI2_FREQ – work items with a specific task

The SAP Workflow administrator gets information about the agents involved, time of creation and status of the work items.

The following figure shows the basic data about the selected work item. The screen lists the work item attributes such as status, priority, time of creation, time of processing, open requests. Furthermore, the screen gives information about the description and attachments.

Page 25: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

25

Figure 22 – Work item – work item details

By clicking the Log button, the user gets the log file of the complete SAP Workflow and can find information about this particular execution. Analysis and interpretation of the information in the listed log file is described in the section SAP Workflow log of this document.

Page 26: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

26

3.2.1.3Transaction SWI2_ADM1 ­ Work Items Without Agents Transaction SWI2_ADM1 enables you to search for work items within a specific time frame without agent assignment.

Figure 23 – Transaction SWI2_ADM1 – Selection screen

The only parameter which needs to be specified is Monitoring period. In this example, we are using the selection for dialog work items from today. Other parameters are optional. It is possible to select/list the work item by using the task filter function (for example, filter for a special ‘application component’).

Page 27: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

27

Figure 24 – Transaction SWI2_ADM1 – List of work items without agent

The next figure displays the results of the selection shown in the figure above. To display a work item, select the item from the list (in this example, the first one) and click on the button Display work item.

Figure 25 – Details of the selected work item

The figure above shows the details of the selected work item. To display the log belonging to the work item click on the button SAP Workflow log.

The corresponding SAP Workflow log is displayed in the next figure. Analysis and interpretation of the information in the listed log file is described in the section SAP Workflow log in this document. As no agent has been assigned, you will get no information on Agent. However, in the list of work items without agent, you can determine either to execute agent rules, to forward to an agent or to assign possible agents.

Page 28: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

28

Figure 26 – SAP Workflow log

Page 29: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

29

3.2.1.4 Transaction SWI6 ­ SAP Workflows for Object Transaction SWI6 allows you to determine SAP Workflows working with specific Business Object instances and to analyze the status of SAP Workflow. This transaction is very useful if you do not know how to get the work item ID but only have the business object information.

The only parameter which needs to be specified is Object Type. Other parameters are optional.

Figure 27 – Transaction SWI6 – selection screen ‘object type’

If the Key parameter is specific, then only SAP Workflows using this Object instance with the given key will be displayed in the next screen, otherwise all Object instances will be listed.

Figure 28 – Transaction SWI6 – selection screen ‘object key’

Page 30: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

30

The field Selection variant exists in the entry screen of transaction SWI6. The Selection variant parameter determines the type of instances to be selected (see arrow in the next figure). There are 4 possible entries for this parameter and they could be chosen from dropdown list.

• All Instances

• Active Instances (Running, Ready, Committed)

• Finished Instances (Completed, Cancelled)

• Active Instances (All)

Figure 29 – Transaction SWI6 – selection screen ‘selection var iant’

The next figure shows the result of the displayed selection. There are 4 SAP Workflows listed (1 two step and 3 one step approval SAP Workflows).

Page 31: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

31

Figure 30 – Transaction SWI6 – List of SAP Workflows for object type ‘Requirement coverage request EC’

Select an item and click on ‘Display SAP Workflow log’ to display the corresponding log of the SAP Workflow, and the corresponding log of the SAP Workflow is shown below.

Figure 31 – SAP Workflow log

The SAP Workflow logs and their analysis will be discussed in the section SAP Workflow log of this document.

Page 32: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

32

3.2.2 Error Monitoring and Analysis

Error Monitoring, Analysis and Restarting

Transaction code

Short text Explanation

SWI2_DIAG Listing Work Items with errors and displaying error diagnosis

You can list work items by cause of error.

SWUD SAP Workflow Diagnosis You can use this transaction for SAP Workflow Diagnosis which is very useful if you discover that a particular SAP Workflow is not working correctly.

SM58 tRFC monitor You can monitor and restart hanging Work items in the tRFC queue.

SWPR Restarting SAP Workflow You can restart SAP Workflows after error.

SWPC Continuing SAP Workflow You can continue SAP Workflows that hang after a system crash.

PFTC General Task Maintenance You can check the definition of a task.

SWDD SAP Workflow Builder You can trace the flow and investigate a specific step.

SWO1 Business Object Builder You can display and test an object used in SAP Workflow.

SWEQADM Event Queue Administration You can monitor event queue.

SM37 Monitoring SAP Workflow related jobs

You can monitor SWW* jobs scheduled by WF­BATCH.

Page 33: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

33

3.2.2.1Transaction SWI2_DIAG ­ Diagnosis of SAP Workflows with errors

The transaction SWI2_DIAG allows you to check for work items containing errors. SWI2_DIAG lists work items by cause of error and allows the diagnosis of errors within a specific time frame. Optionally, the result can be filtered by specific tasks.

The only parameter which needs to be specified is the Monitoring period.

Figure 32 – Transaction SWI2_DIAG – work item containing er ror s

After choosing a specific time frame (in this example ‘Today’), check the execution button. The next figure shows the results of this selection. This example lists 2 errors, categorized as Miscellaneous. In this view, you find information about the date and time of creation, the work item type, the work item ID and the work item text.

Figure 33 – Transaction SWI2_DIAG – error list

Page 34: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

34

For more information on a special error, double­click on the item you are interested in. The following popup shows a detailed error explanation.

Figure 34 – Transaction SWI2_DIAG – error diagnosis for a work item

If you double­click on a specified item of the error, you can see a more technical error description.

Figure 35 – Er ror text of a specified item

In this technical description, you will find an error message code (for example: Message no. WL821). This message code is useful in searching for an SAP Note to help manage the problem.

3.2.2.2Transaction SWUD ­ SAP Workflow Diagnosis The SWUD transaction is the ‘SAP Workflow Diagnosis’ transaction, which can be very useful should you discover that a particular SAP Workflow is not working correctly. It is a sort of check list that contains the tests you can run in order to find the errors in the SAP Workflow you are analyzing.

The checklist order is determined dynamically according to:

a) Your SAP Workflow definition

b) The statistics of the most common mistakes made when creating/activating an SAP Workflow.

Page 35: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

35

When you call the transaction SWUD, you get the screen shown in the figure below.

Figure 36 – Transaction SWUD – initial screen

It is subdivided into three areas:

1. The first section shows the SAP Workflow definition currently being analyzed;

2. In the center, a list with the test options is displayed;

3. At the bottom is a list of the last ten SAP Workflow definitions which were analyzed.

Any SAP Workflow accessed through this transaction is added to the last­used list. The SAP Workflow can be recalled at a later date by clicking on the reuse icon in the left­hand column of the last­used list (in the figure above).

As can be seen in the previous figure, you have to enter the task type (Standard task (TS), Customer task (T), SAP Workflow template (WS) or SAP Workflow task (WF)) and the task (this is the ID that identifies the particular SAP Workflow or task) that you want to analyze. You can also use the search help for a selection based on standard search criteria.

In the following paragraphs, we will give you an overview of the four test options offered in the list and, in order to accustom you to this transaction, we will illustrate the test options, by means of screen shots. As an example the SAP Workflow WS30100051 SAP Workflow system verification is used. For more details, refer to SAP Note 322526 Analysis for SAP Workflow problems and read the documentation by clicking on the button .

Test options

• Verify Automatic Customizing

• Problem: Task not started

• Problem: SAP Workflow is hanging

• Test environment

Page 36: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

36

Option ‘Verify Automatic Customizing’

If an SAP Workflow which has already been tested does not work properly, then customizing settings should be checked for any changes. If this is the case, the SAP Workflow administrator can check these settings by means of this check tool.

Executing this test springs into the transaction SWU3 Automatic SAP Workflow Customizing. If any errors are found here, read the documentation for the error.

Figure 37 – Transaction SWU3 – Initial screen

Page 37: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

37

Option ‘Problem: task not started’

This functionality can help you to find why the SAP Workflow or task did not start or could not be found. By means of this option, you get a list of checks as displayed in the next figure.

Figure 38 – Transaction SWUD – Option ‘Problem: task not star ted’

In this screen, the SAP Workflow administrator can start different checks (for example, Determine instances for task). For more background information, click on the Icons marked with the arrow in the figure above.

Sub­options of Problem: task not started: • Determine instances for task • Refresh organizational environment • Event queue (tRFC log) • Event trace • Consistency check for tasks • Simulate event

Determine instances for task:

This is used to check whether the task was started and an SAP Workflow or a work item created. You can branch to the work item display. If you set the flag Inc. component, work items are also displayed that were created in the started SAP Workflow. You can only set this flag in the test environment after you have executed Start task.

Refresh organizational environment:

All the work items that the user is assigned to are displayed in the Business Workplace. This organizational assignment between task and user is read from a buffer. The buffer is only updated every 24 hours. If work items that you have been assigned to in the last 24 hours are not displayed in the Business Workplace, choose this function.

Caution: Only your own settings are updated using this function. If a work item is not displayed for another user, this user has to refresh his organizational environment himself. For this purpose, this function is also available in the Business Workplace.

Page 38: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

38

Event queue (tRFC log):

This is used to display the work item queue (log of the transactional RFC – Transaction SM58). If tasks to be started are not generated or are generated with delay, this is displayed in the work item queue. If one of the receivers cannot be called correctly, subsequent receivers will not be able to be started correctly either.

Event trace:

This is used to check whether the event that is to start the SAP Workflow was created correctly. All events created correctly are logged in the event trace irrespective of whether possible receivers exist. You can also monitor it with Transaction SWEL.

Consistency check for tasks:

A syntax check of the SAP Workflow definition or the task definition is performed. All known errors and warnings are listed.

Figure 39 – Consistency check for tasks

Simulate event:

By simulating an event, all the tasks that would potentially be started by the event are displayed. You can check whether your task, which is to be checked, would be started without errors. An extended error analysis is not possible.

Figure 40 – Simulate event

Page 39: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

39

Option ‘Problem: SAP Workflow is hanging’

This is used to determine why the selected SAP Workflow does not continue and is not correctly terminated. This option allows you to run the tests shown in the next figure. For more background information, click on the Information’ Icons.

Figure 41 – Transaction SWUD – Option ‘Problem: SAP Workflow is hanging’

Sub­options of Problem: SAP Workflow is hanging:

• Determine instances for task

• Work item queue (tRFC log)

• ABAP dump analysis

• Consistency check for components

Determine instances for task

Work item queue (tRFC log)

ABAP dump analysis:

If the called object method ends with an ABAP runtime error, the corresponding SAP Workflow terminates without an entry and the SAP Workflow log appears. The system produces a short dump under the user SY­UNAME or the user that the logical destination SAP WORKFLOW_LOCAL is assigned to. ABAP dump analysis can be called by Transaction ST22.

Consistency check for components:

You use this function to check not only the SAP Workflow definition but also all the task definitions of the tasks referenced in the SAP Workflow definition. If you set the flag Including subflows, all sub­SAP Workflows and the tasks contained in them are included in the check. All errors and warnings found are listed.

Page 40: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

40

Figure 42 – Consistency check for components

Option ‘Test Environment’ This is used to test the selected task (in the next figure). You can start the task and monitor further processing in the SAP Workflow log. If you set the flags to include task type, the tasks and business object types that are components of the task to be tested are also displayed in the test.

Tasks that have a red background do not have an agent assignment. You can also display the tasks and business objects types directly.

Figure 43 – Transaction SWUD – Option ‘Test Environment’

Page 41: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

41

Sub­options of Test environment: • Determine instances for task • Consistency check for tasks • Consistency check for components • Simulate event • Start task • Create event • Test method • Switch on container monitor • Display SAP Workflow Trace • Display task in a new session

Determine instances for task

Consistency check for tasks

Consistency check for components

Simulate event

Start task:

This is used to access the dialog execution of tasks or SAP Workflows. After you have entered the required input data and deadline data, you can start the task. Further information on the process flow of the task can be found in the SAP Workflow log. If you set the indicator SAP Workflow trace, the process is logged in the SAP Workflow trace. You have to assign a name to the SAP Workflow trace to be logged. The SAP Workflow trace should only be used by experienced SAP Workflow developers.

Create event:

This is used to create an event. After the event has been created, you can verify the event creation in the event trace. If you then choose Determine instances for task, you can check whether the task was started by the event. If you set the indicator SAP Workflow trace, the process is logged in the SAP Workflow trace. You have to assign a name to the SAP Workflow trace to be logged. The SAP Workflow trace should only be used by experienced SAP Workflow developers.

Test method:

This is used to start the test of methods of a business object type. Select an object type and a corresponding method and, if necessary, specify other parameters.

Switch on container monitor:

This is used to switch off the container monitor. When a task is executed, the container content is displayed in a dialog box where changed container elements are flagged by a star. To switch the container monitor off, choose Debug off in the container monitor. The data displayed in the container monitor can also be found in the SAP Workflow trace.

Display SAP Workflow Trace:

This displays the SAP Workflow trace. This function can be called by Transaction SWU9.

Display task in a new session:

The task definition is displayed in a separate session. Note that you can open a maximum of six sessions at the same time.

Page 42: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

42

Figure 44 – Transaction SWUD – Display SAP Workflow template

3.2.2.3Transaction SM58 ­ tRFC Monitor SAP Workflow is started with Transaction RFC. Transaction SM58 allows you to view a list of SAP Workflow related LUWs (Logical Unit of Work) that are being processed or hanging with error.

In order to use this monitor, it is essential that you refer to the information on maintaining the logical destination SAP WORKFLOW_LOCAL_<client> in Automatic SAP Workflow Customizing with Transaction SWU3.

Then enter SAP WORKFLOW_LOCAL_<client> in the ‘TRFC Destination’ field in the selection screen of SM58.

Figure 45 – Transaction SM58 – selection screen

The errors are displayed in red in the Status Text.

If you see many entries with Status Transaction recorded, it is possible that not enough resources are available for processing SAP Workflow.

Page 43: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

43

Figure 46 – Transaction SM58 – LUWs for RFC destination ‘SAP WORKFLOW_LOCAL_001’

When you double­click the Transaction ID displayed next to Status Text, you can display some details of each LUW.

Figure 47 – Transaction SM58 – Er ror texts and tr ansactional ID

If they are temporary errors, you can reprocess them from the menu: Edit à Execute LUWs. Then, the selection screen of the report RSARFCEX appears. When necessary, you can run this report in a background job on a regular basis.

Figure 48 – Transaction SM58 – Executing LUWs

Refer to SAP Note 888279 Regulating/distributing the SAP Workflow load, when a large number of SAP Workflows are started in your system.

Page 44: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

44

3.2.2.4Transaction SWPR ­ Restart SAP Workflow With Transaction SWPR, you can restart work items with error after the error is corrected. You can first bring up a list of all work items with errors (without restarting immediately) and then restart work items one by one, or you can restart all the work items with errors immediately by selecting Restart immediately option in the selection screen.

Figure 49 – Transaction SWPR – Selection screen

Figure 50 – Transaction SWPR – List up work items with er ror

3.2.2.5Transaction SWPC ­ Continue SAP Workflow Transaction SWPC enables you to continue work items that are hanging after a system crash, a shut down or a short dump. You can either display all work items to continue first, or continue them immediately by selecting the Continue immediately option in the selection screen.

Page 45: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

45

Figure 51 – Transaction SWPC – selection screen

3.2.2.6Transaction PFTC ­ General Task Maintenance Transaction PFTC allows you to check the definition of a task including ‘Container’ and ‘Triggering events’. You can select one of the following task types.

• Standard task (single­step task, task type TS)

• Customer task (single­step task, task type T )

• SAP Workflow template (multistep task, task type WS)

• SAP Workflow task (multistep task, task type WF)

• Task group (task type TG)

Figure 52 – Transaction PFTC – initial screen

Page 46: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

46

Figure 53 – Transaction PFTC – SAP Workflow template

By clicking the SAP Workflow Builder button under the Basic data tab strip, you can launch SAP Workflow Builder (Transaction SWDD – See next).

Under the Triggering events tab strip, you find the Events definition with the corresponding object type which you can use in Transaction SWI6.

Page 47: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

47

3.2.2.7Transaction SWDD ­ SAP Workflow Builder With Transaction SWPC you can trace the flow and see exactly where the problem exists and then investigate the specific step. For example, binding, object method and agent assignment, and so on.

Figure 54 – Transaction SWDD – SAP Workflow template 79900001

3.2.2.8Transaction SWO1 ­ Business Object Builder Transaction SWO1 allows you to display and test object types in the Business Object Repository. For instance, if a work item was executed by a user but execution finished with an error. It is useful to find out the business object method used in the work item and get the object instance fro the work item container and test the method execution via SWO1 to see if there are any exceptions etc.

Figure 55 – Transaction SW01 – initial screen

Page 48: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

48

You can display the definition of the object and corresponding programs, parameters and exceptions.

You can use the Test option to test the object.

Page 49: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

49

3.2.2.9Transaction SWEQADM ­ Event Queue Administration

You can use the event queue to delay the starting of receivers reacting to a triggering event. To achieve this, the receivers are stored in a temporary memory. Only those receivers whose linkages were active when the event occurred can be stored. The event queue does not allow you to store the event itself in order to determine the active linkages later. This means that the system load caused by a large number of events being created can be spread over a longer time period (which can be set by the SAP Workflow system administrator). This combats the threat of system overload. This is achieved using the transactional RFCs for starting the receivers not being called immediately, but after a time delay and in small numbers. Using the event queue, therefore, delays the calling of the receivers. The event queue can also be used to store events that have errors temporarily.

Figure 56 – Transaction SWEQADM – initial screen

Tab page Function

Basic data The administrator and the error feedback behavior are maintained here.

Activation You can activate the event queue and define the linkages for which the event queue is to temporarily store events and receivers.

Background job The event queue is read at regular intervals by a background job. The events found are delivered to the registered event receivers.

Event delivery On this tab page you maintain how the event receivers are to be started. A defined number of events is delivered by the background job in each cycle. These events can be processed sequentially or in parallel (with aRFC). The receivers can be started synchronously (with RFC) or asynchronously (with tRFC).

Linkages with errors If an error occurs within an event receiver, this error can cause the event data to be lost and prevent the receiver from starting. To enable the event to be delivered again after an error, the event data can be entered into the event queue.

Page 50: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

50

3.2.2.10 Transaction SM37 – SAP Workflow related Job Monitoring

You need to monitor background jobs scheduled by the user WF­BATCH. As most of these jobs are scheduled very frequently, it is indispensable to set up automatic job monitoring with CCMS on SAP Solution Manager to do immediate error analysis and solve a problem in case jobs are cancelled.

Job name Report name Explanation

SWWCOND RSWWCOND Execute single background job for work item deadline monitoring.

SWWDHEX RSWWDHEX Deadline monitoring for work items.

SWWERRE RSWWERRE Monitoring for incorrect or stopped background steps

SWWCLEAR RSWWCLEAR Execute work item clearing work once.

SWFSLSDLEX RSWFSLSDLEX Triggering Deadline Monitoring

Figure 57 – Transaction SM37 – Job list with the user WF­BATCH

3.2.2.11 Error handling roadmap The section Monitoring and Analysis Tools describes the procedure of SAP Workflow monitoring. It gives an overview of the monitoring tools, their functions, and their use. For a quick analysis of problems and sufficient SAP Workflow monitoring, it could be helpful to use a roadmap.

The following figure shows a roadmap, which can be used for SAP Workflow monitoring in productive operations. This roadmap gives a graphical overview of how to analyze and monitor the major problems corresponding to SAP Workflow processing. Which tool the SAP Workflow administrator uses depends on the information available about the problems which occurred. For example, a special problem has occurred (one SAP Workflow instance does not function) and the SAP Workflow administrator only has information about creation time of the business transaction (for example, Create shopping cart). In this case, use transaction SWI2_FREQ for monitoring the problem and navigate to the SAP Workflow log for analyzing the issue. For monitoring of SAP Workflows and their processes on regular basis, the SAP Workflow administrator should use transaction SWI1.

Error! Objects cannot be created from editing field codes.

Figure 58 – Er ror analysis roadmap

Page 51: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

51

3.2.2.12 Performance Monitoring and Analysis This section will give you some suggestions on how to monitor your system’s performance for SAP Workflow. The performance of SAP Workflow depends on many factors (type of business process, number of messages, activities running on the distributed systems, hardware, and so on). It is advisable that the persons who do the performance monitoring of the SAP Workflow have attended the SAP course: ADM315 Workload Analysis. As the technical knowledge for the monitoring is much more complex, we can only give an overview of the performance monitoring in this document.

Performance Monitoring and Analysis

Transaction code

Short text Explanation

SWI5 Workload Analysis You can establish the workload of individual organizational objects (users, positions, jobs, work centers or organizational units), using the workload analysis.

ST03 (ST03N) Workload Monitor You can display information on system load from various viewpoints and timeframe

STAD Statistical record You can display a statistical record of a single step.

ST12 Single Transaction Analysis You can analyze a single step using the Integrated performance analysis tool with ABAP (SE30) and Performance Trace (ST05).

3.2.2.13 Transaction SWI5 – Workload analysis Using Transaction SWI5 ‘Workload analysis’, you can establish the workload of individual organizational objects (users, positions, jobs, work centers or organizational units). You can look into the past (completed since...) and into the future (to be processed by...) in order to establish workload.

Page 52: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

52

Figure 59 – Transaction SWI5 – Selection screen

Workload for the past

The selection produces a list of work items completed by the members of the organizational object before the specified date.

A work item must meet the following criteria to be displayed in this list:

• The work item must represent a task that satisfies the selection criteria specified as a task filter.

• The work item must be a dialog work item.

• The work item must have the status completed.

• The actual agent of the work item is a user who is assigned directly or indirectly to the organizational object specified.

The result of the selection is displayed with the following information in the list Completed Work Items by Agent and Task:

• Organizational unit of the actual agent

• Agent

• Number of the tasks represented by the work item

• Date of final completion

• Work item text

• Processing duration

If you double­click on an entry, you go to the relevant work item display.

Page 53: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

53

Formatting for statistical purposes

The information can be formatted for statistical purposes. To do this, position the cursor on one of the columns Org. unit, Agent, Task or Date, and select the function Statistics. Depending on the column you selected, the following information is displayed:

• Organizational unit and number of work items completed by an employee from the organizational unit.

• Agent and number of work items completed by this agent.

• Task and number of work items for this task, which were completed.

• Date and number of work items completed on this date.

In addition, the following times are calculated:

• 10% threshold: For 10% of the work items, the duration of processing was shorter than the time specified.

• 50% threshold: For half of the work items, the duration of processing was shorter than the time specified.

• 90% threshold: For 90% of the work items, the duration of processing was shorter than the time specified.

Workload for the future

The selection produces a list of work items that must be processed by the members of the organizational object by the date entered. A work item must meet the following criteria to be displayed in this list:

• The work item must represent a task that satisfies the selection criteria specified as a task filter.

• The work item must be a dialog work item.

• The work item must have one of the following statuses:

o waiting

o ready

o in process

o reserved

o executed

• The actual agent of the work item has to be a user who is assigned directly or indirectly to the organizational object that is specified. This only applies to work items with the status waiting, in process, reserved or executed, since there can only be an actual agent in these cases.

• There has to be at least one user in the possible agents of the work item, who is assigned directly or indirectly to the specified organizational object. (This only applies to work items with the status waiting or ready since these do not yet have a actual agent.)

• The latest end for processing the work item must be before the date entered.

The result of the selection is displayed in the list Workload for .... The list of work items is grouped according to actual agents and tasks. At the end of the list, the work items and tasks for which no actual user exists are displayed under the header Not reserved by an agent. When no date is specified, a user's workload corresponds to the contents of their SAP Workflow inbox.

Page 54: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

54

Threshold value

The process duration of all work items for one task is displayed as standard with threshold values (10% threshold, 50% threshold, 90% threshold). The threshold values should be interpreted as follows: The process duration for the x% threshold means that x% of all work items for this task were processed within this period or a shorter period. The process duration is the total of wait time and process time.

Average value

The process duration can also be displayed as an average value, differentiated according to wait time, process time and total time. The average value is calculated from the sum of the wait times, the process times and the total times for all work items of one task. You can switch between the two displays by selecting the relevant menu option in the View menu. Double­click on an entry to display detailed information for individual work items.

After selecting Tasks, you will display the processing time at the right side.

Figure 60 – Transaction SWI5 – completed work items by agent and task

By selecting ‘Statistics’ button, you will display the number of work items, 10%, 50% and 90%

Page 55: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

55

Figure 61 – Transaction SWI5 – completed work items by agent and task

3.2.2.14 Transaction ST03 (ST03N) ­ Workload Monitor Transaction ST03 (or ST03N) shows you information on the system load from various viewpoints and timeframes. Call the transaction ST03 and select Expert mode. Select the target server and the timeframe to display.

Under the Workload Overview, you will see the response time per task type (Dialog, Background or RFC, etc).

Under RFC Profiles à RFC Server Profile, you will find the response time of Function modules that were called in the system. When you double­click a Function module, you can display a list of users who called this Function module.

Figure 62 – Transaction ST03N – Expert mode

If you do not find RFC Profiles in the left navigation frame, the RFC statistics are not selected. Follow the path: Collector and Performance DB àWorkload Collector à Statistics To Be Created à Select RFC statistics

Page 56: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

56

Figure 63 – Transaction ST03N – Collector and performance DB

Refer to the best­practice document on the “Workload Monitor” in the SAP Service Marketplace for further details: http://service.sap.com/~sapidb/011000358700011662332001E

3.2.2.15 Transaction STAD ­ Statistical Records Transaction STAD shows you statistical record information. When you call the transaction STAD, you have to choose a time frame for the analysis and can specify the client, user, Transaction or Program to limit the selected data. On the next screen you see a listing of all the statistical records for the chosen timeframe. You can then choose an RFC to analyze it further.

Figure 64 – Transaction STAD

Figure 65 – Transaction STAD – Steps executed by the user WF­BATCH

When you select a record and select ‘RFC’, you will find RFC destination (for example, SAP WORKFLOW_LOCAL<client>) and the called Function module (for example, SWW_WI_CREATE_VIA_EVENT_IBF) with the calling time and the transferred data size.

Page 57: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

57

Figure 66 – Transaction STAD – RFC record ‘RFC’

Figure 67 – Transaction STAD – RFC server record ‘Calls’

3.2.2.16 Transaction ST12 ­ Single Transaction Analysis Transaction ST12 was developed to promote the use of ABAP trace, to integrate ABAP and Performance traces (SQL, Enqueue and RFC traces with the transaction ST05) and to make the tracing and analysis process faster and more convenient. ABAP trace with ST12 is the central entry point for performance analysis. It should be used to detect (top­down) any performance hotspot, for functional time distribution analysis, and to optimize ABAP/CPU bound issues. SQL trace should be used for DB bound issues.

Refer to SAP Note 755977 ­ ST12 "ABAP Trace for SAP EarlyWatch/GoingLive"

Page 58: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

58

Figure 68 – Transaction ST12 – ABAP Trace sorted by ‘net time’

3.2.3 Resource Monitoring This section will give you some suggestions on how to monitor your resources for SAP Workflow. The performance of SAP Workflow depends on many factors (type of business process, number of messages, activities running on the distributed systems, hardware, and so on). It is advisable that the persons who do the performance monitoring of the SAP Workflow have attended the SAP course: ADM315 Workload Analysis. As the technical knowledge for the monitoring is much more complex we can only give an overview of the performance monitoring in this document.

Performance Monitoring

Transaction code

Short text Explanation

SMQS Qout Scheduler You can monitor system resources for tRFC with Qout Scheduler

3.2.3.1Transaction SMQS ­ Qout Scheduler The recommended and simplest way to regulate the load that is executed by an SAP Workflow on a system is to register the SAP Workflow RFC destination SAP WORKFLOW_LOCAL_<client> in the transaction SMQS – Qout Scheduler. When the status of the RFC Destination SAP WORKFLOW_LOCAL_<client> shows ‘WAITCONN’ continuously, you may need to increase the value of MAXCONN of this destination as far as enough free Dialog work processes are still available. The status WAITCONN means that the number of activated jobs of LUWs for a destination has reached the given value (MAXCONN) and it waits for the completion of a started job.

Refer to SAP Note 888279 – Regulating/distributing the SAP Workflow load

Figure 69 – Transaction SMQS

Page 59: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© 2007 SAP AG

59

Further resources that should be monitored on a regular basis are: • Work processes • Queues • CPU • Memory • Buffers • Database

3.2.4 Further Information

3.2.4.1Troubleshooting If executing this Best Practice did not produce the desired results,

• Search for related SAP Notes with the component BC­BMT* in SAP Service Marketplace. • Open an SAP Customer Message describing your problem if you find no solution in SAP

Notes.

3.2.4.2Literature • Practical SAP Workflow for SAP (Effective Business Processes using SAP’s WebFlow

Engine), Alan Rickayzen et al, Galileo Press, 2002

3.2.4.3Background Information and References

The following table lists some of the relevant notes for SAP Workflow monitoring.

Description SAP Notes Event creation for SAP Workflow 38968 Deleting work items no longer required 49545 Special features in date monitoring 69470 Performance 72873, 72923, 95857, 98407 Load distribution 888279 Transport of SAP Workflow and PD objects 73318, 77607 Views and substitutions 73992, 74000 SAP Workflow interfaces 77099 Collective restart of SAP Workflows 116412 Analysis for SAP Workflow problems 322526 Create shopping basket: Error in SAP Workflow 396779 Problems with start conditions 304834 CCMS 855865

3.2.4.4Feedback and Questions Send any feedback by opening an SAP customer message with the component SV­BO. You can do this at http://service.sap.com/message.

Page 60: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

3.2.5 APPENDIX: Work Item Archiving

Most of the performance problems in Business Workplace are caused by the missing archiving of Workitems.

3.2.5.1Transaction SWW_SARA The archiving program reads work items for archiving and writes them into an archive. The deletion program RSWWARCD deletes these work items from the database.

You can specify whether or not the deletion program is to be started within Customizing for the archiving object WORKITEM .

The archiving program offers various selection parameters with which you can select which work items are to be archived. The selection parameters are:

• Work item ID

• Task ID

• Actual agent of work item

• Creation date of work item

• End date of work item

The archiving program compiles the list of work items defined with the selection criteria, and passes it to the function module SWW_WI_LIST_ARCHIVE. The latter then archives the intermediate documents using the function modules and FORM routines from the function group SWWX in conjunction with the FORM routines from the Archive Development Kit (ADK).

Only work items with an end status (COMPLETED or CANCELLED) can be archived. In addition, archiving can only be initiated for work items that are not dependent on other work items (top­level work items). This ensures that work items that are still being processed are not archived.

Work items dependent on the selected work items are also archived automatically (for example work items that are part of an SAP Workflow). This recursion is performed internally by the FORM routine READ_WORKITEM_DATA_FROM_DB. If you set the indicator Output work items as list, the selected work items are output in a list.

For detailed information, refer to Data Management Guide in SAP Service Marketplace.

http://service.sap.com/ilm à Data Archiving à Media Library à Literature and Brochures à Data Management Guide (PDF file)

Page 61: SAP Workflow Monitoring

Best Practice: SAP Workflow Monitoring

© Copyright 2007 SAP AG. 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. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft ® , WINDOWS ® , NT ® , EXCEL ® , Word ® , PowerPoint ® and SQL Server ® are registered trademarks of Microsoft Corporation. IBM ® , DB2 ® , OS/2 ® , DB2/6000 ® , Parallel Sysplex ® , MVS/ESA ® , RS/6000 ® , AIX ® , S/390 ® , AS/400 ® , OS/390 ® , and OS/400 ® are registered trademarks of IBM Corporation. ORACLE ® is a registered trademark of ORACLE Corporation. INFORMIX ® ­OnLine for SAP and Informix ® Dynamic Server

TM are registered trademarks of Informix Software

Incorporated. UNIX ® , X/Open ® , OSF/1 ® , and Motif ® are registered trademarks of the Open Group. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C ® , World Wide Web Consortium, Massachusetts Institute of Technology. JAVA ® is a registered trademark of Sun Microsystems, Inc. JAVASCRIPT ® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, SAP Logo, R/2, RIVA, R/3, ABAP, SAP ArchiveLink, SAP Business SAP Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies. Disclaimer : SAP AG assumes no responsibility for errors or omissions in these materials. These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non­infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party Web pages nor provide any warranty whatsoever relating to third party Web pages.