You are on page 1of 117

IBM Global Services

SAP Business Wor !lo"

Copyright IBM Corporation 2003

IBM Global Services

Course Content
Intro$uction Wor !lo" architecture Wor !lo" %e!inition an$ "or !lo" &e'plate Wor !lo" steps in $etails &as Business (b)ects an$ Metho$s Container Structure an$ Container Progra''ing *vents (rganisational structure an$ role resolution %i!!erent types o! Agent Wor !lo" an$ A+*
# Copyright IBM Corporation 2003

IBM Global Services

SAP Business Workflow


SAP Business Wor !lo", is a cross-application tool that 'a es it possible to integrate business tasks/processes bet"een applications &his tool "as intro$uce$ in ./3 .elease 3-0A0 an$ receive$ a substantial !aceli!t in the *n)oy .elease0 1-2A0"hich "arrante$ the ne" na'e Wor !lo" Buil$er-

Copyright IBM Corporation 2003

IBM Global Services

Need of Workflow
!
Hmm ! Time to put in a purchase requisition request I "onder "ho approves buying this stuff#

TIME IS MONEY!!!
+

I guess Id better send off some inter-office mail to ask the approvers to approve my requisition

Time drags on

%ean"hile& in %r %anagers office '(hat shall I do ne)t#*

Copyright IBM Corporation 2003

IBM Global Services

%ra"bac s
Inefficiency. *ach lacks a way to trace "here a tas is Who executed or is e3ecuting it 4o" 'uch ti e it re!uired-

Copyright IBM Corporation 2003

IBM Global Services

Why SAP Workflow


Wor !lo" ensures that the right "or is sent to the right person at the right ti'e in the right se5uence "ith the right in!or'ation &ool !or the auto'i6ation o! "usiness processes 7ot tie$ up to any paricular application (perates uni!or'ly accross applications Coor$inate all participating tas s Provi$e users "ith acti#e support Intelligent routing

Copyright IBM Corporation 2003

IBM Global Services

SAP Business Workflow Architecture

Copyright IBM Corporation 2003

IBM Global Services

Workflow Architecture
Organisational Level

Process Level

Business Object Level

Copyright IBM Corporation 2003

IBM Global Services

Workflow $efinition

Copyright IBM Corporation 2003

IBM Global Services

Workflow $efinition
A "or !lo" $e!inition $escribes the "or !lo" process

Wor !lo" $e!inition consists o! 3182:Basic %ata In!or'ation about triggering events Initial 9alues Containers Bin$ings

Copyright IBM Corporation 2003

IBM Global Services

Workflow Builder
&he "or !lo" $e!inition is create$ in the Wor !lo" Buil$er an$ $isplaye$ graphically in a net"or %ransaction& SW%% 'enu Path& &ools Business Wor !lo" %evelop'ent %e!inition tools Wor !lo" Buil$er-

Copyright IBM Corporation 2003

IBM Global Services

Workflow $efinition - Steps


A "or !lo" $e!inition is 'a$e up o! in$ivi$ual 'o$ular steps-

Copyright IBM Corporation 2003

IBM Global Services

(xa ple& Workflow $efinition

Copyright IBM Corporation 2003

IBM Global Services

)ow are Workflows Created in a Syste


Within "or !lo" te'plates0 there is a ey "ith the !ollo"ing structure; < A WS tas abbreviation !or the "or !lo" te'plate < An =<$igit se5uence nu'ber >ro' the structure o! the =<$igit nu'ber0 the syste' no"s "hether the te'plate is a stan$ar$ te'plate $elivere$ by SAP or one create$ by the custo'erCusto'er<$e!ine$ te'plates start "ith the pre!i3 nu'ber that "as $e!ine$ in Custo'i6ing !or the syste' an$ client-

Copyright IBM Corporation 2003

IBM Global Services

Workin* with Workflow

Copyright IBM Corporation 2003

IBM Global Services

Workflow $esi*n

Copyright IBM Corporation 2003

IBM Global Services

)ow workflow *ets executed

Copyright IBM Corporation 2003

IBM Global Services

Workflow %ool"ox - SW+S


%ransaction& SW?S'enu Path& &ools <@ Business Wor !lo" <@ %evelop'ent <@ .unti'e &ools<@ Start Wor !lo" A&est *nviron'entB-

Copyright IBM Corporation 2003

IBM Global Services

Workflow Steps

Copyright IBM Corporation 2003

IBM Global Services

Workflow definition steps


Wor !lo" $e!inition is 'a$e up o! in$ivi$ual steps- When creating a step in a "or !lo" $e!inition0 the step type 'ust be speci!ie$ !irst&here are - Steps "hich re!er to "usiness acti#ities Aactivities C user $ecisionB
-

Steps "hich are use$ !or internal process control an$ 'onitoring Acon$ition0 'ultiple con$ition0 loop0 etcB

Copyright IBM Corporation 2003

IBM Global Services

Business Acti#ities Steps


Acti#ity - Can be a single step tas "ith basic business !unctionality - Can be a 'ulti<step tas 0 "hich re!erence to a "or !lo" $e!inition +ser $ecision - &his provi$es an opportunity !or user interaction "ith the syste'- &he response to this $eci$es the selection o! the subse5uent step $ocu ent fro te plate - PA $ocu'ent is create$ !ro' a $ocu'ent te'plate using variables in the te3t that are !ille$ $uring progra' e3ecution We" Acti#ity - Selecte$ container ele'ents are poste$ using http protocol in DM+ or S(AP 'essage

Su"workflow
-

An activity "hich re!ers to a "or !lo" rather than a tas


# Copyright IBM Corporation 2003

IBM Global Services

Internal process control Steps


Condition - Branch on the basis o! control in!or'ation !ro' the runti'e $epen$ent conte3t o! the "or !lo"- An attribute o! this ob)ect can also be accesse$ !or con$ition evaluation - Con$ition evaluation can be $one by >iel$ co'parison e-g constants 0 ob)ect attribute0 syste' !iel$s 'ultiple condition - In contrast to con$ition0 'ultiple con$ition 'a es it possible !or the "or !lo" $e!inition to branch in 'ore than t"o branches-

>or evaluation o! the 'ultiple con$ition0 the value o! the basis o! co'parison is chec e$ at runti'e against the co'parison values an$ branche$ accor$ingly-

Copyright IBM Corporation 2003

IBM Global Services

Internal process control ,contd.W)I.( .oop - Steps are processe$ repeate$ly until the con$itions containe$ in the W4I+* step no longer apply +ntil .oop - Steps are processe$ repeate$ly until the con$ition containe$ in the ?7&I+ step is true /ork - ?se$ !or parallel processing branches- (nly a part o! the parallel processing branches actually has to run to continue the "or !lo"- %yna'ic parallel processing is also possible

Copyright IBM Corporation 2003

IBM Global Services

Internal process control ,contd.Send ail - &e3t entere$ in this step can be use$ to sen$ a 'ail to the agent assigne$ Container operations - ?se$ to per!or' arith'etic operation o! value assign'ent to "or !lo" container ele'ents using constants an$ $ata in the "or !lo" container -

Copyright IBM Corporation 2003

IBM Global Services

Internal process control ,contd. (#ent Creator - An event is create$ "hen this step in the "or !lo" is reache$- (ther "or !lo"s can be starte$ as a reaction to the event create$ in this step- &his event 'ust be the triggering event o! the relevant "or !lo" tas s an$/or te'plates WAI% for e#ent - ?se$ to stop the "hole e3ecution o! the "or !lo" until the event is create$ in the syste'- ?se$ to "ait !or events !or parallel processing

Copyright IBM Corporation 2003

IBM Global Services

%ask 0 Workflow $efinition

Copyright IBM Corporation 2003

IBM Global Services

&as s are use$ to $escribe a business process

Stan$ar$ &as A&SB Single step Custo'er &as A&B &as s Wor !lo" &e'plateAWSB Multistep Wor !lo" &as AW>B

Copyright IBM Corporation 2003

IBM Global Services

Si ilarities and differences of task types

Customer Task T!"e T# Workflow %ask ,%ype W/Create$ b! customer customer &it' vali$it! "erio$ Client($e"en$ent Must be linke$ to its "ossible "ossible agents )'en it is $e*ine$

Stan$ar$ Task T!"e TS# Workflow %e plate ,%ype WSCreate$ b! S%P an$ &it'out vali$it! "erio$ Client(in$e"en$ent Must be linke$ to its agents )'en it is $e*ine$

Copyright IBM Corporation 2003

IBM Global Services

Sin*le and 'ultistep %asks


&ransaction ; P>&C Menu Path <@ &ools <@ Business Wor !lo" <@ %evelop'ent <@ %e!inition tools <@&as s

Single step

.e!erences one o"1ect type ethod an$ $isplays one step in the business process

&as s
.epresents the "usiness process an$ is a se5uence o! in$ivi$ual tas s an$ control steps
Copyright IBM Corporation 2003

Multistep

IBM Global Services

Sin*le-step tasks
, Single<step tas s $escribe ele'entary business activities-

, Single<step tas s operate on an ob)ect an$ re!er to one ob)ect 'etho$ each

, Single<step tas s are lin e$ to their possible an$ per'itte$ agents "hose organi6ational assign'ents are $escribe$ in the organi6ational plan o! the enterprise-

, *3ecutable single<step tas s are represente$ by "or ite's at runti'e-

Copyright IBM Corporation 2003

IBM Global Services

Workflow definition - 'ultistep tasks


, A "or !lo" $e!inition has a 'o$ular structure consisting o! in$ivi$ual steps "hich are lin e$ together&he 'ultistep tas s !or' the business !ra'e"or !or a "or !lo" $e!inition an$ each re!erences one "or !lo" $e!initionA step in a "or !lo" $e!inition can be an activityAn activity al"ays re!ers to one tas AE single<step tas or 'ultistep tas BAn activity "ith one si'ple triangle re!ers to a tas An activity "ith three triangles re!ers to a "or !lo" AsubworkflowB-

, , , ,

Copyright IBM Corporation 2003

IBM Global Services

%ask $efinition 2 Synchronous and Asynchronous 'ethods

Copyright IBM Corporation 2003

IBM Global Services

$efinin* a %ask

Copyright IBM Corporation 2003

IBM Global Services

Settin*s for %asks


&as e3ecute$ in bac groun$ $epen$ing on ob)ect 'etho$ At runti'e user can create attach'ents ?ser e3plains e3plicitly that "or ite' is no longer is to be processe$ Confir end of processin*

Back*round SAPphones

&he "or !lo" $ials the telephone nu'ber attache$ to the current custo'er
# Copyright IBM Corporation 2003

IBM Global Services

I portant %ask Attri"utes


3eneral <Wor ite's can be e3ecute$ an$ !or"ar$e$ to any SAP ?ser 3eneral /orwardin* Allowed <Wor ite's can be !or"ar$e$ to any user 3eneral /orwardin* Not Allowed <Wor ite's can be !or"ar$e$ to possible users /orwardin* not allowed <7o !or"ar$ing allo"e$

Copyright IBM Corporation 2003

IBM Global Services

Work Ite
, *3ecutable single<step tas s are represente$ by "or ite's at runti'e, (b)ect that represents a tas or action in the "or !lo" syste' at runti'e, %epen$ing on the "or ite' type0 so'e o! these "or ite's are $isplaye$ in a userFs "or list- (ther "or ite's0 on the other han$0 are only use$ an$ processe$ internally, &he "or ite's are $isplaye$ in the integrate$ inbo3es o! their selecte$ agents0 an$ can be reserve$ an$ e3ecute$ !ro' there-

Copyright IBM Corporation 2003

IBM Global Services

Work Ite s %ypes

Copyright IBM Corporation 2003

IBM Global Services

Workite

%ypes

W& $ialo* work ite .unti'e $isplay !or a single step tas "ith a user $ialog $& 'issed deadline work ite &he 'essage recipient !or the 'isse$ $ea$line is in!or'e$/& Workflow work ite .unti'e representation o! a 'ulti step tas B& Back*round work ite .unti'e $isplay !or a tas e3ecute$ in the bac groun$(& Wait step work ite & .unti'e $isplay !or a "ait step in the "or !lo" $e!inition-

Copyright IBM Corporation 2003

IBM Global Services

Workite

%ext

, &itle o! "or ite' in the Business Wor place , >irst create the "or ite' te3t an$ position the cursor to inclu$e a varible , Choose the FInsert variableF icon un$er the "or ite' te3t

(xa ple
Processes re5uest !ro' CGWIG(b)ectGI%-Create$ByC

Copyright IBM Corporation 2003

IBM Global Services

%ask and its #arious co ponent in SAP

Copyright IBM Corporation 2003

IBM Global Services

Business 4"1ect $efinition and I ple entation

Copyright IBM Corporation 2003

IBM Global Services

4"1ect %ypes 0 Workflow


, SAP Business Wor !lo" has been $evelope$ on an o"1ectoriented basis, &he business ob)ect types are i$enti!ie$ an$ $escribe$ "ith their ob)ect 'etho$s in the Business 4"1ect 5epository,B45- o! the ./3 Syste', Generally one ob)ect is create$ in the syste' an$ then processe$ in a workflow over several steps by various e'ployees-

Copyright IBM Corporation 2003

IBM Global Services

4"1ect %ypes 0 4"1ects


Wor !lo" $eals "ith ob)ect types- (b)ect types are $e!initions o! $ata- In or$er to access $atabase $ata0 "or !lo" uses the ob)ect type inter!ace Most o! the in!or'ation represente$ by ob)ect types is available in the ABAP/1 %ictionary-

4"1ects are create$ at runti'e an$ are speci!ic instances o!


$e!ine$ ob)ect types Many ob)ect types are $elivere$ by SAP- In a$$ition0 the custo'er can create ne" ob)ect types or e3ten$ SAP ob)ects by creating su"types Achil$ ob)ectsB- 7e" custo'er ob)ects or subtypes 'ay be $esire$ i! the $elivere$ SAP ob)ect $oes not contain all the characteristics AattributesB or processing options A'etho$sB $esire$-

Copyright IBM Corporation 2003

IBM Global Services

4"1ect %ype - $efinition

Copyright IBM Corporation 2003

IBM Global Services

Interfaces
Inter!aces are a co'bination o! attributes0 'etho$s0 an$ events to be use$ in co''on a'ong 'ultiple ob)ect types- &he purpose o! inter!aces is to $e!ine co''on !unctionality in one ob)ect type0 an$ to assign that co''on !unctionality via an inter!ace to 'ultiple ob)ect types across the Business (b)ect .epository- &his avoi$s re$un$ancy o! $ata an$ !unctionality $e!inition*ach ne" ob)ect type auto'atically receives the inter!ace I/SAP0 the SAP stan$ar$ inter!ace- I>SAP provi$es every ob)ect type "ith the !ollo"ing; - Metho$ %isplay - Metho$ *3istenceChec - Attribute (b)ect&ype

Copyright IBM Corporation 2003

IBM Global Services

6ey /ields
Hey !iel$s are $esigne$ to uni5uely i$enti!y the ob)ect type-

I! the ey !iel$ has a $ata type re!erence o! a $ictionary table !iel$0 the runti'e syste' "ill loo to that table !iel$ to retrieve the value o! the ey "hen processing the ob)ect- When the ey !iel$ is create$0 the ABAP/1 progra' co$e is generate$ auto'atically "hen the ob)ect type is generate$-

Copyright IBM Corporation 2003

IBM Global Services

Attri"utes
Attributes provi$es access to $ataABAP %ictionary >iel$ 9irtual

Copyright IBM Corporation 2003

IBM Global Services

'ethods
Metho$s incorporate the per'itte$ !unctions available !or an ob)ectMetho$s have i'porting an$ e3porting para'eters as "ell as e3ceptionsMetho$s can be create$ using ;

Copyright IBM Corporation 2003

IBM Global Services

'ethods
lt u s e -

Im"ort Parameters

MET+O,

E."ort Parameters

io "t ce s E. n
Copyright IBM Corporation 2003

IBM Global Services

'ethods - Call attri"utes


-,ialog / or backgroun$ 0 .)ecution of the method is via a "ork item in a users integrated inbo) or in background by the "orkflo" runtime system /ackground methods cannot use messages or e)ceptions because they cannot be processed by the background system and "ill result in termination of the program -S!nc'ronous / %s!nc'ronous
01ynchronous

methods finish e)ecuting before handing control back to the calling program These types of methods can return e)port parameters& results and e)ceptions 2synchronous methods do not return control to the calling program immediately 3nce e)ecuted& they depend upon events to communicate the results of the method back to the calling program 2synchronous ob4ect methods cannot have results& e)port parameters or e)ceptions
# Copyright IBM Corporation 2003

IBM Global Services

'ethods - Call attri"utes


5esult& Synchronous 'etho$s 'ay return an e3port para'eter as a result- A result can be $e!ine$ li e a $ictionary !iel$ or an ob)ect type -

Instance independence& In$icates "hether an ob)ect re!erence is passe$ to the 'etho$ by bin$ing at the ti'e o! e3ecution- Metho$s that generate an$ return an ob)ect re!erence0 such as Create0 or 'etho$s that generate a report listing shoul$ be instance in$epen$ent-

Copyright IBM Corporation 2003

IBM Global Services

I port /(xport Para eters


0The method parameter container contains references to all import& e)port and result parameters "hich need to be e)changed back and forth bet"een the calling program 5single-step task6 and the method /inding is necessary bet"een the single-step task and the method parameter container to accomplish the data transfer 0Import parameters are those values "hich are necessary to e)ecute the method Import parameters are retrieved from the container 738T2I8.9 using the macro instructions 1(7:;.T:.<.%.8T 5single-line6 or 1(7:;.T:T2/<. 5multiline6 I*3port para'eter values are passe$ to the container C(7&AI7*. using the 'acro instructions SWCGS*&G*+*M*7& Asingle<lineB or SWCGS*&G&AB+* A'ultilineB- &he result para'eter is passe$ to the C(7&AI7*. ele'ent .*S?+& via the sa'e 'acro instructions-

Copyright IBM Corporation 2003

IBM Global Services

(xceptions
I*rror han$ling is acco'plishe$ through the use o! 'etho$ e3ceptions Asynchronous 'etho$s onlyBI&he "or !lo" $e!inition can branch accor$ing to these possible error states an$ allo" !or subse5uent steps to han$le these con$itionsMessages an$ e3ceptions cannot be use$ "ith bac groun$ 'etho$s because they "ill ter'inate the progra'I7u'ber o! the e3ception; I000J<J000; e3ceptions $e!ine$ !or inter!aces IJ00J<:KKK; application<speci!ic e3ceptions A!ree !or SAP $evelop'entB I=000<=KKK; e3ceptions raise$ by the ob)ect 'anager IK000<KKKK; e3ceptions $e!ine$ by the custo'er A!ree !or custo'ersB

Copyright IBM Corporation 2003

IBM Global Services

(xceptions
I*3ceptions are i'ple'ente$ "ithin a 'etho$0 bet"een the 'acro instructions B*GI7GM*&4(% an$ *7%GM*&4(%L*DI&G.*&?.7 Co$e 9ariableJ 9ariable2 9ariable3 9ariable1ICo$e E the 1<$igit nu'ber o! the e3ception I9ariableJ through 9ariable1 correspon$ to up to 1 variables "hich can be $erive$ !ro' the 'essage issue$ "ith the e3ceptionI&he !ollo"ing e3ceptions A!or te'porary errorsB are also available to allo" e3iting o! the progra'; L*DI&G(BM*C&G7(&G>(?7% E ob)ect not !oun$ L*DI&GCA7C*++*% E cancelle$ by the user

Copyright IBM Corporation 2003

IBM Global Services

(#ents
*vents $escribe the change in the status o! an ob)ectWor !lo" are usually starte$ using events

Copyright IBM Corporation 2003

IBM Global Services

4"1ect %ype - 5elease Status


, 7ot accessible at runti'e-

, (nly in test or internal use0 possibly unstable-

, .elease$ !or use by the custo'er-

, &he !unctionality has been replace$- &he ol$ !unctionality is still supporte$ !or t"o releases-

Copyright IBM Corporation 2003

IBM Global Services

Su"type
&he subtype inherits all attributes0 'etho$s an$ events o! the supertype an$ is open !or ne" custo'er<speci!ic attributes0 'etho$s an$ events- &he ey !iel$s o! the supertype an$ subtype 'ust be i$entical- &his 'eans that any 'etho$s an$ attributes $e!ine$ on the parent can be e3ecute$ an$ accesse$ on the chil$ ob)ect-

Copyright IBM Corporation 2003

IBM Global Services

$ele*ation
&ransaction; Menu Path; SW0J &ools /usiness (orkflo" - =evelopment - =efinition tools - /usiness 3b4ect /uilder - 1ettings - =elegate

&his $elegation is po"er!ul because it lets you i'ple'ent your o"n business logic "ithout 'o$i!ying any SAP co$e- As long as the ob)ects are properly $elegate$0 your 'etho$ "ill be e3ecute$-

H7AJ Calling Progra' Metho$; Change pass"or$

NH7AJ Metho$; Change pass"or$

Copyright IBM Corporation 2003

IBM Global Services

4"1ects in the workflow

Copyright IBM Corporation 2003

IBM Global Services

Business 4"1ect 5epository ,B45&ransaction; Menu Path; SW0J &ools &ools < Business Wor !lo" L %e!ination tool LBusniness (b)ect Buil$er

Copyright IBM Corporation 2003

IBM Global Services

Containers and Bindin*s


< Wor !lo" <

Copyright IBM Corporation 2003

IBM Global Services

%ypes of Containers

Copyright IBM Corporation 2003

IBM Global Services

Workflow Container
, &he "or !lo" container contains "or !lo"<speci!ic syste' variables an$ other ele'ents "hich are $e!ine$ e3plicitly, As part o! the $e!inition o! the "or !lo" tas 0 the i'port an$ e3port para'eters o! the "or !lo" are $e!ine$ as ele'ents o! the "or !lo" container, When the "or !lo" is $e!ine$ in the "or !lo" e$itor0 ele'ents can also be a$$e$ to the "or !lo" container&hese ele'ents are then Olocal variablesO "ithin a "or !lo" $e!inition an$ can be use$0 !or e3a'ple0 to set up a counting loop# Copyright IBM Corporation 2003

IBM Global Services

%ask Container
, *ach tas container alrea$y contains the "or !lo" syste' variable an$ any a$$itional ele'ents !or the 'etho$ para'eters o! the re!erence$ ob)ect 'etho$, Pou have to a$$ a$$itional ele'ents to the tas container !or a$$itional values are re5uire$ !or variable replace'ent in the "or ite' te3t or in the long te3ts

Copyright IBM Corporation 2003

IBM Global Services

4ther %ypes of Containers


(#ent para eter container Contains an ele'ent "hich can ta e the Aob)ectB re!erence to the ob)ect "hose change o! status is announce$ via the event5ole para eter container Contains the ele'ents re5uire$ as input in connection "ith the role resolution to be run at runti'e'ethod para eter container Contains ele'ents "hich "ill be re5uire$ as i'port an$ e3port para'eters in connection "ith the 'etho$ e3ecution-

Copyright IBM Corporation 2003

IBM Global Services

What is a Container7
Container ,e*inition Container Instance -/2

0 1iel$ values 0 Multiline lists o* *iel$ values 0 Object re*erences ,e*inition -untime

%""lication ,ata

Copyright IBM Corporation 2003

IBM Global Services

$efinin* Container (le ents

Element name ,ata t!"e ,escri"tion Multi(line 3alue re*erence Element Element Element 4 5 2 ,atabase 1iel$ ,atabase 1iel$ Object T!"e ,e*inition ,escri"tion ,escri"tion ,escri"tion 4 5 2

6 6 -untime

Copyright IBM Corporation 2003

IBM Global Services

Bindin*
, A bin$ing is si'ply the art o! o! pouring selecte$ container ele'ents !ro' one container into another, &he bin$ing e$itor is available "hen $e!ining; Wor !lo" $e!initions &riggering events Wor !lo" steps Wor !lo" steps A Stan$ar$ roles/ (b)ect 'etho$s "ith para'etersB , &he bin$ing e$itor al"ays re!erences the container to receive the application $ata- Bin$ing $e!initions can re!erence; Constants 9ariables Acontainer ele'entsB Syste' !iel$s

Copyright IBM Corporation 2003

IBM Global Services

Container 0 $ataflow
&ork*lo) Container Task Met'o$ Event -ole Container Container Container Container
5 2 9 : 44 7

triggering event
8

s!nc task s!nc task


; <

s!nc met'o $ s!nc met'o $

4=

role
42

45 48
#

as!nc task

as!nc met'o $ 47

terminating event
Copyright IBM Corporation 2003

IBM Global Services

Container $ata Structure

S&C>CONT%INE-

,eclare Container

S&C>C-E%TE>CONT%INE-

Initiali?e Container

S&C>-ELE%SE>CONT%INE-

-elease Container

Copyright IBM Corporation 2003

IBM Global Services

Writin*/5eadin* Container (le ents $efined as /ield 8alues


Container Instance 3ariable 3ariable Internal Table Internal Table S&C>@ET>ELEMENT S&C>SET>ELEMENT S&C>@ET>T%BLE S&C>SET>T%BLE S&C>,ELETE>ELEME NT
$elete value

Copyright IBM Corporation 2003

IBM Global Services

Writin* to Container (le ents $efined as 4"1ect %ypes


Container Instance0 CONT%INEObject Element0 M%T-L

,eclare a variable as t'e ke! o* !our object0 ,%T%0 M%TN- LIEE M%-%(M%TN-B 1ill t'e ke! )it' a value0 M%TN- F C452789DB ,eclare a variable as an object0 ,%T%0 M%TE-I%L TYPE S&C>OBAECTB

Create an instance o* !our object in !our "rogram0 S&C>C-E%TE>OBAECT M%TE-I%L CM%-%D M%TN-B
Object t!"e *rom BBOB-B Ee! o* object !ou "reviousl! $e*ine$

rans*er value o* !our object instance to t'e container element0 S&C>SET>ELEMENT CONT%INE- CM%TN-D M%TE-I%L
# Copyright IBM Corporation 2003

IBM Global Services

5eadin* Container (le ents $efined as 4"1ect %ypes


,eclare a variable as an object0 ,%T%0 M%TE-I%L TYPE S&C>OBAECTB -ea$ value o* container element to !our object0 S&C>@ET>ELEMENT CONT%INE- CM%T-LD M%TE-I%LB ,eclare a variable as t'e ke! o* !our object0 ,%T%0 M%TN- LIEE M%-%(M%TN-B -ea$ t'e object t!"e ke! into !our variable0 S&C>@ET>OBAECT>EEY M%TE-I%L M%TN-B ,eclare a variable to 'ol$ t'e object t!"e0 ,%T%0 OBATYPE LIEE S&OTOBAI,(OBATYPEB Obtain t'e object t!"e *rom !our object t!"e variable0 S&C>@ET>OBAECT>TYPE M%TE-I%L OBATYPEB
# Copyright IBM Corporation 2003

Container Instance0 CONT%INE-

Object Element0 M%T-L

IBM Global Services

Writin* to Container (le ents $efined as 'ultiline 4"1ect %ypes


,eclare a variable as an internal table object0 ,%T%0 -EGITEMS TYPE S&C>OBAECT OCCH-S =B Since t'is internal table 'as no 'ea$erI $eclare a )ork area0 ,%T%0 -EGITEM TYPE S&C>OBAECTB ,eclare ke! *iel$s o* t'e object eBgB calle$ P-EGEEY# an$ *ill t'em eBgB )it'in a select loo"#B Create an instance o* !our object *or eac' table line0 S&C>C-E%TE>OBAECT -EGITEM CBHS5==<D P-EGEEYB %""en$ t'e object instance to t'e internal table0 %PPEN, -EGITEM TO -EGITEMSB Once t'e internal table is *ille$I trans*er t'e internal table to t'e multiline container element0 S&C>SET>T%BLE CONT%INE- CP-ItemsD -EGITEMSB
# Copyright IBM Corporation 2003

Container Instance0 CONT%INE-

Element0 P-Items

IBM Global Services

5eadin* Container (le ents $efined as 'ultiline 4"1ect %ypes


-ea$ value o* multiline container element into !our internal table object0 S&C>@ET>T%BLE CONT%INE- CP-ItemsD -EGITEMSB ,eclare !our object0 ,%T%0 -EGITEM TYPE S&C>OBAECTB ,eclare a variable to 'ol$ t'e object t!"e0 ,%T%0 OBATYPE LIEE S&OTOBAI,(OBATYPEB Loo" t'roug' !our internal table object -EGITEMS into in$ivi$ual -EGITEM entriesB Per*orm o"erations as nee$e$B Hse t'is macro to get t'e ke!s o* eac' entr!0 S&C>@ET>OBAECT>EEY -EGITEMS P-EGEEY Hse t'is macro to get t'e object t!"e o* eac' entr!0 S&C>@ET>OBAECT>TYPE -EGITEMS OBATYPEB
# Copyright IBM Corporation 2003

Container Instance0 CONT%INE-

Object Element0 P-Items

IBM Global Services

(#ents

Copyright IBM Corporation 2003

IBM Global Services

(#ent
An event $escribes a possible status change !or an ob)ect in the SAP Syste'Be!ore an event can be use$ in a "or !lo"0 it 'ust be $e!ine$ in the Business (b)ect .epository !or the ob)ect type*vents 'ust be triggere$ e3plicitly- &he application itsel! can be the triggering agent-

Copyright IBM Corporation 2003

IBM Global Services

%ypes of (#ent Creation

Change %ocu'ent

Status Manage'ent

Message Control

Speci!ic 4. &ables

ABAP Co$e In ?ser *3it

Copyright IBM Corporation 2003

IBM Global Services

+sin* Custo i9in* for e#ent tri**er


Menu Path ;Basic 'enu <@ &ools <@ Business Wor !lo" <@ %evelop'ent <@ %e!inition tools <@ *vents

Copyright IBM Corporation 2003

IBM Global Services

(#ent Creation of Chan*e $ocu ent

Changing Master $ata

Change logge$ using change $ocu'ents

*vent creation ASW*CB

*vent lin age is $one to connect to the "or !lo"/ tas

Copyright IBM Corporation 2003

IBM Global Services

(#ent Creation of Status 'ana*e ent

Status Manage'ent

*vent creation ABS9W B

*vent lin age is $one to connect to the "or !lo"/ tas

When user status changes to *002 0 event is triggere$


# Copyright IBM Corporation 2003

IBM Global Services

(#ent Creation of 'essa*e Control


&riggering an event using 'essage control occurs "ith 7AS&Create Message type an$ $e!ine "or !lo" as trans'ission 'e$iu' Create Con$ition &able Create Access Se5uence Assign Access Se5uence to $e!ine$ 'essage type %e!ine Con$ition .ecor$s Assign 'essage type &o proce$ure
# Copyright IBM Corporation 2003

Maintain the processing progra' .SW*MC0J "ith the >(.M routine C.*A&*G*9*7& !or the output type *9*7 an$ trans'ission 'e$iu' K-

IBM Global Services

+sin* ABAP Code


&his is using $one by "riting custo' co$e e-g- by using SAP >M li e SW*G*9*7&GC.*A&* insi$e user e3its0 BA%I etcCALL FUNCTION 'SWE_EVENT_CREATE' EXPORTING OBJTYPE = OBJTYPE OBJKEY = OBJKEY EVENT = EVENT CREATOR = APPLICANT START_WITH_DELAY = ' ' IMPORTING EVENT_ID = EVENTID TABLES EVENT_CONTAINER = CONTAINER EXCEPTIONS OBJTYPE_NOT_FOUND = 01. IF SY SUBRC = 0. COMMIT WORK. ENDIF.
# Copyright IBM Corporation 2003

IBM Global Services

(#ent Creators: 5ecei#ers and (#ent .inka*e


%n!bo$! )ant t'is eventJ

Event Publis'e$ Events Linkage

-eceivers
#

Creator
Copyright IBM Corporation 2003

IBM Global Services

%ype .inka*e (ntry


&ransaction; SW*2 Menu Path ;Basic 'enu <@ &ools <@ Business Wor !lo" <@ ?tilities @ (ther tools @*vent lin age

Copyright IBM Corporation 2003

IBM Global Services

(#ent %race
&ransaction; SW*+ Menu Path ;Basic 'enu <@ &ools <@ Business Wor !lo" <@ %evelop'ent <@ ?tilities <@ *vents <@ *vent &race-

Copyright IBM Corporation 2003

IBM Global Services

4r*anisational Structure

Copyright IBM Corporation 2003

IBM Global Services

4r*ani9ational Structure Business Scenario


, An organi6ational plan in SAP $escribes the organi6ational structure o! a co'pany, &he "or !lo" syste' !in$s the agents o! the in$ivi$ual tas s by evaluating the or*ani9ational plan , &he !unctions to create an$ 'aintain organi6ational plans are part o! the Personnel Planning an$ %evelop'ent AP%B part o! the SAP 4. 'o$ule , Pou 'ust connect this or*ani9ational structure to the "or !lo"

Copyright IBM Corporation 2003

IBM Global Services

4r*ani9ational 'ana*e ent


, 4r*ani9ational units contain positions0 occupie$ by e'ployees, ;o"s are abstract $escriptions o! tas assign'ents, Positions can be lin e$ to )obs- &hey inherit all the tas s assigne$ to that )ob, +sers- A user is an SAP logon user I%- It thus represents a single person, Persons- A person is a speci!ic e'ployee create$ in the 4. 'o$ule, Wor !lo" tas s can be assigne$ to or*ani9ational units0 positions: 1o"s or users, &he "or !lo" syste' uses organi6ational structure to route "or ite's to the correct recipients
# Copyright IBM Corporation 2003

IBM Global Services

Create 4r*anisational Plan


&ransaction; Menu Path; PP(CW &ools Business Wor !lo" < %evelop'ent < *nviron'ent < (rgani6ational Manage'ent < Si'ple Maintenance L (rg plan basic $ata < Create Create root organi6ational unit Create *3ecutive Boar$

A$$itional organi6ational units Create )obs Create positions Assign 4ol$ers Assign tas s
#

Create Sales region 0 Pro$uction A$'inistrator 0 Sales Manager Sales Manager L eastern None

Create Sales (r$er


Copyright IBM Corporation 2003

IBM Global Services

Assi* ent Workflow %ask 4r*ani9ational 4"1ects


(rgani6ational unit; >I $epart'ent Position; 4ea$ o! >I $epat'ent Manager )ob ?ser J Mob !or secretary Position; Secretary ?ser 2 Position; >I a$'inistrator J &as &as

?ser 3 Mob !or >I e'ployee &as

Position; >I a$'inistrator 2 ?ser 2

Copyright IBM Corporation 2003

IBM Global Services

A*ent Assi*n ent and 5ole 5esolution


< Wor !lo" <

Copyright IBM Corporation 2003

IBM Global Services

A*ent
, , Agent is an e3ecutor o! a "or ite'Agent is responsible !or e3ecuting a tas in a "or !lo"Agent is $eter'ine$ by the syste' either through organi6ational chart or $irectly i! user is assigne$ as agent !or a particular tas I! the agents o! the in$ivi$ual "or !lo" steps are $eter'ine$ using the custo'er<speci!ic organi6ational chart0 your agent assign'ent in the "or !lo" re'ains !le3ible to change-

Copyright IBM Corporation 2003

IBM Global Services

%ypes of A*ents
Possi"le a*ents are a collection o! agents "ho 5uali!y to e3ecute a "or ite'

Processing Agents %ea$line Agents 7oti!ication Agents

Selected a*ents are those possible agents "ho are electe$ to e3ecute a tas at runti'e

Actual a*ent is the agent a'ong those selecte$ agents "ho actually processes the "or ite'
Copyright IBM Corporation 2003

IBM Global Services

5ole 5esolution
A role $e!ines rules by "hich selecte$ agents can be $eter'ine$ at runti'e through role resolution- .ole resolution restricts the nu'ber o! possible agents-

9ole 9esolution

+ist o! possible agents Ae3ecutorsB o! a tas AAll supervisors in a $ept-B


#

.ole E .ules ASupervisor o! ?ser PBAC(7B

Selecte$ AgentAsB AMr- BanningB


Copyright IBM Corporation 2003

IBM Global Services

Standard 5ules
A rule container is $e!ine$ !or each rule&he rule para'eters $eter'ine "hich in!or'ation is re5uire$ !or the rule resolution to be e3ecute$ at runti'eI! an error occurs $uring rule resolution0 setting the ter'ination in$icator !or the rule resolution $eter'ines ho" the "or !lo" "ill continue; >lag is selecte$ < the "or !lo" assu'es an *rror status an$ a noti!ication is sent to the "or !lo" a$'inistratorIn$icator is not activate$ < the "or !lo" !or"ar$s this "or ite' to A++ possible agents-

Copyright IBM Corporation 2003

IBM Global Services

5ule Basics
&ransaction ; P>ACGI7SACreateB Menu Path; &ools L Business Wor !lo" L %evelop'ent L %e!inition tools L .ules !or Agent Assign'ent L Create/Change/%isplay-

*ach rule gets a = $igit generate$ by the syste' pre!i3e$ "ith AC .ules can be teste$ using P>&C or by !unction 'o$ule Q.4GG*&GAC&(.SR

Copyright IBM Corporation 2003

IBM Global Services

5ule $efinition in a Acti#ity Step %ype


9arious options to create stan$ar$ rules ; 3- .esponsibility APure con!iguration no ABAP co$ingB %e!ine$ 9alue ranges are assigne$ to Agents %ata is !ille$ !ro' "or !lo" container at runti'e *vulution paths APure con!iguration no ABAP co$ingB (rgani6ational $ata APure con!iguration no ABAP co$ingB Mobs 0 positions

2- >unctions to be e3ecute$ L ABAP Co$e L >unction Mo$ule

Copyright IBM Corporation 2003

IBM Global Services

5ule $efinition with 5esponsi"ility& (xa ple


*'ployee 7a'es A<H
Mones S'ith

Mr- Miller Position ; A$'inistrator 4.

George Peter

Anna Michael

%avi$ .oss Willia'

Mr- An$re" Position ; A$'inistrator 4.

*'ployee 7a'es +<N

Copyright IBM Corporation 2003

IBM Global Services

5ule $efinition with 5esponsi"ility& (xa ple


.ules Container %e!inition
Container *le'ent *le'ent %ata &ype ?na'e 7a'e 7a'e

Areas o! .esponsibility
9alue >ro' AS +S Which 9alueT >ro' &o HS NS 7a'e *'ployees !ro' A<N *'ployees !ro' +<N Which Agent Mr- An$re" Mr- Miller

Copyright IBM Corporation 2003

IBM Global Services

(#aluation path as 5ule


&ransaction ; ((AW Menu Path;

*valuation path $escribes ho" to !in$ one or 'ore organi6ational ob)ects base$ (n an initial organi6ational units *3a'ple
(#aluation path W>G(.G?7 W>G(.G?S ?SGC4*> SAPG4(+% 'eanin* Get organi6ation unit !or a user i$/person i$ All users o! a organi6ation unit0)ob0 position Superiors o! a users 4ol$er o! a position

Copyright IBM Corporation 2003

IBM Global Services

(#aluation path as 5ule contd.


4ere are the basic steps; 23182%eter'ine the evaluation path that nee$s to be use$ Create a rule setting the type Q>unction to be e3ecute$R*nter !unction 'o$ule .4GG*&GS&.?C&?.* *nter the evaluation path $eter'ine$ in step J above >ollo"ing rule container nee$s to be create$

Na e (&PP* (BMI% (.GGAG*7&

$ata type ref 4B;(C-4%<P( (BM*CG.*A+( W>SPS&GAG*7&

$escription &ype o! organi6ational 'anage'ent ob)ect I% o! organi6ational 'anage'ent ob)ect (rgani6ational 'anage'ent ob)ect

(xa ple ?S SMI&4 ?SSMI&4

Copyright IBM Corporation 2003

IBM Global Services

5ole 5esolution with /unction 'odules


.ole resolution "ith !unction 'o$ule shoul$ be $one only !or co'ple3 criteria 4ere are the basic steps; 1- A !unction 'o$ule "ith the !ollo"ing inter!ace is create$
Para eter %ype &able &able *3ception Na e ACGC(7&AI7*. AC&(.G&AB 7(B(%PG>(?7% $ata %ype 5ef SWC(7& SW4AC&(. 'eanin* Inco'ing rule container (utgoing list o! agents in agent !or'at *3ception in$ication no agents !oun$

J23-

Create a rule setting the type Q>unction to be e3ecute$R*nter the create$ !unction 'o$ule na'e Create container ele'ents-

Copyright IBM Corporation 2003

IBM Global Services

(xecution of a 5ole 5esolution #ia 4r*ani9ational 4"1ects


>ia organi?ational ob4ects@ 9ole resolution utili?ing organi?ational data analyses the assignment of an organi?ational ob4ect 5plant& laboratory& %9A controller& planner group& shipping point& sales office6 to a position or organi?ational unit Plant Laborator! Sales O**ice

Copyright IBM Corporation 2003

IBM Global Services

%asks& Possi"le A*ents 0 $efault 5oles

Possible agents
Hser Position Aob OrgB Hnit Person

,e*ault role
Business Wor place

T%SE

&he "or place $isplays the "or ite's !or a agent

Copyright IBM Corporation 2003

IBM Global Services

)ow are Selected A*ents $eter ined With and Without a $efault 5ole7
Possible %gents

Triggering Event Task $e*inition )it' no $e*ault role Task $e*inition )it' $e*ault role

Copyright IBM Corporation 2003

IBM Global Services

)ow are Selected A*ents $eter ined With a W/ A*ent7


Triggering Event Task $e*inition )it' no $e*ault role Task $e*inition )it' $e*ault role Ste" $e*inition at )ork*lo) $e*nB level )it' an agent s"eci*ie$B T'is overri$es $e*ault role at task $e*nB level

%ll "ossible agents )'o Kuali*! to e.ecute task

Copyright IBM Corporation 2003

IBM Global Services

Workflow and A.(

Copyright IBM Corporation 2003

IBM Global Services

A.( error handlin*


+ser action 5/= action

(rror in in"ound function odule A.( tri**ers error e#ent


input *rror (ccurre$

Workite appears in user>s In"ox (xecute Workite $isplay I$oc for user processin* ,I$oc ethod ?Input/ore*round?/ix error and reprocess I$oc or /la* I$oc for deletion A.( tri**ers end e#ent
input >inishe$

Workite co pleted

Copyright IBM Corporation 2003

IBM Global Services

Workflow and A.(


(rror Notification Acti#e 'onitorin* I$4C Processin* Notification of successful postin*

Copyright IBM Corporation 2003

IBM Global Services

Workflow and (rror Notification


B u s in e s s + s e r A n a ly s is

* 3 c e p tio n . a is e $

% e te r ' in e . e c ip ie n ts

? s e r/G ro u p g e t s n o t i! ie $ v ia a " o r ite '

? s e r c h e c s in b o 3 a n $ e 3 e c u te s th e " o r ite '

. e s ta rt th e p ro c e s s

> i3 th e e r r o r

Pes

C a n e rro r b e ! i3 e $ T
7 o

*n$

P u rg e th e I% o c

Copyright IBM Corporation 2003

IBM Global Services

Active Monitoring
Active 'onitoring allo"s to speci!y threshol$ values !or the state o! the syste' >or e-g threshol$ can be on the nu'ber o! I%ocs in error or the ti'e li'it .eport Progra' .S*I%(CA can be e3ecute$ perio$ically Selection screen ta es as input the threshol$ values an$ persons to be noti!ie$ When $e!ine$ threshol$ is e3cee$e$ Single Step &as &S302000== is e3ecute$

Copyright IBM Corporation 2003

IBM Global Services

Settin* up In"ound Process #ia Workflow


&he stan$ar$ syste' can be con!igure$ to start a W> !or an inco'ing I%oc?se!ul "hen revie" is essential be!ore posting Custo'- SAP $oes not $eliver stan$ar$&he settings are; <<Create the custo' tas or W> <<Create a ne" process Co$e A W*12B an$ attach this custo' W>/&as <<In the Partner Pro!ile0 attach the ne" Process co$e

Copyright IBM Corporation 2003

IBM Global Services

Notification of Successful Postin*


&he A+*/*%I inter!ace can raise events on success!ul posting o! an I%(C&he settings are; <<I$enti!y the Appl-(b) create$ by the I$oc- &3n; W*8: <<I$enti!y the event that nee$s to be raise$<<Go to B%2:0 select Process co$e an$ populate (b)ect type an$ *vent<<I$enti!y/Create tas s/W> an$ enable event lin age-

Copyright IBM Corporation 2003

IBM Global Services

A.( error handlin*

7ecessary Steps;

Create ne" ob)ect type in Business (b)ect .epository !or I%(CU ob)ect is chil$ o! I%(CAPP+ Create ne" custo'er tas Create event<couplings lin ing

*vent Qinput*rror(ccure$R lin e$ to stan$ar$ tas *vent Qinput>inishe$R to !unction 'o$ule Create ne" ob)ect type as chil$ o! I%(CPACH*&

&o support 'ass processing;

Maintain process co$e to re!er the above ob)ects an$ events

Copyright IBM Corporation 2003

IBM Global Services

Business Workflow Custo i9ation


< Wor !lo" <

Copyright IBM Corporation 2003

IBM Global Services

Workflow Custo i9in* - SW+=

Copyright IBM Corporation 2003

You might also like