Sie sind auf Seite 1von 35

Workflow - Inside

Alan Rickayzen
SAP AG
®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 1

1. Part Technology for Workflow Debugging

z Events
z Binding
z Methods
z Workflow system
z Agent assignment
z Diagnosis transaction

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 2

Page 1
Workflow System

Events

Application

Flow
Dataflow
RFC connections
User assignment
Legacy Systems BOR
®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 3

Debug methods

z Event simulation
z Event log
z RFC queue
z Event creation in SWUE
z Instance linkage

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 4

Page 2
Event consequences

z Triggering workflows
z Terminating events
„ Wait steps
„ Asynchronous steps

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 5

Creating events

z Form inside a SAP user-exit


z Directly in your ABAP program
z Customer status management
z System status management (QM, ECM)
z Change documents
z Message control
z Human Resources tables
z Logistic Information System

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 6

Page 3
Event simulation

Events can be
activated

Event items
too

Error codes

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 7

Event log - SWEL

Object key

workflow

Not necessarily!

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 8

Page 4
Event trigger - SWUE

Set this flag to use


ABAP debugger

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 9

Event type linkage - SWE2 SWE_EVENT_MAIL

Avoid modifying
by hand.

Set to ‘NONE’ for synch debugging

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 10

Page 5
Event instance linkage

Compare key
with event log ®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 11

Events: Problem avoidance

z Use BOR delegation.


z Document your events.
z Walk through the synchronization scenario.
z Only use parameters with events that you trigger
yourself.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 12

Page 6
Binding

z Workflow step log (error class W8)


z Use the technical trace
„ Activate for a complete process
„ Several traces may be active at one time
„ Automatic retention period

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 13

Technical trace

Lines can be
marked permanently

ContBindExecute
shows the binding

The preceeding line


shows the direction®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 14

Page 7
Technical trace: Binding 1

Result of
the binding

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 15

Technical trace: Binding 2

Error messages

Binding definition

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 16

Page 8
Binding: Problem avoidance

z Avoid automatic binding


(unless the flow is simple)
z Check flow container definition for redundant elements
z Use object attributes where possible
z Double-check multi-line elements.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 17

Methods

z Test with transaction SWUH


z Test with background user
(wf_batch) if possible
z Test with standard user

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 18

Page 9
Test method - OSS note 83496
Debug switch

Navigation Input/Export
parameters

Exception

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 19

Workitem status

Exception from method


Erroneous

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 20

Page 10
Methods: Problem avoidance

z Use parameters,
never use secret container elements.
z Use exceptions wherever possible.
z Avoid standard exception macros other than
exit_return.
z Take care distinguishing between table/single element
items.
„ swc_get_element, swc_get_table_element, swc_set_element,
swc_set_table_element

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 21

Workflow

z View step log


z View workitem history
z View workitem exception
z Object links

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 22

Page 11
Workitem technical information

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 23

Step log

History

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 24

Page 12
Error analysis

Error category

Action to perform

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 25

Object link navigation

Application
Application
transaction
transaction
Object
Object links
links
Related
Related Process
Process
workitems
workitems participants
participants
and
and flows
flows

Application
Application Related
Related
transaction
transaction Objects
Objects

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 26

Page 13
Object links

Object links
from application
(QM/PM/SM, EC,FI)
®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 27

Flow version: prior to 4.0 OSS Note 125400

Workflow version
visible in the
flow container

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 28

Page 14
Flow version: 4.0 onwards

Flow Version

SWI1 started with


‘additional data’ flag

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 29

Workflow: Problem avoidance

z Take care with deadlines


z Double-check synchronization
z Define an administrator
z Show step type in description
„ (b) : background
„ (pfe): Par for each
„ (as): Asynchronous
z Highlight BDC methods for upgrade testing
„ e.g. CreateInBackgroundBDC

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 30

Page 15
Agent assignment

z Break-point in function module


z Test role under different users
(including wf_batch)
z Check agent assignment from the workitem

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 31

Agent assignment: Problem avoidance

z Avoid general tasks.


z Avoid the flag ‚error on failure‘.
z Don‘t forget to refresh the
organization buffer
and task profile index
when testing

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 32

Page 16
Diagnosis Transaction: SWUD

z List of last used workflows


z 2 main solution strategies
z Test platform

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 33

Diagnosis transaction

View flow
directly

Select for
analysis

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 34

Page 17
Intelligent Diagnosis

Diagnosis according
to flow definition

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 35

Test platform
Appropriate
tools

View components
directly

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 36

Page 18
2. Part: Performance Tuning for Workflow

z Workflow performance
z Workflow administration
z Workflow archiving

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 37

SAP User Groups


Customers committed to SAP Business Workflow® are
organized in work groups.

Currently those groups exist in the United States and Germany

z American SAP User Group (ASUG)

http://www.asug.com/
z Deutsche SAP Anwender Gruppe (DSAG)

After customer authorization in SAPNet at


http://www.sap.com use the alias
USERGROUPS-DSAG
Get information at bpt@sap-ag.de ®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 38

Page 19
Improving Performance

z Development criteria
z Workflow runtime environment
z Inbox
z Coming up for free (4.5A)

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 39

Check data before starting a flow

Check function module

QQWF_EVENT_NOTIF_CREATED

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 40

Page 20
Start workflow directly

z Start workflow with a function module rather than via


an event.
„ sww_wi_start_simple
„ sww_wi_start
z Consider effects on synchronous chains.
z Document in the workflow how it is started.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 41

Reduce workflow steps

z Use one method in place of many.


„ E.g. ‘Send mail’ to multiple users
„ E.g. Merge background steps together
„ Methods may call other methods

z Use work queues instead of par-for-each.


„ Background methods
„ Function group SWZA

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 42

Page 21
Avoid terminating events

z Replace asynchronous methods with synchronous


methods
„ Advantage: less rfc overhead
„ Disadvantage: Less control over flow
Š Has the step really finished?
„ Disadvantage: Synchronization problems.
„ Disadvantage: Step must be executed from inbox.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 43

Optimize workflow data

z Use BOR attributes instead of container elements


„ E.g. &PO.purchasegroup.phone&

z Replace reading/calculating background methods with


virtual attributes

z Buffer attributes in BOR definition


„ E.g. ‘if order_list[] is initial.
Perform get_order_list....

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 44

Page 22
Optimize workflow data (cont’d)

z Avoid large structures in containers


„ Reduces database access (one line per field)
„ Reduces DDIC overhead
Š no ABAP code generation
Š reduced DDIC database queries
z Do not export multiline container elements
„ Database update instead of a delete + insert

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 45

Summary: Improving Performance

z Check data before starting a flow (Check function may


append to the event container).
z Start workflow directly
rather than via an event.
z Use one method in place of many.
z Replace simple background methods
with virtual attributes.
z Reduce container size/access

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 46

Page 23
Improving Performance: System

z Switch off event log


(check current installation).
z Archive and delete old workitems.
z Avoid bursts of activity to avoid:
„ blocking the applications servers
„ job planning when the RFC queue is full.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 47

Distribute work

z Trigger flows via separate logical destinations.

Process 1
started here
RFC_server1
Application
Server 1
Update Task

Application
Server 2 RFC_server2
Workflow
Process 2
started here
started here

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 48

Page 24
Distribute work-processes

z Define separate R/3 RFC destinations


that point to specific servers.
z Assign these RFC destinations to
the main events.
Process 1
RFC_server1 started here

RFC_server2
Process 2 ®
started here
 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 49

Specify Workflow Server

WS001
RFC_server1 started here
RFC Destination

WS001

RFC_server1 RFC_server2
WS002
started here

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 50

Page 25
Isolate Workflow Processes

z Separate application server


z RFC background
destination
(workflow_local_ccc)
routes to one server.
z Ignore
customizing warning.

Workflow
Server

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 51

Summary for Improving Performance: System

z Deactivate event log.


z Archive workitems.
z Avoid event bursts.
z Reroute workflows away from
- the update-task server
- the application servers.
z Update database indices periodically.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 52

Page 26
OSS Performance notes

z 98407 Workflow performance tips


z 72032 Database indices

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 53

Improving Performance: Inbox

z Avoid general tasks.


z Configure inbox without extra columns
„ Task, Overdue, Todo-by-date,
Todo-by-time, Group, Object.
z More detailed task assignment in the organizational
model
(use positions instead of jobs if necessary)

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 54

Page 27
Workflow Performance: Release 4.0

z Better RFC handling (factor 3)


z Better Inbox performance
(direct selection)
z Workflow system optimized

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 55

Runtime RFC calls

3.0C 3.0D
FI FI Execution

WI
WI Execution
3.0C
WI Confirmation
D 3.1G
BI1
BI Execution
B1 3.0C
BI Confirmation
3.0D
3.0C BI2
B2
BI Execution
3.1G
3.0C BI Confirmation
3.0D

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 56

Page 28
Administration

z Customizing in the productive system


z Workflow administration duties

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 57

Customizing SWU3

Delete jobs by hand


if necessary

Maintain separate
number ranges in the
production system

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 58

Page 29
Deadline Monitoring Exceptions

z Many deadlines
„ Switch from single case-oriented to permanent
z Several instances of SWWDHEX
„ Delete all instances with job overview (SM37)
„ Reschedule using SWU3
z No instances of SWWDHEX
„ Check selection with job overview (SWU3)
„ Reschedule using SWU3

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 59

Workitem Analysis

Always
Always check
check
Error Deadline that
that your
your
overview overview
deadline
deadline
calculation
calculation is
is 33
SWI2 minutes
minutes in
in
advance
advance ofof sy-
sy-
uzeit!
uzeit!

Create a task group


for your processes

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 60

Page 30
Tasks without Agents

SWI4

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 61

Workitems without Agents

rhwfotsk

Use the task’s


default role to
return the
workflow
administrator!

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 62

Page 31
RFC queue
SM58

Pay special attention


to workflow_local...

Check
Check for
for dumps
dumps for
for
the
the user
user WF-BATCH!
WF-BATCH!
Pay special attention to Batch
Batch items
items Status
Status
wf-batch
‘Started’
‘Started’ (SWI1)
(SWI1)

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 63

Workflow table monitor

SMUF

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 64

Page 32
Summary: Administrator Duties

z Monitor errors/deadline.
z Workitems without agents.
z Monitor RFC queue and short dumps
(first productive week).
z Monitor workflow table space.

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 65

Archiving and Deleting Workflows

z Delete in test system via reports RSWWWIDE and


RSWWHIDE
z Delete in production system only via archiving object
WORKITEM
z Example report to read archive RSWWARCR
z Do not import back into the system

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 66

Page 33
Archive - Delete

Report RSWWWIDE Archiving object


WORKITEM
Possible in every status Only possible if status is
COMPLETED or CANCELLED
Immediate start without Authorization check via
authorization check TA SARA
Immediate deletion from Archiving and deletion carried out
the database in two separate steps
Execute in dialog or Execute in batch at
in batch a later time
Log data is not deleted Log data is archived and deleted
(use RSWWHIDE afterwards)

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 67

Archiving

SARA

Workitem object
does not archive notes
(but they are deleted)

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 68

Page 34
Archiving

SARA

Process-specific archiving

T 00005

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 69

Better Processes through Technology


®

 SAP AG 1998 M4 SAPTechEd ’98, Karlsruhe (Alan Rickayzen) / 70

Page 35