%&
:RUNIORZ 'HYHORSPHQW
SAP AG 1999
Release 4.6 C
November 2000
&RS\ULJKW
SAP AG 1999
7UDGHPDUNV:
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors.
n Microsoft, WINDOWS, NT, EXCEL, Word and SQL Server are registered trademarks of
Microsoft Corporation.
n 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.
n ORACLE is a registered trademark of ORACLE Corporation, California, USA.
n INFORMIX-OnLine for SAP and Informix Dynamic ServerTM are registered trademarks of
Informix Software Incorporated.
n UNIX, X/Open, OSF/1, and Motif are registered trademarks of The Open Group.
n HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World Wide
Web Consortium, Laboratory for Computer Science NE43-358, Massachusetts Institute of
Technology, 545 Technology Square, Cambridge, MA 02139.
n JAVA is a registered trademark of Sun Microsystems, Inc. , 901 San Antonio Road, Palo Alto, CA
94303 USA.
n JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.
n SAP, SAP Logo, mySAP.com, mySAP.com Marketplace, mySAP.com Workplace, mySAP.com
Business Scenarios, mySAP.com Application Hosting, WebFlow, R/2, R/3, RIVA, ABAP, SAP
Business Workflow, SAP EarlyWatch, SAP ArchiveLink, BAPI, SAPPHIRE, Management Cockpit,
SEM, 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.
n Design: SAP Communications Media
n
SAP Business
Workflow Build and Use
Workflow
3 days
SAP ArchiveLink
3 days
Data Archiving
2 days
ADK - Retrieval
programming
Archiving
2 days
Data Archiving Retention
Tool (DART)
2 days
SAP AG 1999
3 days
SAP Business
Workflow - Programming
SAP Business
Workflow - Introduction
2 days
/HYHO
Web connection
/HYHO
1
3 days
Application Link
Enabling (ALE)
Technology
T
!
US
4 days
EDI Interface
5 days
"!
2 days
Communication
Interfaces in ABAP
"!
5 days
Programming with
BAPIs in JAVA
5 days
R/3 Interface and BAPI
Programming in C++
SAP AG 1999
@@S
!
5 days
Programming with
BAPIs in Visual Basic
B D D 0 B A0
$ EF"4%C)@9
( 6 4 0 (&
875321)'$%#
Data Transfer
CR
3 days
Business Integration
Technology
1 day
SAP IDoc Interface Development
( B $ 4 P 6 I ( 4& 4
171QC858HG
2 days
SAP IDoc Interface
Technology
3UHUHTXLVLWHV %&
l (VVHQWLDO
%& ,QWURGXFWLRQ WR WKH $%$3 :RUNEHQFK
%& $%$3 'LFWLRQDU\
%& 6$3 %XVLQHVV :RUNIORZ ,QWURGXFWLRQ
%& 6$3 %XVLQHVV :RUNIORZ %XLOG DQG 8VH
*RRG RU YHU\ JRRG NQRZOHGJH RI $%$3
l 5HFRPPHQGHG
%DVLF NQRZOHGJH RI REMHFWRULHQWHG SURJUDPPLQJ
%DVLF NQRZOHGJH RI WUDQVDFWLRQ FRQFHSWV
SAP AG 1999
SAP AG 1999
&RXUVH 2YHUYLHZ
l &RXUVH *RDOV
l &RXUVH 2EMHFWLYHV
l &RXUVH &RQWHQW
SAP AG 1999
SAP AG
BC610
1-1
&RXUVH *RDOV
SAP AG 1999
SAP AG
BC610
1-2
&RXUVH 2EMHFWLYHV
RQHV
SAP AG 1999
SAP AG
BC610
1-3
&RXUVH 2EMHFWLYHV
$W WKH FRQFOXVLRQ RI WKLV FRXUVH \RX ZLOO EH
DEOH WR
l &UHDWH ZRUN LWHPV YLD $3,
SAP AG 1999
SAP AG
BC610
1-4
&RXUVH &RQWHQW
3UHIDFH
Unit 1
Unit 2
Unit 3
Unit 4
Unit 5
&RXUVH 2YHUYLHZ
,QWURGXFWLRQ
Unit 6
Unit 7
7DVNV
5ROHV
([HUFLVHV
6ROXWLRQV
$SSHQGL[
SAP AG 1999
SAP AG
BC610
1-5
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
1-6
SAP AG 1999
SAP AG
BC610
1-7
,QWURGXFWLRQ
&RQWHQWV
SAP AG 1999
SAP AG
BC610
2-1
SAP AG 1999
SAP AG
BC610
2-2
SAP AG 1999
SAP AG
BC610
2-3
l 2UJDQL]DWLRQ PRGHOLQJ
:KR GRHV ZKDW"
2UJDQL]DWLRQ PRGHO UROH GHILQLWLRQ
l $SSOLFDWLRQ HQFDSVXODWLRQ
:KLFK REMHFWV DUH UHTXLUHG"
%XVLQHVV 2EMHFW %XLOGHU %XVLQHVV 2EMHFW 5HSRVLWRU\
SAP AG 1999
Application encapsulation - "Work is delivered with all the necessary information ..."
SAP AG
BC610
2-4
l 3URFHVV FRQWURO
:KDW KDSSHQV ZKHQ"
:RUNIORZ PDQDJHU ZRUN LWHP PDQDJHU
l 3URFHVV HYDOXDWLRQ
:KR GLG ZKDW DQG ZKHQ"
5HSRUWLQJ DQG DQDO\VLV
SAP AG 1999
End user support - "Work is delivered to the people responsible at the correct time ..."
Process control - "Work is delivered in the correct sequence at the correct time ..."
SAP AG
BC610
2-5
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
Explanation A ! B = A uses B
Example:
Step definition uses attributes (container operation), events (wait steps), methods (secondary
methods).
Task uses workflow definition (in multistep tasks) or methods (in single-step tasks).
SAP AG
BC610
2-6
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
2-7
SAP AG 1999
As soon as the application is called via the workflow, only the application has control over which
actions can be performed.
SAP AG
BC610
2-8
SAP AG 1999
SAP AG
BC610
2-9
l 2EMHFW LPSOHPHQWDWLRQ
SAP AG 1999
SAP AG
BC610
3-1
2EMHFW 5HSRVLWRU\
DQG LPSOHPHQWDWLRQ
SAP AG 1999
SAP AG
BC610
3-2
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
3-3
2EMHFWV 0RWLYDWLRQ
.H\V
$WWULEXWHV
0HWKRGV
%XVLQHVV 2EMHFW
5HSRVLWRU\
7DEOH
7DEOH
7$
7$
$SSOLFDWLRQ
5HSRUW;;
&KDQJH GRFXPHQWV VWDWXV PDQDJHPHQW
(YHQWV
SAP AG 1999
The application data (tables) and the changes and queries (transactions and reports) that can be
performed on this data are encapsulated in the Business Object Builder.
This encapsulation is used
To simplify process modeling
As a standard interface for the workflow runtime system
SAP AG
BC610
3-4
8VLQJ 2EMHFWV
6WHS GHILQLWLRQ
&RQGLWLRQDO
EUDQFK
)RUN
/RRS
&RQWDLQHU RSHUDWLRQ
(YHQW
FUHDWRU
:DLW IRU
HYHQW
SAP AG 1999
Executing methods
Control structures
Querying attributes
Container operation
Querying attributes
Querying attributes
Receiving events
Roles
Querying attributes
Secondary methods
Calling methods
SAP AG
BC610
3-5
l ,QKHULWDQFH
)XQFWLRQDO H[WHQVLRQ LV D W\SH RI
l &RPSRVLWLRQ
.H\ H[WHQVLRQ LV SDUW RI
l $VVRFLDWLRQ
)RUHLJQ NH\ UHODWLRQVKLS LQ UHODWLRQ WR
SAP AG 1999
Key extensions are not allowed with inheritance. Interfaces can only be extended in an upwardcompatible manner (only possible to add new components or redefine existing ones).
Order item
Purchase requisition
SAP AG
BC610
3-6
2EMHFW W\SH
,QWHUIDFHV
.H\
ILHOGV
$WWULEXWHV
0HWKRGV
9LUWXDO DWWULEXWHV
)LHOG UHIHUHQFHV
2EMHFW UHIHUHQFHV
$%$3 &RGH
6\QFKURQRXV
7UDQVDFWLRQ
$V\QFKURQRXV
)XQFWLRQ PRGXOH
(YHQWV
5HSRUW
SAP AG 1999
Each object type is assigned to a development class and, therefore, indirectly to an application
component.
SAP AG
BC610
3-7
2EMHFWV 3URSHUWLHV
l 'DWD HQFDSVXODWLRQ
l ,QKHULWDQFH
l 3RO\PRUSKLVP
SAP AG 1999
Object definitions and implementations can only be manipulated via the Business Object Builder.
Data encapsulation - definition: Abstraction for the modeler, irrespective of the concrete SAP tables,
transactions, etc.
Data encapsulation - runtime: A standard interface for calling application functionality is available to
the workflow runtime system, irrespective of the actual implementation.
Inheritance: Object properties such as attributes, methods and events are passed on to subtypes.
Properties inherited can be redefined in the subtype.
Polymorphism: Depending on the object type, the object manager always selects the relevant
implementation for the property requested. This property is implemented technically using the "late
binding" principle.
Dynamic call interface for calls from the workflow runtime system.
SAP AG
BC610
3-8
,QWHUIDFHV
SAP AG 1999
The implementation of an interface using an object type means the assurance of a particular
behavior.
The definition of an interface can contain a specified default implementation that is used if the
including object type does not perform any implementation of its own.
An object type that implements an interface must implement all the attributes and methods belonging
to the interface (unless there is a default implementation).
At present, the Business Object Builder does not check whether all the components belonging to the
interface are actually implemented.
Interfaces replace multiple inheritance. They offer the same options as multiple inheritance, but are
easier to handle (for example, no conflicts when method names are the same).
SAP AG
BC610
3-9
,QWHUIDFHV ([DPSOH
'RFXPHQWV
6'
00
),
%.3)
(..2
9%$.
%&$"!
#
6 4 2 ) '
5310(
7 # % ' % 7
&A@8
%86
%86
%86
7 # % ' % 7
&98
%86
%86
&$"!5 @
% #
%86
SAP AG 1999
BKPF
BUS2019
BUS2020
BUS2041
BUS2069
BUS2029
EKKO
VBAK
BUS2032
Posting document
Customer document
Vendor document
Asset document
G/L account document
Price change
Purchasing document
Sales document
Sales order
IFSTATUS
IFARCH21
IFIDOCOUT
SAP AG
BC610
3-10
.H\ )LHOGV
l 6SHFLILFDWLRQ RI REMHFW NH\
SAP AG 1999
The English ABAP Dictionary names are proposed automatically as the names of the key fields.
SAP AG
BC610
3-11
$WWULEXWHV
SAP AG 1999
Database attributes are read from the associated application table and buffered in the object. Source
code is generated beforehand by the Business Object Builder for this purpose.
SAP AG
BC610
3-12
9LUWXDO $WWULEXWHV
SAP AG 1999
For performance reasons, virtual attributes are always preferable to reading background steps,
because the evaluation can take place directly in the workflow manager removing the need to create
a background step.
The Business Object Builder cannot generate a source code for virtual attributes. The algorithm
required for calculation of the attribute value must therefore always be explicitly programmed.
Typical examples:
language-dependent texts
time-dependent values
net/gross values
object references
SAP AG
BC610
3-13
0XOWLSOH/LQH $WWULEXWHV
SAP AG 1999
Example:
List of purchase requisitions for a material (BUS1001.PurchaseRequisition).
SAP AG
BC610
3-14
6\QFKURQRXV$V\QFKURQRXV 0HWKRGV
l 6\QFKURQRXV PHWKRG
B
B
l $V\QFKURQRXV PHWKRG
B
B
SAP AG 1999
Asynchronous methods are always necessary if the encapsulated application functionality uses
updating.
SAP AG
BC610
3-15
6\QFKURQRXV 0HWKRGV
0HWKRG
([SRUW
5HVXOW
([FHSWLRQV
,PSRUW
&DOOHU
7LPH
SAP AG 1999
The broken arrows represent the transfer of data and control flow.
SAP AG
BC610
3-16
$V\QFKURQRXV 0HWKRGV
'LDORJ
0HWKRG
8SGDWH
,PSRUW
&DOOHU
7LPH
SAP AG 1999
The distinction between synchronous and asynchronous applies to both dialog and background
methods.
SAP AG
BC610
3-17
Import parameters
B
Export parameters
Temporary error
B
Application error
B
System error
SAP AG 1999
Asynchronous methods support communication via import parameters. An event should be triggered
once they have been processed.
Export parameters should be avoided. Use a result instead. The result can be multiple-line.
Parameters should be avoided completely if the value can also be read as an object attribute.
If the result is based on a fixed value domain, automatic branching is possible via these values in the
WF definition.
If object attributes on the database are changed in the method, the Business Object Builder object
buffer must be invalidated with the macro SWC_REFRESH_OBJECT.
The type of exception subsequently determines error handling in the work item.
Exceptions are generally triggered via the macro EXIT_RETURN. There are two special macros,
EXIT_OBJECT_NOT_FOUND and EXIT_CANCELLED, the latter is used to return a user
termination in a synchronous method. User terminations reported in this way are then treated as
temporary errors.
SAP AG
BC610
3-18
6WHS
PHWKRG
6\V
HUURU
7HPS
HUURU
,Q SURFHVV
(UURU
2.
7HPS
HUURU
6\V
HUURU
6XEVHTXHQW
VWHS
6XEVHTXHQW
VWHS
6XEVHTXHQW
VWHS
0RGHOHG
1RW PRGHOHG
SAP AG 1999
as an application
or system error:
a subsequent step is
modeled for this exception
no subsequent step is
SAP AG
BC610
3-19
SAP AG
n
BC610
3-20
Background steps also offer the option of modeling a repeat counter for a temporary error.
If this repeat counter is modeled and an error occurs, the step is repeated automatically as often as
defined, before either assuming "error" or "completed" status (with subsequent execution of the
subsequent step modeled).
SAP AG 1999
1RW PRGHOHG
0RGHOHG
P H
5dq b
q p
h5H f i1H &"$`
b g f
5Yq b
P H
hSH f i1H h"f`
q p
b g
P
5Hdq b
h"H f &H h"`
q p
i b g f
P
"Hdq b
q p
&"H f &H hS$`
i b g f
AVWUT u
T T
b H t VT
hb h"YSPsp r
AVdTc"H H
T 3YeT "
T VTT
R 13`
b b&a !`
a
T5Hhp f heq w
q
V t x
T 3V YT UT T5
AWU5H H
T VT
R "P vI H "
SQ1SG
DF
EC
AVWe"H H
T T3YT eT S
VTT
R R &!`
b &a !`
b a
T VT
3YUT u
V P
bhb Hht"YTSsp r &b t"W"sp r
b H VT P
T Hq
5Yhp f Vht
q f 1Wq yw
V x
T AV YT cT T5
AYU"H H
T VT
R "P XI H "
Sv1SG
T5H&p V t x
q
f hsWq yw
T3YUT"H
AV T c5
R "P I H "
9Q1SG
6WHS
PHWKRG
%DFNJURXQG 0HWKRGV
1R EXIIHULQJ RI UHVXOWV
SAP AG 1999
The buffering of the virtual attributes must be programmed explicitly in the implementation of the
attribute.
The return of the value of a virtual attribute to the caller corresponds, in principle, to a result value of
a method.
SAP AG
BC610
3-21
(YHQWV
SAP AG 1999
User-defined parameters are only possible for events that are programmed explicitly. Parameters
should not be object attributes of the triggering object.
SAP AG
BC610
3-22
l 0RGHOHG
1RW DFFHVVLEOH DW UXQWLPH
l ,PSOHPHQWHG
2QO\ LQ WHVWV RU LQWHUQDO XVH SRVVLEO\ XQVWDEOH
l 5HOHDVHG
5HOHDVHG IRU XVH E\ WKH FXVWRPHU 2QO\ XSZDUG
FRPSDWLEOH HQKDQFHPHQWV SRVVLEOH
l 2EVROHWH
7KH IXQFWLRQDOLW\ KDV EHHQ UHSODFHG 7KH ROG
IXQFWLRQDOLW\ LV VWLOO VXSSRUWHG IRU WZR UHOHDVHV
SAP AG 1999
The "modeled" status is the only status in which execution is not possible. Customers should,
however, only use components with the "released" status.
The release information should be noted when a components status changes to "obsolete".
SAP AG
BC610
3-23
l 2EMHFW QDPH
'HVFULSWLYH QDPH IRU REMHFWV RI WKLV W\SH
l 'HIDXOW PHWKRG
'LVSOD\ IRU SUHVHQWLQJ DQ REMHFW LQVWDQFH
l 'HIDXOW DWWULEXWH
,GHQWLI\LQJ DWWULEXWH RI DQ REMHFW LQVWDQFH
SAP AG 1999
The object name is used as the element name in the container definition, for example.
The default method is used, for example, when you double-click objects in a list of object links.
SAP AG
BC610
3-24
SAP AG
BC610
3-25
Each object type has a program that implements the object type.
The macro instructions required for programming are incorporated via the include <object>.
The Business Object Builder always works with object references. These references are used to read
and manipulate the actual application data. An object reference of this kind must be created in the
calling program with the macro SWC_CREATE_OBJECT before a method is called or an attribute
determined.
Each object program contains the variable SELF which, in turn, contains a reference to the object
instance with which the program was called.
The declaration between BEGIN_DATA and END_DATA is generated entirely from the definition
data.
SAP AG 1999
csfEXpW&(Uhk~hU8W
i r q pm ee f io m e ii g
"eFs
y u
y x i x | i
1chdhh{(8ccUrr
y u f
5eEsc(
y i xs u
h8ev~s~k
eee s o s i xs s
{r(c8(Y(ihWv~r(}k
i r | | r i i s v s
F(8|Us8xU8eschesjc(8xWh{izk
y i xs v u f
hhWwsc8nk
t i i
hc(
8ew(U(crs(w
i xs v s s
r(jhje8|ls8e8|{8ee~
s i r | i xs v
c(fFvpWm!&fi(UFhnlehcUjcheU8
is r q p ee o
m k i i gf
e d
hUEe(c
U8h
@h
YY1UWUcd W
YY1UWUcd W
WYdY W
U
dYdeW(
YY1eeUed W
WU&W WW
Y dUW W
dUW W
UW W d hUe
Y eYd
&W
dU
e c
WdY W
eU Ud @
W d
Y hc e c Y W
WW&UWUeY e W e1Y
SAP AG
BC610
3-26
Source code is generated in the implementation program to read the date from the application table.
The macro EXIT_OBJECT_NOT_FOUND returns the exception "Object not found". This exception
corresponds to the T100 message OL826.
SAP AG 1999
eSWc
|su
e&(c
u
e i x g i
&8(cUs8x
e s
EcUr
e r
&
e i x i x g
&8{j8((U
e e e s r u
&u(0hEces
e s r r s
&heYEcUr
e8h|cUU(icceWesc8x
r r
E(8|dY{(8{o
i i r i | s
u vr i x | u f r
8W88jWsFQcjr
hEjhhc@e
e i r x i x g
EF88hc@e
i i r i | i x g u
e s s r f r i x g i g r |s
&cWrYrcjhcUc(hWeccvWu
e s vs vg
SY8UW
e&(c
u
e u g g g
hdU
e s r u
hsEhes
hshcUrc8hgWeccX|W(v
e f r i x i g r s us
r s v iq rr
s hv e s ss ei q s r r p p
r(heschUscj(
s fii p pq
s f i i hl c c h Ui i j hp U8 h (p Yq j {
Uhejche(l88Yj{
ecUcWcjhesic(
s r r s r i
e i s vs v g i g
18xW8eh(Ye@(f
Y dY WWY
Ue cY @
YU1W YW
8
W dUY e
dUY e
YUc (
UW Y hUW d
deUWeeWUe WYeW e
c UeW
e d U e
d eWc Uh W
Y Wd
We (
Y Uc
Uee YU1UUU deWY1UWU
deWY1UWU
dWdY W
dY
8
WY1UWU
Y WWd
&W
dde
Y c
WW e
WU Ud @
W
YW&cYc& Y (
WY1UWU 8
SAP AG
BC610
3-27
The macro EXIT_OBJECT_NOT_FOUND returns the exception "Object not found". This exception
corresponds to the T100 message OL826.
An object reference is generated automatically as an attribute value. This procedure only works
correctly if the referenced object type has precisely one key field. Otherwise, the attribute must be
implemented itself.
SAP AG 1999
e | u
SWsc
&(c
e u
e i x i
&8g(cUs8x
eEcUr
s
e r
&
e i x i x
&8{j8(g(U
e u e e s r u
&(0hEces
e s r s
&herYEcUr
e(8|UUcrceWesc8x
ri
i i | r i | s
E(8dY{(8{o
u v i x su fr
8Wr88j|WFQcjr
e r x i x g
hiEjhhc@e
r i | i x g u
iiEF88hc@e
&cWrYrcjhcUcr(hgWeiccv|Wu
e s
s r f i x g r s
e s vs vg
SY8UW
&(c
e u
e u g g g
hdU
e s r u
hsEhes
ehhcUfcr8hgWeiccX|W(v
s r
i x g r s u s
r(heschUscjr(p
s vs iq r
Uheijche(l88Yj{
s fii
p pq
e s r s r i i
cUrcWcjhesc(
e i s vs g i g
18xW8ehv(Ye@(f
W& W
@8
Y Y YUY
UW cW
YU&e WY
888
Y YUY W
8
YUY W
YUc d (
UW W hUW d
dWcWeeWUe WYeW W
c UeW
e d U e
d eWc Uh Y
e Wd
We (
W Uc
We1U Yc
We1U Yc
YWdY W
dY
8
YcU Yc
Y WWd
&W
dde
e c
YdW e
WU Ud @
Y
Y cU W 8
ecUc c Y (
SAP AG
BC610
3-28
The data declaration is generated from the definition data and is used as a runtime buffer.
Both the Business Object Builder runtime buffer "object-salesgroup" and the associated container
element "SalesGroup" must be completed for data transfer.
SAP AG 1999
Uc chd W
e s vs v
SY8UgW
e vsf i v s r
"ccr(crc(U$Scic
c((8e@Y r
s i | g r g
s i s us
c8j(wcU1c@ejcs
"vW8h8x!5c8Yyccr(crc(cU
e sf x i q vsf i
c@egWc(@Y r
is g
s u s i s
hcUcF
eh(h|cccricUW(Ujj8{(o
r x s
hxeFQcUr
i | su f r
e s i f fi
hcc(socvcfcr(icXY8U(f
s r s vs vg
e ii g
hU8W
ehW@gd r8YXvcUr
v sfri
"eFsc
y u
ee
e
y u f
5eEsc(
ehcUjicheU8
i gf
8
W e YeY
ee UY
WeW Wd
Y YeW Y d
YeW Y d
We
eW e hee
WYUUYUYce YdUW dW
cWe@
e W c c
d YUc Uh Y 8
W Wd
YU (
Y cU
cd U1 cc h Y
cc h Y
W eeU
YYYYeW
Uc @e Y
c Y WWd
hW
WU
W
YYd Y
ee UW
Y 8
Uc @e Y Y (
cc YY e Y 8
SAP AG
BC610
3-29
The data declaration is generated from the definition data and is used as a runtime buffer.
Both the Business Object Builder runtime buffer "object-salesgroup" and the associated container
element "SalesGroup" must be completed for data transfer.
The actual implementation of the attribute also contains a query as to whether the runtime buffer is
completed.
SAP AG 1999
e s vs v
SY8UgW
ehecU(cUUci(shUicY r
r | r | s g r g
(8e(sc s U p
| si
su frr
"e(
e v
e r | | vv
hecUUjcXe8Ui
e vi x p | g is
5Uhgehh@U( ecFe@Ygd r
ehchUicceihFEsUr(8dehe8x
s r v gv x v gvi
"Uicceh~QU
e gvi x i v
su is
s U
e r i x gv
h(h|ccccrUW(Ujj8ecUi(x
e88UUr(crceWc@esjc8{o
| i x s
vi x i vi x |su
eigcU8whUcU(ve8jeFscr
ii
U
e1cjjU j8UQei({cveccU8{
s i o o rs v x i gvi x ii
e gvi x u
"Ucehws
y v vi x s
s(Ur(8W8{cjUr(8v
&hW8{cchx
y x vi x
y vi x f t ii
"egcU8wuj8&
e g r v | ii
chUY hYXUcs
"U8lr(Wic
e vi x
ic(8
i si m
e
hscic(siocE@evY8U(f
f f r | s vs vg
e ii g
hU8W
e rs g r v r |
j8U{e@d 8YjUc
"eFsc
y u
ee
e
y u f
5eEsc(
ehcUjicheU8
i gf
W &Y Y
@h
Y W WeW
ee UY
ee1Y ed
W WWe e
WWe e
eeU (
UW Y d hWe
YeeeeWeUU YYeW YW
c UUY
U Y U U
Y We ch Y 8
W Yd
We 8
d U
hW WY&UeeUhY e
&W
dWYd Y
W
h
&W
c W Ye
1Y
Yc
W d c
eY W
Ue UY
Y 8
&W h Y 8
hW W 8
SAP AG
BC610
3-30
The macro SWC_REFRESH_OBJECT must also be called after the application functionality for
synchronous methods that can change object attributes, in order to delete the object buffer.
SAP AG 1999
Yh
&Y
WcYeW YYW
ceW
UcU&5U e (
deYe
c dec Y
UcU&c deeU U YYeW YW
e1c(e(8e
o |g
e s rsu
rvvW(Uh@ c8ics
r i p ir s i
eh(h|ccciceW(Ujcu"c8p cjcheic8v~r
r r s | si
&c(jciUvUhW(oW(8|(gWch
e s i f f o i vr f
dd hY Ue (
Y Ue (
d YW1Y U1
W
dYYWW(W
Y Ue (
Y dW Weyd dd
WW e c W Ye
UW UW
1Y
ce d
d Ue (ce d
Ue "UU
Y dehe U
e
Y
YYd Y
YYYYeW
ee Udd
ce
ee d
Y Ue (ce d
Y ce "UW
SAP AG
BC610
3-31
It is not necessary to call the macro SWC_REFRESH_OBJECT in this case, because the object
context is always lost in an asynchronous method
The single-step task that encapsulates this method requires at least one terminating event.
SAP AG 1999
eUhgW
o |
e u
&(
e sr rsu v r i p s i
1jech@ icr(ij
e r r
8h|cUciceW(esu
s | si
Sc8p cj8Ui8v~r
r r s x u
cjscve8eEvW(sc(eh{hU
o | x
&8vWsUchhw
e i r d ru i x u
e8hcUer(icrceWesjU8{o
| x s
i x |su f r
hje{Qccr
e s ffi s o |g f
hcic(socE(cr(shehxWj(ehec8
WU eW WccdYd
Yc ( Y dYd
Y dehe c1
W
YYYWW(e
YYYWU U WU W
d
he
ecWWe WYW
cWe
eU11U Y
c WWWY c Wh
eU @
ccU1& UUe e YYee e
Y WY1Y e
e
YYYWY(W
edWYc (e YU Y
SAP AG
BC610
Up to four parameters, which correspond to the four parameters of the T100 message, can be
transferred with the EXIT_RETURN macro.
3-32
1000
7000
1000
BUS1001
30D
UhW
e o |g
ee
e
e
&u(
e&8vWrji8WhYsic8|Uec@eEWcU@
i
vr i vr s i V s s g
s8F(eiQFcvW(s(cj8se8ecE
r s o
s isi | s s sis v|
e s r
hsEhercYsu
e V
W c@eu
gfs
r v
U(
U
0
i g
h
v
hWrg
is i |
c(8deYes
U(8|
s i
8vc
fs
p g u i
1(pc(UheTc(Uj
ee
e
e si f fio
&(sc(Ur UhY(j(ehec8
xrr | f o |gf
Message
Application area
MA
Message
279
& blocked by another user
Error type
Temporary error
Application error
System error
Exception
Object type
Release
Exception 1000
No.
App.
Syst.
AppArea
Message
Message text
MA
M3
BUS1001
BUS1001
279
195
Exceptions
hS (P A7
R Q I
'1 Gec e1
" H2
"
F A7 E 4 D ( 2C1 % B W ( " # cU W ' A S c c
@9 486 6 5( 3" )0U &'%$ " c! U "ee W
SAP AG
BC610
3-33
The parameter transfer source code is generated entirely from the definition data.
Single-line input parameters are generally read via the macro SWC_GET_ELEMENT, and output
parameters written via the macro SWC_SET_ELEMENT.
The macros SWC_GET_TABLE and SWC_SET_TABLE are used for multiple-line parameters.
SAP AG 1999
v
~
sy h
` yyt
Bd v0a ` X
a%Bt 0sf
i`} } bg`
B c` aBB` v` 0sy
i | `tx b |`
` Bg aBB` v` 0sy
i y `tx b |`
dB cr at cq
bgx y
`tx b | b ` y yg
d0B` d` 0` %a %g Bhq
br r BBBB
b yg xg
h yag 0xBg
x
d
vw
BBd aBBvBsBa` Bhf
` yx` wutrqp ig
` { i i
B icx B` d yc du%
y bvaBv
r
r
yy vB' w w
bbvrB'
p ` bb y` bg
a yc` b0hr BsB` 0wvg B
xh cr B c b0avq
y tp`
`%dvz
wg
yp Bd
`
`pg i`
0a0` hy
`0v v0a ` X
yyt
bB` y0vg bB
` w g
v
v
` x yt px b
ddrsBh cr 0ag0ag
BBd yaB`BuvBsBa` Bhf
` x w trqp ig
B` y0dg B
b ` w bg
e ` dY BaYX
c b`
` yyt
Bd v0a ` X
View
System Help
Program
e
e
e
e i is i is
&(crr(sic
e18Y(8UUr(iccq@p jc(8|Uh~Ur
v | r u p s isi v
e r is i isq
&(ic81r(
c((8e@Y r
s i | g f g
e18Y(8UUr(iccq@p jc(8|Uh~Ur
v | r u p s isi v
e v | r r vq | mri
18W88UU(icnh8W(hcc8Wc
c((8e@Y r
s i | g f g
e V r is
&c(%cic8
yi(cehYs8W88UU(cn&
s i i x v | r ir t ii
&(sci(Usc((eheU8
e si f f o is o |g f
x
dw
x
dw
a` 'v cr 0ga` b
i b x y
Goto
xg i
BB aB d' w
Other view
Object Edit
Exceptions
Utilities
nf n v os q p nmjlkj i h fe d
s%Yshu tWs r d hs ddc sohsvdvYgv B
SAP AG
n
BC610
3-34
The result parameter must be set explicitly under the name "result" using the macro
SWC_SET_ELEMENT. The constant "result" is predefined and need not be defined explicitly.
SAP AG 1999
e o g
1U8|(W
e1cr(
i
(@
e i g
ho
e
e&hY8vd8WshYjWU(U@
i vr i r i vr i vr VV s s g
o
e V
e&icrY~Ujcic888Uc@(crY r
gs v rs s | g g
o
e
hhercYcr(
e s r
i
e
h
s
hei
V u g g|s
%jc@dUWu
r v
8U(
Ugd{
ir s v
c(ichv
r gs
fs v|
8W
s
8|ceUY(Uj
s |s
h|cWu
fs
8vc
18ec@h(UU6hUj
p g p gU u i
e&ichU8eu( scjUrYv&ic(
r s v r i |s r i gs t i
e s i ffi xs vv o |gf
hcc(socs8ehUisUhW8
Y
( 8
@@
U Y c U
e Y e U
U W c W
ee UY
WeW Wd
W YeW Y
Yee W
Wec (
eU U UU
WW Uc
WW Uc
W WeW@
c W WWd
1W
e c
WdY W
eU Ud @
UU
e W U e @ h c e @
We ce&UU
WYdW e
d
(@8
eY Uc
SAP AG
BC610
3-35
The include <cntn01> must always be incorporated in the calling program. This include is also
incorporated in the implementation program via the include <object>.
Before attribute access, an object reference must be created by calling the macro
SWC_CREATE_OBJECT. Error handling measures must be incorporated if the object reference
cannot be created.
Attribute access for single-line attributes uses the macro SWC_GET_PROPERTY, and for multipleline attributes the macro SWC_GET_TABLE_PROPERTY - irrespective of whether a virtual or a
database attribute is read.
Attributes cannot be set via macros. Object values can only be changed via methods.
SAP AG 1999
U h W
Y dY YeY
UW cY @
YU1W YY
Y dUY W d
dUY W d
YUc (
ee e hUW
YYceWeWUe YWWe W
c dUWe
e d e U
Wec Uh Y (
W WY
eW (
Y UU
Y eec
W
YWdWW(e
U @ed W
Y eYd
hW
YU
e
YYY W
ee Udd
Y (
e W 8
Uc @Wd W Y (
SAP AG
BC610
Before attribute access, an object reference must be created by calling the macro
SWC_CREATE_OBJECT. Error handling measures must be incorporated if the object reference
cannot be created.
The import parameters of the method must also be completed before the method call.
3-36
The include <cntn01> must always be incorporated in the calling program. This include is also
incorporated in the implementation program via the include <object>.
e u
&
f i sss
(o{s 8c8{
s
eEhcUcYs
s r r u
e gs r i
Sed@g(cr h
s grir g
csdccUgWcis@d r
s u s i s
hc1ejF
e o | s i g
hscic8gWe(8~c(@Y r
e i x
&s (ehh{
(U8g
i x
yee (ciujcsi hhx{ c(c@cve
e
i
ss g |
y g
e@d r8Ws@g1c(
v ss r ir t ii
eh%eqhe(Ec(c
dV
Parameter
CompCurrency
NetvalueInCompCurr
VBAK
VBAK
40A
40A
Overview
Dictionary
Dictionary
Reference table
Reference field
Search help
VBAK
WAERK
Mandatory
Parameter properties
Description
Comparison currency
Parameter
Object type
Release
CompCurrency
VBAK
40A
Texts
Name
Comparison currency
Parameter CompCurrent
I )
# ! Q & "
" U %0& '& B
hS (P A7
R Q I
'1 Gec e1
" "H2
@6A
hAA ( h6 7 '" Be '"$ & eS & U "ee W
@' D 1 )0U ( &
U5Q ' W ' A 'ESc c
0DFURV 6XPPDU\
SAP AG 1999
The macro number must always be included if you are working in a program with objects. The
macro is included automatically in the Business Object Builders implementation programs via
<object>.
Only macros from <cntn01> may be used to manipulate objects and containers.
SAP AG
BC610
3-37
l 2EMHFW UHIHUHQFH
B
Declaration
DATA: <obj_ref> TYPE SWC_OBJECT
B
Creation
SWC_CREATE_OBJECT <obj_ref> <obj_type> <obj_key>
SAP AG 1999
SAP AG
BC610
3-38
l $WWULEXWH DFFHVV
B
l 0HWKRG FDOO
SAP AG 1999
An object reference must be created before an object macro is called (for example, for attribute
access or method call).
These macros are not usually used in object implementation, but are required in the program that the
object uses.
SAP AG
BC610
3-39
l 7ULJJHULQJ H[FHSWLRQV
B
EXIT_OBJECT_NOT_FOUND
B
EXIT_CANCELLED
SAP AG 1999
SAP AG
BC610
3-40
SWC_REFRESH_OBJECT <obj_ref>
SAP AG 1999
When a work item is executed, the objects in the associated container are automatically refreshed.
SAP AG
BC610
3-41
&RQWDLQHU 0DFURV
SWC_CONTAINER <cont>
SWC_CREATE_CONTAINER <cont>
SAP AG 1999
All types of container are manipulated via these macros (for example, task, role, event).
SAP AG
BC610
3-42
'HOHJDWLRQ
3URFHVV GHILQLWLRQ
%2%
A6%3C
'''
'8
%%H
%E
' A8 C
HH
''
'8
D
%8D
%%%8
''H
''8
E6 D
%8D
%%%8
`
T p
55D5hq
A6%3C
' A8 C
HH
%55
%' 6
''A
8E
H1Ssq x "&"p r
t p T H
6
' A8 C
HH
A6%3C
6%
' A8 C
HH
%55
%% 6H
%H
'8
AV x 5H H
p q
6
' A8 C
HH
SAP AG 1999
Problem:
How can customers use their own object extensions with the tasks, events, etc. supplied by SAP
Without having to change the application program where events are triggered,
Without having to redefine existing tasks.
Solution:
Define subtype and delegation.
Delegation "covers" the original supertype.
Continue to use the supertype.
In the Business Object Builder itself, you can only see from the basic data for a supertype whether a
delegation has been defined.
SAP AG
BC610
3-43
DQG LPSOHPHQWDWLRQ
SAP AG 1999
SAP AG
BC610
3-44
([HUFLVHV
8QLW 2EMHFW 'HILQLWLRQ DQG ,PSOHPHQWDWLRQ
1-1
1-1-3 Change the status of your object type to released. You can ignore the
message The method ExistenceCheck is not redefined .
Note: If you have not completed this step, you cannot use your
object type in a task or role.
SAP AG
BC610
3-45
When implementing a workflow you will notice that not all customerspecific business processes can be modeled using a business object
supplied by SAP. In these cases, you must create a new object type.
2-1
Supertype
Object type
ZPLANT##
Object name
Plant_##
Name
Plant ##
Short description
Program
ZPLANT##
Application
Note: The names of the object type and the program must be in the
customer namespace.
Note: The object type, object name and program name must not
contain any blank characters.
2-1-2 You must define a key field for your new object type. In a second session,
look at the key of table T001W, the lines of which each represent a plant.
Define the key of your business object based on the key of this underlying
application table.
2-1-3 Create a new attribute 1DPH based on the field NAME1 of table T001W.
Generate the implementation for your definition with the Business Object
Builder.
SAP AG
BC610
3-46
2-1-4 Redefine the method 'LVSOD\. Do not define the method with reference to a
transaction or a function module. First, look at the implementation proposal
generated by the Business Object Builder. Then complete the
implementation of this method by copying the missing lines from the
method Display of the object type BUS0008 supplied by SAP.
Note: You must declare the view V_T001W in the implementation
program of your object type.
SAP AG
BC610
3-47
When implementing a workflow you will notice that the object types
supplied by SAP do not meet your requirements fully. In these cases, you
must extend an existing object type by creating a customer-specific
subtype for it.
3-1
Supertype
Z##MARA
Object type
ZMARA##A
Object name
MARA_##_Version_A
Name
MARA ## Version A
Short description
Program
ZMARA##A
Application
Note: The names of the object type and the program must be in the
customer namespace.
Note: The object type, object name and program name must not
contain any blank characters.
SAP AG
BC610
3-48
3-2
SAP AG
BC610
3-49
3-2-9 Create a (virtual object-value) attribute 3ODQW for one of the plants
connected with the material.
Use the field MARC-WERKS for the implementation of the attribute to
determine the plants in which the particular material is defined. Return the
first plant found in this manner in the form of an object reference from your
object type ZPLANT## as a value of the attribute.
3-3
Optional extensions
3-3-1 Create a (virtual database field) attribute ,QGXVWU\1DPH for the long text
for the value of the existing attribute Industry. This industry name can be
read from the field MBBEZ of table T137T on a language-specific basis.
3-3-2 Create a (virtual, multiline and object-value) attribute 40HVVDJHV that lists
all quality notifications in which the current material is used.
Note: Use the field MATNR in table QMEL to find the quality
notifications. The object type BUS2078 supplied by SAP
implements the quality notifications.
SAP AG
BC610
3-50
6ROXWLRQV
8QLW 2EMHFW 'HILQLWLRQ DQG ,PSOHPHQWDWLRQ
1-1
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
BEGIN OF KEY,
MATERIAL LIKE MARA-MATNR,
END OF KEY,
PLANT TYPE SWC_OBJECT.
END_DATA OBJECT. " Do not change.. DATA is generated
BEGIN_METHOD CHANGEDOCDISPLAY CHANGING CONTAINER.
SET PARAMETER ID MAT FIELD OBJECT-KEY-MATERIAL.
CALL TRANSACTION MM04 AND SKIP FIRST SCREEN.
END_METHOD.
SAP AG
BC610
3-51
SAP AG
BC610
3-52
When implementing a workflow you will notice that not all customerspecific business processes can be modeled using a business object
supplied by SAP. In these cases, you must create a new object type.
2-1
,PSOHPHQWDWLRQ RI REMHFW W\SH =3/$17
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
BEGIN OF KEY,
PLANT LIKE T001W-WERKS,
END OF KEY,
_T001W LIKE T001W.
END_DATA OBJECT. " Do not change.. DATA is generated
SAP AG
BC610
3-53
GET_TABLE_PROPERTY T001W.
DATA SUBRC LIKE SY-SUBRC.
* Fill TABLES T001W to enable Object Manager Access to Table Properties
PERFORM SELECT_TABLE_T001W USING SUBRC.
IF SUBRC NE 0.
EXIT_OBJECT_NOT_FOUND.
ENDIF.
END_PROPERTY.
* Use Form also for other Properties to fill TABLES T001W
FORM SELECT_TABLE_T001W USING SUBRC LIKE SY-SUBRC.
IF OBJECT-_T001W-MANDT IS INITIAL AND
OBJECT-_T001W-WERKS IS INITIAL.
" read data from database table, if BOR buffer is empty
SELECT SINGLE * FROM T001W CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND WERKS = OBJECT-KEY-PLANT.
SUBRC = SY-SUBRC.
IF SUBRC NE 0. EXIT. ENDIF.
OBJECT-_T001W = T001W.
ELSE. " read data from BOR buffer
SUBRC = 0.
T001W = OBJECT-_T001W.
ENDIF.
ENDFORM.
BEGIN_METHOD DISPLAY CHANGING CONTAINER.
" coding copied from BUS0008
CLEAR V_T001W.
V_T001W-MANDT = SY-MANDT.
V_T001W-WERKS = OBJECT-KEY-PLANT.
CALL FUNCTION VIEW_MAINTENANCE_SINGLE_ENTRY
EXPORTING
ACTION
= SHOW
VIEW_NAME
= V_T001W
CHANGING
ENTRY
= V_T001W.
END_METHOD.
SAP AG
BC610
3-54
When implementing a workflow you will often notice that the object
types supplied by SAP do not meet your requirements fully. In these
cases, you must extend an existing object type by creating a customerspecific subtype for it.
3-1
3-2
3-3
Optional extensions
Solution:
Object type ZRGMARA
Path (via SAP Easy Access):
Tools > SAP Business Workflow > Development > Definition tools > Business
Object Builder
SAP AG
BC610
3-55
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
BEGIN OF KEY,
MATERIAL LIKE MARA-MATNR,
END OF KEY,
QMESSAGES TYPE SWC_OBJECT OCCURS 0,
INDUSTRYNAME LIKE T137T-MBBEZ.
END_DATA OBJECT. " Do not change.. DATA is generated
TABLES: T137T.
TABLES: QMEL.
TABLES: MARA.
TABLES: T006.
GET_PROPERTY INDUSTRYNAME CHANGING CONTAINER.
DATA: GETINDUSTRYNAME LIKE T137T-MBBEZ.
DATA: INDUSTRY_KEY LIKE MARA-MBRSH.
IF OBJECT-INDUSTRYNAME EQ SPACE. " check buffer contents
SWC_GET_PROPERTY SELF Industry INDUSTRY_KEY.
SELECT SINGLE * FROM T137T
WHERE SPRAS = SY-LANGU AND
MBRSH = INDUSTRY_KEY.
IF SY-SUBRC EQ 0.
OBJECT-INDUSTRYNAME = T137T-MBBEZ.
ELSE.
OBJECT-INDUSTRYNAME = SPACE.
ENDIF.
ENDIF.
SWC_SET_ELEMENT CONTAINER IndustryName OBJECT-INDUSTRYNAME.
END_PROPERTY.
SAP AG
BC610
3-56
BC610
3-57
SAP AG
BC610
3-58
7DVNV
&RQWHQWV
l 6LQJOHVWHS WDVNV
l 0XOWLVWHS WDVNV
SAP AG 1999
SAP AG
BC610
4-1
D PXOWLVWHS WDVN
WDVN
SAP AG 1999
SAP AG
BC610
4-2
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
4-3
6LQJOH6WHS 7DVNV
6LQJOHVWHS WDVN
%2%
2UJDQL]DWLRQ
PRGHO
2EMHFW W\SH
0HWKRG
(YHQW
I 8$S TASR
' IU G Q
PIH)&9$F6C
G 'E D A
CB
4
124)#A24)@93875624)#33210)(
' 1 '1 '
%
&$"#!
$WWULEXWHV
2UJ XQLW
-RE
3RVLWLRQ
(PSOR\HH
8VHU
SAP AG 1999
The default role is evaluated if the task is used either outside a workflow or in a step definition
without agent assignment.
SAP AG
BC610
4-4
6\QFKURQRXV$V\QFKURQRXV 7DVNV
SAP AG 1999
Secondary methods are always called asynchronously (meaning in a new external session).
Reports back to the workflow are only made from the task method. Secondary methods are only
for display.
n
An explicit confirmation can be modeled in the step definition for both synchronous and
asynchronous tasks.
Synchronous tasks can also have terminating events. The task is then terminated either when it has
been successfully executed or when the terminating event has been received. In this case, the
terminating event cannot be triggered within the associated object method.
SAP AG
BC610
4-5
6\QFKURQRXV 7DVNV
0HWKRG
([SRUW
5HVXOW
([FHSWLRQV
,PSRUW
:,0
7LPH
SAP AG 1999
The method is started within the task. The WIM caters for the input parameters of the method.
Once execution of the method is terminated, the WIM receives the export parameters or exceptions
of the method.
SAP AG
BC610
4-6
$V\QFKURQRXV 7DVNV
'LDORJ
0HWKRG
8SGDWH
7HUPLQDWLRQ
RI WKH
HYHQW
,PSRUW
:,0
(0
SAP AG 1999
The task is started via the work item manager (WIM). When the associated work item is created, the
WIM writes the linkages for the terminating events.
The method is started within the task. The WIM caters for the input parameters of the method.
The WIM waits for the end of the synchronous part of the method execution (this part takes place
within a dialog process) and can then execute actions that are independent of the terminating event.
Once the asynchronous part of the method execution is terminated (usually within an updating
process), the WIM receives a terminating event of the task, deletes all linkages and then continues.
SAP AG
BC610
4-7
:RUNIORZ GHILQLWLRQ
6WHS
Activity (task reference)
Condition
Multiple condition
Event creator
Wait for event
Process control
Container operation
User decision
Loop (until)
Loop (while)
Fork
Document from template
Send mail
Web activity
Reference to
ZRUNIORZ GHILQLWLRQ
Definition of WULJJHULQJ
HYHQWV
,QWHUIDFH definition
(import and export
parameters as
elements of the
workflow container)
,QLWLDO YDOXH
DVVLJQPHQW
$JHQW DVVLJQPHQW
for starting from the
workflow development
environment
SAP AG 1999
Each step is a determining component of its own block. Operations carried out on individual steps
always affect the entire block in which the step is located.
SAP AG
BC610
4-8
Container operation
Condition
Wait step
Activity
Deadline monitoring
SAP AG 1999
The workflow container is basically used to determine the import and export parameters of the entire
workflow and to exchange data between the individual steps.
(1) Data from the triggering event is transferred to the workflow container as input parameters.
(2) In a container operation as well, data is both read from (right-hand side of the allocation) and
written to (left-hand side of the allocation) the workflow container.
(3) Data is read from the workflow container in a branch control condition.
(4) In a wait step, data is both read from (for example, to set up the instance linkage for the event to
be received) and written to (for example, data received with the event) the workflow container.
(5) In an activity as well, data is both read from (for example, the input parameters of the task to be
executed) and written to (for example, the output parameters of this task) the workflow container.
In addition, data is read from the workflow container to resolve the role used in the step for agent
determination.
(6) Data is read from the workflow container for deadline monitoring (for example, the latest end).
SAP AG
BC610
4-9
:RUN ,WHP
&RQWDLQHU
0HWKRGV
&RQWDLQHU
HYHQW
&RQWDLQHU
I($ d
6
D A
&&4 WX
` Y
%$
H" a
`
34 YSX
($ d
I
DA
6
`
&4 Y b
%$
H"
`
34 Y a b
C3&
4B
1 '1 '
240)31 0)W
4B
C3&
1c4H)P4@86
A ) '
:RUNIORZ
&RQWDLQHU
SAP AG 1999
(1) (11) Event creator fills event container using container macros; no binding.
(2) Binding between triggering event and workflow containers. This binding is essential.
(3) (8) Binding between workflow container and role container for setting the role input parameters.
This binding is essential. (This only applies if the role was entered in the step definition. In the case
of a default role in the task definition, the parameters are supplied from the work item container.)
(4) (7) (9) (13) Binding between workflow container and task container (work item container) for
setting the input and reading the output parameters of the task. For this binding, it is irrelevant
whether the underlying task is synchronous or asynchronous. The workflow builder generates a
proposal for this binding in the step definition.
(5) (6) (10) Binding between task and method containers. For synchronous tasks, there is a binding
for both the import and export parameters (5) and (6); for asynchronous tasks, only for import
parameters (10). If this binding is not defined in the respective task, the task container is copied to
the method container at runtime.
(12) Binding between event and task containers. This binding is necessary if the event contains data
that was not previously contained in the task container (for example, with events from create
methods).
SAP AG
BC610
4-10
SAP AG 1999
Required with binding for BAPI methods, for example, since BAPIs generally work with structures
while container definitions cannot contain any structures (e.g. binding between workflow and singlestep task).
Function module entries in the binding editor via the "alternative binding" context menu.
SAP AG
BC610
4-11
rsr i g
3b eqpPWhb f
ed v ig
q qPdWhb f
#4HU d
'
2``P`
%
' 6% b ) g
FShb873sb
e tr r
tr r
& i 73sb
2`c`` 73sb
tr r
2`c`` 73sb
tr r
v a b tr r
wuW8e73sb
eqPpWhb
ig
eqPpWhb
ig
eqPpWhb
ig
eqPpWhb
ig
e ig
qPpWhb
f3U 3A
1A 14
f
Y )
f CH' X
f
y!A e CP') x
!A e
f
$%$3 'LFWLRQDU\
6WUXFWXUH
%$3,.1$
Fb W
v eb
& i
Sd X
vv
Fahb e X dcx
v
i
v ab
yuWe
:6
:RUNIORZ &RQWDLQHU
6WHS
76
.1$&UHDWH)URP'DWD
7DVN FRQWDLQHU
)XQFWLRQ PRGXOH
)XQFWLRQ PRGXOH
966)B'$7$)/2:B:6
966)B'$7$)/2:B:6
SAP AG 1999
Example in step 21 of the multistep task WS20000102 (creating a customer via web form): The
workflow container only contains scalar values, which must be grouped together for BAPI method
KNA1.CreateFromData for structure BAPIKNA101.
This is mapped in function module VSSF_DATAFLOW_WS20000084. The scalar values from the
workflow container here are written to the appropriate structure fields of the PiAddress variables
using the container macros SWC_GET_ELEMENT and SWC_SET_ELEMEMT.
SAP AG
BC610
4-12
l ,QWHUIDFH
function prog_binding
importing dataflow
tables
called_container
calling_container
like swabindef-dataflow
structure swcont
structure swcont
'DWDIORZ
(
,
([SRUW
,PSRUW
FDOOHGBFRQWDLQHU
FDOOLQJBFRQWDLQHU
SAP AG 1999
The variable DATAFLOW can only accept the values E (export, meaning binding from the
Calling_Container to the Called_Container) and I (import, meaning binding from the
Called_Container to the Calling_Container).
SAP AG
BC610
4-13
6WDUWLQJ 7DVNV
SAP AG 1999
For test purposes, tasks are started via the WF development environment. The current user must be a
possible agent of the task.
Tasks can be started via the "Workflow" entry in the System menu from the application transaction,
if an appropriate link is provided by the application.
This link is already implemented in the following applications:
Accounting (FI and CO)
Logistics - Purchasing
Logistics - Master Data
Plant Maintenance
Quality Management
Service Management
Starting tasks via the WIM API is discussed in the unit dealing with the runtime system.
Starting tasks via an event is discussed in the unit dealing with the event manager.
SAP AG
BC610
4-14
D PXOWLVWHS WDVN
PXOWLVWHS WDVN
SAP AG 1999
SAP AG
BC610
4-15
([HUFLVHV
8QLW 7DVNV
You have either found or created all the object types that you want to use
in your business process with the associated attributes and methods in
the Business Object Builder. Now you want to create single-step tasks
based on the object methods that you can use later in your workflow
definition.
Note: All tasks are based on the object type ZMARA##A.
1-1
1-2
SAP AG
BC610
4-16
1-2-3 Test the task in two steps. Start the task in the first step as usual, but do not
change the field basic material. Instead, initiate the transaction again. Now
view the instance linkages from the work item display.
1-2-4 In the second step, change the field basic material and search again for the
instance linkages.
1-2-5 Check the event trace to ensure that the terminating event really was
triggered.
1-3
Create a new standard task for displaying a material master from a particular view.
1-3-1 Create the task = 0DW'LVS9 with the method DisplayView. Define the
task as a general task. Specify both a work item text and a task description.
Output the material number in both texts.
1-3-2 Define view "K" (corresponds to "Basic data 1") as the default value for the
parameter for controlling the view called for the material.
1-3-3 Test the task by starting it via the workflow development environment.
SAP AG
BC610
4-17
8QLW 7DVNV
You have either found or created the single-step tasks that represent the
steps in your business process. Now you want to incorporate these singlestep tasks into a workflow definition.
2-1
SAP AG
BC610
4-18
2-1-5 This step is to have deadline monitoring. Activate deadline monitoring for
the latest end. This is to be triggered if processing of the step is not finished
after 5 minutes. Define the workflow initiator as the message recipient if the
latest end is missed.
2-1-6 For the display step, also define a secondary method, which displays all
change documents belonging to the current material in a separate session.
2-1-7 Check, save, activate and test your workflow again. Check whether, after
the Edit step, you have the notification of completion in your Business
Workplace.
2-2
2-2-2 Change the message recipient for completion for the "Edit" step. The
manager of the workflow initiator is now to receive the notification of
completion.
Note: Use the role AC00000168 to determine the manager of a
specific user. Read the documentation on this role in order to define
the binding from the workflow to the role container correctly.
2-2-3 Define another input parameter /DWHVW(QG'DWH for your workflow. This
parameter is used to determine the latest end for the Edit step.
2-2-4 Define another input parameter 0DWHULDO9LHZ for your workflow. This
parameter is used to control the view in the display step of the process.
Define view "K" as the default for this parameter.
2-2-5 Define DeadlineTest as another triggering event for your new workflow.
Define the binding between the event parameters and the input parameters
of the workflow. Activate the event linkage.
2-2-6 The latest end for the Edit step should be on the date determined via
/DWHVW(QG'DWH, five minutes after the current time. Ensure in your
workflow definition that this parameter cannot contain a deadline in the
past.
2-2-7 In the display step, replace the original task Z##MatDisp with the task
Z##MatDispV Supply the step parameter for controlling the display view
with the value of the 0DWHULDO9LHZ parameter from the workflow container.
2-2-8 Check, save, activate and test your new workflow both by starting it from
the development environment and by triggering the new triggering event
explicitly.
SAP AG
BC610
4-19
2-3
2-3-2 Enter your new function module as an alternative binding for the display
step in your workflow definition Z##MSIPROC2.
SAP AG
BC610
4-20
6ROXWLRQV
8QLW 7DVNV
1-1
1-2
1-3
Create a new standard task for displaying a material master from a particular view.
Solution:
TS98000008 Z00MatDispV
Path (via SAP Easy Access):
Tools > SAP Business Workflow > Development > Definition tools > Tasks/Task
groups > Create
SAP AG
BC610
4-21
8QLW 7DVNV
You have either found or created the single-step tasks that represent the
steps in your business process. Now you want to incorporate these singlestep tasks into a workflow definition.
2-1
2-2
2-3
SAP AG
BC610
4-22
SAP AG
BC610
4-23
5ROHV
&RQWHQWV
SAP AG 1999
SAP AG
BC610
5-1
SAP AG 1999
SAP AG
BC610
5-2
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
5-3
5ROH 5HVROXWLRQ
SAP AG 1999
Roles are used to restrict or define more closely the number of recipients according to business
considerations.
Benefits:
dynamic restriction of the number of possible agents
actual organizational plan does not need to be known
agents determined according to current conditions (role resolution at runtime)
Role definition, use of roles and role resolution using the role "Superior of." as an example.
SAP AG
BC610
5-4
l ,QWHUIDFH
IXQFWLRQ UROHBIP
WDEOHV
DFWRUBWDE
VWUXFWXUH VZKDFWRU
DFBFRQWDLQHU VWUXFWXUH VZFRQW
H[FHSWLRQV
QRERG\BIRXQG
l &RQWDLQHU FRQWDLQV WKH SDUDPHWHUV GHILQHG IRU WKH UROH
SAP AG 1999
The role container must be filled with a binding. If the role is used in a step, data can be transferred
from the workflow container. If the role is used as the default role of the task, data can be transferred
from the task container.
SAP AG
BC610
5-5
SAP AG
BC610
5-6
The result of a role resolution does not necessarily have to be a user - it can also be any
organizational object (for example, an organizational unit, a position, etc).
SAP AG 1999
% 0 )
i"$"'("$
%$ji"' $$09v$"t"$uhy98$A0u"
' % 0 5 q 0
1 8 7 % 8 )
1
g f q ) 5 7 ) 8 '
y9$("$
% 0 0
y9$A0""Q"8
% q 8 ) 5 7 ) 8
%99D(7Qq"hQh@1""7$)Q$ @"(wu$$r 99A9`@08
h 8
D
5
q 0 D q 8 ) 5 7 )
% P U ) 0 D q 8 ) 5 7 )
Qe"F9A9`@08
% 8 1 d ) 5 7 q h h
&"QF2$T"FA@("Q$"3
7 x
%1($7$("@vT"$
) 5 ) 8 0 0
% ' % ' 5 0 q 0
t"("""0A"Qu$7tq$91`"
1 8 % 7 D 1 '
%
A"
1 7 x )
(90
1 4
("0$) 9"$
1""7")($ @u1($$)("6"
7 5
1($698)
q
h 8 5
96@u
Q98"
h 5
) 7 0 4
$$
!
tY(b $QH(d(FR$"(w$
E 5 d E I S 5 Y
5 P
0 ) ' 8
% h 8 5 E 5Y H
&Q6@"(I($(Qd 8$("0$ ($Q9" W61
7 )
5 8 ) h 5 ) 5 3
% q 8 ) 5 7 0 ) 8 x 1 7 ' 7 % q 8 5 7 )
9`@$"""y9$) @08u$"
7 8
%&$w$w9)vwQ$v!$Q$$"0p$"u$7$Q$6"(
7 8 x x 3 1 7 0
) 1 i
1 ) 5
stQ6W9!"'($r 90p$"
h 8 5 r q 0 D
q 0 1 i
Q"(
h 8 5
g 8 ) 8
&$
D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D C
""D$"D"D"D""""""""D$"""""""""""$"""""""B
d U R 5 d R G
"$$$f 9e("R(
c
B
P 9Y("QI
R b I a
C
"B
6R$ VWTI"U$$T"I(W`F$65FE
P
S U S P S Y E R
C
"B
S X V
$RE96WPTI"9"$TG(F $E
S U U S P
E 5 S R
C
"B
Q""G(F
P I H E
C
"B
D D
"D"D$D"""D"""D"D""D""D$"""""""""""$"""""""B
D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D D C
% 0 5 7 0 5 8 5 5 4 1 )
&$$7A@"' 9$""7 "6"32$0$"('
&#$"
% !
l 7ULJJHU H[FHSWLRQ
QRERG\BIRXQG
5HVROXWLRQ RI $GGUHVVLQJ
l )LUVW OHYHO
7DVN SURILOH
l 6HFRQG OHYHO
'HWHUPLQDWLRQ RI UHVSRQVLEOH DJHQWV RU GHIDXOW
UROH RI WDVN
l 7KLUG OHYHO
5HPRYDO RI H[FOXGHG DJHQWV
SAP AG 1999
The level above may consist only of a further restriction of the level below. Therefore, if the first
level is missing because the task profile was not maintained, agents cannot be found in the
subsequent levels.
Unlike e-mails, the work items derived from the tasks are not delivered as copies. Instead, just one
work item exists for all recipients and they have only a view on it.
The explicit definition of possible agents in the task definition can be replaced by classification as a
"general task". In this case, all users known in the system can process the task.
If a role is specified both in the step definition and in the task definition, the role in the step
definition overrides the default role from the task definition.
Users who are not possible agents of the task never see the WI, even if they are responsible agents
because of a role resolution.
The default role of a task is also evaluated if the agent assignment using a role in the step definition
ends without a result, and the indicator "terminate if role resolution has no result" is not set for this
role.
SAP AG
BC610
5-7
PRGXOH
SAP AG 1999
SAP AG
BC610
5-8
([HUFLVHV
8QLW 5ROHV
The flow of the business process is now stored in the workflow definition.
You now want to assign the individual dialog steps based on the current
data of the object to be processed to the correct recipients.
1-1
1-1-2 Now define the role using the new function module. Define the parameters
for this role according to the implementation of your function module.
Note: The role parameters are defined via the role container.
Note: The workflow initiator can be defined with reference either to
field WFSYST-INITIATOR or to RHOBJECTS-OBJECT.
1-1-3 Use the newly created role for the agent assignment of the display step in
your workflow Z##MSIPROC2.
1-1-4 Check, activate and test your workflow Z##MSIPROC2 again.
SAP AG
BC610
5-9
6ROXWLRQV
8QLW 5ROHV
1-1
Solution:
AC30900129 Z00MatDispAc
Function module Z00_MM_MGR_OR_USER_GET
Organizational structure
O 00003100 Plant Chicago
----- S 50014947 Project Leader Engineering
----- P 00010810 Kimberley Hughes
----- US WF-BC-MGR Kimberley Hughes
----- S 50011158 Electrical Engineer
----- P 00010812 Caroline Douglas
----- US WF-BC-CLERK Caroline Douglas
Path: (via SAP Easy Access)
SAP AG
BC610
5-10
FUNCTION Z00_MM_MGR_OR_USER_GET.
*"---------------------------------------------------------------------*"*"Local interface:
*"
TABLES
*"
ACTOR_TAB STRUCTURE SWHACTOR
*"
AC_CONTAINER STRUCTURE SWCONT
*"
EXCEPTIONS
*"
NOBODY_FOUND
*"---------------------------------------------------------------------DATA: MATERIAL_TYPE LIKE MARA-MTART. " type of changed material
DATA: WF_INITIATOR LIKE SWHACTOR.
" workflow initiator
DATA: COUNTER
TYPE I.
REFRESH ACTOR_TAB. CLEAR ACTOR_TAB.
* get type of material under consideration
SWC_GET_ELEMENT AC_CONTAINER MaterialType MATERIAL_TYPE.
SWC_GET_ELEMENT AC_CONTAINER WorkflowInitiator WF_INITIATOR.
CASE MATERIAL_TYPE.
WHEN ROH. " get manager of wf_initiator from role
SWC_SET_ELEMENT AC_CONTAINER ORG_OBJECT WF_INITIATOR.
CALL FUNCTION SWX_GET_MANAGER
TABLES
ACTOR_TAB
= ACTOR_TAB
AC_CONTAINER
= AC_CONTAINER
EXCEPTIONS
NOBODY_FOUND
= 1.
IF SY-SUBRC NE 0.
RAISE NOBODY_FOUND.
ENDIF.
WHEN OTHERS.
ACTOR_TAB = WF_INITIATOR.
APPEND ACTOR_TAB.
ENDCASE.
* check if we have found any agents at all
DESCRIBE TABLE ACTOR_TAB LINES COUNTER.
IF COUNTER = 0.
RAISE NOBODY_FOUND.
ENDIF.
ENDFUNCTION.
SAP AG
BC610
5-11
&RQWHQWV
l (YHQW PDQDJHU
SAP AG 1999
SAP AG
BC610
6-1
SAP AG 1999
SAP AG
BC610
6-2
2UJDQL]DWLRQ
3URFHVVHV
%XVLQHVV
REMHFWV
3RVLWLRQMRE
3HUVRQ
2UJ XQLW
7DVN
5ROH
:) GHILQLWLRQ
$WWULEXWHV
6WHS
(YHQWV
0HWKRGV
2EMHFW
SAP AG 1999
SAP AG
BC610
6-3
(YHQWV 0RWLYDWLRQ
l 6KLIW RI FRPSOH[LW\
l *UHDWHU IOH[LELOLW\
SAP AG 1999
The complexity and management of general information are shifted from the applications to a central
component. The information on possible linkages is no longer in the applications.
New linkages can be easily integrated without changing the source code of the application. External
components can also be connected.
SAP AG
BC610
6-4
SAP AG 1999
Linkages are entered according to the principle of "publish and subscribe", meaning that the creator
publishes the event without considering possible receivers. The number of receivers makes no
difference to the creator.
Interested receivers have to "subscribe" with the event manager (EM).
Linkages are evaluated by the EM according to the ECA paradigm. The event is triggered (E=event),
the linkage tables are checked and, if necessary, check function modules are called (C=condition),
and finally the receivers found are notified (A=action).
In accordance with the OO approach for the creators, the linkage is evaluated hierarchically.
There is an option for a dynamic evaluation of the linkage using the check and receiver type
determination function modules.
Triggered events are evaluated immediately, meaning the receiver is called immediately. The events
are not stored temporarily.
The event is only triggered after an SAP commit (ABAP keyword COMMIT WORK); an implicit
database commit is not sufficient. Triggering does not take place after a ROLLBACK WORK.
SAP AG
BC610
6-5
SAP AG 1999
Without an explicit commit work, the events "do not take place" (transactional property).
A new login is carried out for the event receivers with each destination (RFC property).
The transactional RFC (tRFC) log can be read via transaction SM58.
SAP AG
BC610
6-6
(YHQW 0DQDJHU
)% VZHBHYHQWBFUHDWH
(YDOXDWLRQ RI
OLQNDJH WDEOHV
$SSOLFDWLRQ 5HFHLYHU
&DOO UHFHLYHU
W\SH )0
&RPPLW :RUN
&DOO
FKHFN )0
&DOO
UHFHLYHU )0
&UHDWRU FRQWH[W
5HFHLYHU FRQWH[W
5
%6%#4
!
3
% 12) $ 0(
'%##"!
& $
SAP AG 1999
The receiver type FM and check FM run in the creators context in order to avoid superfluous tRFCs.
SAP AG
BC610
6-7
SAP AG 1999
The type linkage is implemented using the type linkage table. The "global" indicator is activated.
An entry in the type linkage table is always required if a receiver is to be notified. Maintenance takes
place either explicitly or internally using function modules.
The table entries can be transported, but the transport is usually carried out without the activity
indicator. Therefore the linkages usually have to be activated explicitly in the target system. If the
activity indicator is to be transported, this can be done using the general transport link of the
generated view maintenance.
Type linkages for triggering events are entered by the workflow runtime system when the linkage is
activated in the task definition, if there are no check or receiver type function modules. If at least one
such function module is required, the linkage must always be entered manually (as part of
Customizing for the relevant workflow).
Type linkages for terminating events are entered automatically by the workflow runtime system
when the associated work item is created, if there are no check or receiver type function modules. If
at least one such function module is required, the linkage must always be entered manually (as part
of Customizing for the relevant workflow).
SAP AG
BC610
6-8
SAP AG 1999
The instance linkage is implemented using a combination of the type linkage table and the instance
linkage table. In the type linkage table the "global" indicator is deactivated.
The instance linkage table is only evaluated if the associated type linkage is "active" and not
"global". Maintenance usually takes place using only function modules. The appropriate workflowrelated entries (for example, for terminating events of a step) are entered and deleted automatically
by the workflow runtime system.
For test purposes, it is also possible to make entries in or changes to the instance linkage table
manually.
SAP AG
BC610
6-9
Call receiver FM
7
Call check FM
l 2WKHUZLVH
SAP AG 1999
SAP AG
BC610
6-10
SAP AG 1999
All triggered events are entered, irrespective of whether and how many receivers were found. A
separate entry is made for each receiver.
Errors in the check and receiver type function modules are also logged.
Internally, the trace is regarded as an additional receiver which is always triggered. It is independent
of the commit behavior of other (explicit) receivers.
Updating and writing the trace is time consuming because a separate tRFC is triggered. For this
reason, the trace should be deactivated in live systems (see note 46358).
You can restrict the writing of the trace to selected object types or events.
SAP AG
BC610
6-11
or
or
or
or
SAP AG 1999
Events must be defined in the Business Object Builder for the relevant object type. Not all defined
events must be triggered, but all triggered events must be defined.
Implicit triggering via change documents does not require any ABAP coding. Customizing activities
for the triggering application are necessary instead.
Explicit triggering via function modules requires the source code of the application to be changed or
extended.
Important: the function module SWE_EVENT_CREATE can trigger exceptions. If these are not
caught by the triggering application, a runtime error occurs.
The triggering modules do not execute COMMIT WORKs themselves. It is the task of the triggering
application to issue a COMMIT WORK at the right time.
Events with user-defined parameters must always be triggered explicitly if these parameters are to be
set.
Explicit triggering via function modules usually takes place in customer systems by the customer
programming an existing user exit.
SAP AG
BC610
6-12
SAP AG
n
BC610
6-13
,PSRUWDQW
If the event is triggered in a user exit, a COMMIT WORK usually must not be programmed here,
since this would destroy the commit logic of the application.
SAP AG 1999
wi b8 i
HHDBQBtBA
g@9@hBsHHD%0DBhDHhb@
8s GAi P sb b a s
Y q8 F9
`HBG
g 98 F a o i G 9 i i x i
DhBCBB9@@D@BpD@pBE@DDF ~
Y U G 9 eEs xs
}DABQ44H}q@8
Y WU i s ob
B}|2hGDi
s 9i8 b GA
%BD2hv@G
HBD@b9@DQuTHp@B9hDah9@BuTHDBHG
G98 a i A b G i G 8 b iA b9 G
s%@Q4a@b
GC e
d`BHB9hhdwi
FGg a oA
HDBHG
b9 G
x@G@vDH#4ir{Hhh#4i
w ub AG e i xGw e
d UWp x i G b e
BBBQz@ydw%HxTH#4i
g 98 b i
D4DDH%hv@G
d q tq P uS Rq rq q pd 9i 8 b A 9 q C C a
uS2BshTQ4Q42uT2v6jBHDHDE@BBBA
b9GG
BBBHrG@o@@BHg@BBS0
b Gg 8
Y`@Hu4Bsrx@G@vDH#4i
xGw b Gs a i
w ub AG e
HdDHB6ji
Y U U W Ud
eE9 ueEs xGw ubGss
BGBH2HtHB2BH%a
Y@V%m@BBhHDhDHB6ji
d n l k W U U U U U Ud
i 9 ub G s a xGw ubGss
D2DhshQB2BH%a
HdDHB6jBF@BA2xhHQDDB2BH%a
Y W U U Ud i G i u 9 a i A xG w ub Gs s
x@G@DBh2irt%QBTDP0
w b AG e Gs i i
Y dhd'9DHGBF@BG@#u%E@BQtg@HDeHBDa@9hBDHDDDhhCQDuTts
g d 9 a 8 f G u a C qd G 9 8 b i A ub G b 9 G G G ub G s A
HBD@b9@DADBHHh9hQH@DG2@20hBB
G98 a i b 9GG ib 8 s Gb a a Gb8
Y`HGBDa@bhiBbBG
98 9 A u
@BhDa@%DuTDts
G98 b 9i A A
Y Gw i iAbs 9 s Gw
xhBteth%E@HHQh8GD4H@8@C
x@H#AB4dHBDF
G w ub G ei c a b a
Y`@Hu4BspBirF@BG
xGw b Gs a q
9
y 9 a C
VDhC9hhaHD9@aHw@8@C
G
G eE e
B%B4H92u@Ets
y W 9 9 a a G
QhChahHCD9@Hw@8@C
DQDHa
i 9 ub Gss
yQHDDHD9@Hw@8@BhBHQBtHA
s w E e aC a G C GFiA ux9a i
y`@G@vtBsrBph8g@QefdHBDF
x w ub Gs a qi 9 G c aba
Y XWU R RP GF EC A
`4HVTS24QI0HD4DB9@8
l &DOO VZHBHYHQWBFUHDWH
SAP AG
n
BC610
6-14
Y wi b i
'hB0B82BtHA
g9 ss GA sb ab
H@8hH%HHiDPD@@pbBH@@s
Y WU i s G ob
HQHti
H@8D%h@hG
s 9i b GA v
G 8 9i u G i G98 b 9i u 9 G
HH9hDa@bhBATbBBrHBhBa@@BA2bDD@BG
sDHC24ahb
G e
'BDBB@3dji
d FGb aG A
bDD@BG
9 G
xGw b AG ei i xGw e
HHuDB4@Hh2i
d BU@UBDQ@x d @4H2i
W W p z
i G xb e
g9 bi
Bh8DHBQhvhG
q@S2tDs@SQQ4Qutq2v6de@BhABDEhCBBHA
d tq P u Rq rq p 9i8b 9 q Ca
D9BBHB@rHB@@8DBS"
b GG Gob Ggg
HdBh%mHBkBHBHUB6jipHHbDB#ti
Y d n l W U U Ud
xGw u AG e
Y`@B9hDa@D9@iBbDHG
G 8 b A u
HGBh8Dh@DQtts
9 ab 9i A uA
x4GD4eTihQE@HA@hQ9h8BtGhHHC
Y w
i bs G s w8
xGw ub AG i c aba
@@v@h#e4HBBF
`X4@R4S2TP2@DCDB9h8
Y WU R I GF E A
=B%86
%86
2EMHFW W\SH
&UHDWHG
&UHDWHG
(YHQW
:6
:6
5HFHLYHU W\SH
SAP AG
n
BC610
6-15
The event is triggered for the subobject type as well as for all supertypes for which the event is
defined.
SAP AG 1999
`@HBQBtBA
Y wi b8 i
g 8ss GAi P b ab
@9@hBHHDBHshpbDHh@s
Y W i
BU}s2HGD4bDi
o
s i b GA v
D9B@8BQ@@G
G98 b 9i A ub G i G98 b 9 A u 9G
HBDa@%DDHr@BhDah@iDQTbDBHHG
s G ea
@C24@b
'BGhDHB@wi
d F b a G Ad
bDBHHG
9G
x@HvDH#e4rHHe4i
Gw ub AG i i xGw
d BHBD%z@2uv wpGDH4@e4i
WUUW p x d i xb
g 9 bi v
Dh8BBHQh@G
d S tq P S Rq q q p 9i8 A Eq C a
uq@Q4Bs@uTQ4Qr42uT2vde@H@bDB9D@BCBBA
b GG G b gg S
B9BBBBohrHGBH@8BB0
Y dB@%m@BBh@BHUDip@HwvbDH#e4i
d n l k W U U Ud
xG u AG
Y`HBD@bhBuTBBG
G98 a 9iA b
@GBh%@BA2Tts
98 ab 9i uA
Y xGw e iAbs 98 Gs
B4tih%E@HHQh%H4}G@w@HC
8
x w u AG e c a a
HGh#vbDH#4idHbBDF
`hVR4QtQHDE4CDB@8
Y XWU S RP I GF A9
=B%86
%86
2EMHFW W\SH
&UHDWHG
&UHDWHG
(YHQW
:6
:6
5HFHLYHU W\SH
,QWHUIDFH
function receiver_fm
importing objtype like swetypecou-objtype
objkey
like sweinstcou-objkey
event
like swetypecou-event
rectype like swetypecou-rectype
tables
event_container structure swcont
3URFHVV LQ VHSDUDWH FRQWH[W
SAP AG 1999
If possible, the function module should not trigger any exceptions, since these are only recorded
directly in the tRFC log. If this occurs, workflow receiver function modules send an error message to
the workflow system administrator.
In the case of propagated events, the default parameter _EVT_OBJTYPE contains the triggering
object type (that is, the subtype), while the interface parameter OBJTYPE contains the propagated
object type (that is, the supertype).
This also applies to the check and receiver type function modules.
SAP AG
BC610
6-16
l
l
,QWHUIDFH
function check_fm
importing objtype like swetypecou-objtype
objkey
like sweinstcou-objkey
event
like swetypecou-event
rectype like swetypecou-rectype
tables
event_container structure
swcont
exceptions others
3URFHVV LQ FUHDWRU FRQWH[W
SAP AG 1999
SAP AG
BC610
6-17
SAP AG
n
BC610
6-18
If the event is triggered before the object data is written to the database, the object attributes are not
yet available for querying, since the database is accessed when the attributes are evaluated by the
Business Object Builder.
This may occur, for example, if the event is triggered implicitly when generating the object (that is,
via change documents, status management, etc.) and the object is not generated until later in
updating.
Write additional values to the event container.
Object attribute query using the macro SWC_GET_PROPERTY
Default parameter query (for example, date, time, object type)
Y i b A9 EqF9
`9@B8hBDhBHBG
Y q8 F9
`HBG
Y FGC8a q u A oA Gs 8a
BBBDQtw@DGBHp4HD
2BT#TQhxh@ir%G@4DuTH9@HDHq@8
Y C a uG b uA X I xb i g 8b a8 b8 98
G i G 8s GF 8 b ei g b 8b8 98 q wA G A
D9@pFBH@QH0sG%HxTH#4pH9@8@Da@BHDhH8r@DHo@
eDH4Di2tH9@8@Da@Bb@hG24hB#b%@vA
Y G xb ug b 8 8 98 xbi u G u
HB9h%9@B2DBHHDH%Gh%%TDBQuTts
G 8 ab iA ub 9GG b 9G C G ub Gg A
HD4a@bhBBBBHtDH2htpBhBbBBhgh%HHD"
G 98 9iA b9GG i q G xb ei g98 a98 8 i FaG s
q A G A q 9 8 ab 9 G GC
hw@DHo@rhirHi@HbBHDDDhh@t
Y xb i iA G xb G s Gw8C G xbi g98 a8b 898 c aba
G24hheThQE@@D%@4DDthHHrQhH#uTBhHbBHHDHHdHBDF
YqhD@HDBQ4rhQu eBhHaBB%h%T%DHi@%TsBh8Br%@4QTbHQuTA
d S x uS q d GEC b9G GC G b 9 A Gw C G xb i u G
yh`HH2ttDBeGDBQhThQE@HADH4bBt}G@w@HH44DH4D2uTA
d P d E C a G x b ei i G x G s
8C C a uG xb i
c sb abs i
dH%9@HQ9@BA
Y XWU RS RP GF EC A
`4H#4Q42I0HD4DB9@8
HBHDhDHB@BHB@BHB@BHBHDhDHB@BHB@BHBHHHBHDhDHB@BHB
HG@C@DBHABDohQ9@B8h#4HBHG0
F 8 aq uw G A s i b GAv
b iA
9@BDts
HD4DDHb@}HD48@bhBBBGBHG
G Eb A E s G 9 a 9iA ub9
s2hTH
GC eab
G xbA G iA G x G
QhHDH%E@H%h4bDts
G 8
BwhDC%@tDBB
G xb AG
b G G iA G x G
9@D@%E@H%h4bDts
G 8
BwhDC
b9
BBGBHG
xhBtth%E@HBh%h8Dts
Gw ei iAbs 9 G
G 8
BwhDC
x w e
@G@#4i
GQhth%E@H%h4bDts
xb ei iA G x G
G 8
BwhDC G@4b@#trHH8h%@i2@t
x ei g9 b 8
HBHDhDHB@BHB@BHB@BHBHDhDHB@BHB@BHBHHHBHDhDHB@BHB
2BTBHDhVvG2hBDtt#Tw@BDhpBi@BHD9BHq
Y C aAi F8 u xb ubA G ei u AG oA 9 8bA E
l 7ULJJHU DQ H[FHSWLRQ RU
HQG IXQFWLRQ PRGXOH
l &KHFN FRQGLWLRQ
l
l
SAP AG 1999
The table entry "receiver type" (rectype) from the type linkage table can be used as an input
parameter generic_rectype for the function module.
SAP AG
BC610
6-19
SAP AG
n
BC610
6-20
If the event is triggered before the object data is written to the database, the object attributes are not
available yet for querying, since the database is accessed when the attributes are evaluated by the
Business Object Builder.
This may occur, for example, if the event is triggered implicitly when generating the object (that is,
via change documents, status management, etc.) and the object is not generated until later in
updating.
SAP AG 1999
Y i b A9 EqF9
`9@B8hBDhBHBG
Y q8 F9
`HDq
Y 8 ei s Fb
F@th@h@iHDH4DHDs
G xb AG
QhHhH@bpDH4DHDs
Y G xbis F i G xb AG
DC%q
Y Gs
QhHDHi4Has
Y G xbA G u 9 Gs 8
Y U G9 As Es xs
V}HHVetH}q@
Y bs wi uC i bs i
h2F2Qw@DF
F9 awiF xGw a
BharHHHB2Hh%D@FrHaBHHpBHo@
i wiF GG
s2@b4HB0}hHH4sDHG@Ds
F iq GC g98 b A C G
shF@rhtBtD@pQHBG@AhrHHB0
b GC eab i q G xb G8 G FaG
'x@H4#4phBBhBBF
Y Gw ei i xGw a
Y bs i F uC d p zS tSp Rq P
Qw@DQQhQ4HHS2Q4z@BDd
HB9h%9@B2DBHHDH%Gh%%TDBQuTts
G 8 ab iA ub 9GG b 9G C G ub Gg A
HGBDa@hiBBBBHiHq02Dah@DH%hhDi@rHHD"
98 b 9 A b9GG s Eb bs b 9G EA F FaG s
p@4DG@@DHHBphirHi@HbBHDDDhh@t
q G xb 8 GAG q 9 8 ab 9 G GC
'x@G@DHHhDG
Y w a F qi F9
y b i F a F Gw8C Cb wi
dC@w@D4#tHBhBHhDF
y i F a F Gw8 wi
HHw@D4#tHBhBCrBHhDF
y 9 i F a F Gw8 9wi
@Bw@D4#tHBhBCrHBhDF
y a i F a F Gw8 a wi
hDw@D4#tHBhBCr@DhDF
y Gw a F i 8 gG c aba
x@H4DHpq@r9h%h2efdHBDF
hs2i44DHBh8BbhQw@i%TdHBDF
Y b w F a F Gw C s F uC c aba
Y XWU RS RP GF EC A
`4H#4Q42I0HD4DB9@8
B@BHB@BHBHDhDHB@BHB@BHB@BHBHDhDHB@BHB@BHBHHHBHDhDHB@BHB
G@4DHB2uTB90Q9@B8h#4HBHG0
xb AG i s i b GAv
b iA s G E A E
9@BDtHbBDHhb@s
HD48@bhBBBGBHG
G 9 a 9iA ub9
s2hTH
GC eab
G xb A E AG xb G
%@4DHGB42iBBQD%TsBhBC
Gw8
G xbA G g9 b v
QBDHHH8h%@i24HG0
G xb A E AG xb G
%@4DHGB42iBBQD%TsBhBC
Gw8
G x AG u 8 G9G
%HTbBBQTA@@BHBg
D9BHH42iBBQD%TsBhBC
b GG E AG xb G
Gw8
b9
BBGBHG
@H42iB@b@s9@D%TsBhBC
xGw ei E A
8 G
Gw8
x w e
@G@#4i
G x ei E AG xb G
%@4b@42iBBQD%TsBhBC
Gw8
G@4b@#trHH8h%@i2@t
x ei g9 b 8
B@BHB@BHBHDhDHB@BHB@BHB@BHBHDhDHB@BHB@BHBHHHBHDhDHB@BHB
Y bGg ub w F A ub9GG q A 9 8bA E
BB2hs2i2uTHGB2BBBH2uTDHhpBi@BHD9BHq
l 7ULJJHU DQ H[FHSWLRQ RU
HQG IXQFWLRQ PRGXOH
l 'HWHUPLQH WKH UHFHLYHU
W\SH RQ WKH EDVLV RI
DSSOLFDWLRQVSHFLILF
VHWWLQJV
7
7
SAP AG 1999
SAP AG
BC610
6-21
%\ D EDFNJURXQG MRE
,Q GHILQHG XQLWV
$W SUHGHWHUPLQHG LQWHUYDOV
7
7
SAP AG 1999
If the receivers are still started by tRFC (default), no less tRFCs are initiated than when the event
queue is not used. But the calls are distributed over a longer period of time so the short-term system
load is reduced.
SAP AG
BC610
6-22
Event
Event manager
tRFC call
Immediately
Determination of
receivers
Starting of
receivers
Event queue
Linkage tables
Entering in
queue
Inserting
Event queue
Selection
(t)RFC call
start
Background job
SAP AG 1999
Starting of receivers
Directly by tRFC
Using the queue if:
- The event queue is activated
- The event linkage allows the queue to be used
SAP AG
BC610
6-23
SAP AG 1999
SAP AG
BC610
6-24
'HDFWLYDWLRQ RI OLQNDJH
7
7
SAP AG 1999
SAP AG
BC610
6-25
'HDFWLYDWLRQ RI /LQNDJH
SAP AG 1999
SAP AG
BC610
6-26
SAP AG 1999
SAP AG
BC610
6-27
SAP AG 1999
SAP AG
BC610
6-28
SAP AG 1999
SAP AG
BC610
6-29
SURJUDPPLQJ
SAP AG 1999
SAP AG
BC610
6-30
([HUFLVHV
8QLW (YHQW 'HILQLWLRQ DQG ,PSOHPHQWDWLRQ
6HFWLRQ (YHQW 0DQDJHU
1-1
SAP AG
BC610
6-31
2-1
2-2
SAP AG
BC610
6-32
2-3
SAP AG
BC610
6-33
6ROXWLRQV
8QLW (YHQW 'HILQLWLRQ DQG ,PSOHPHQWDWLRQ
7RSLF (YHQW 0DQDJHU
1-1
SAP AG
BC610
6-34
2-1
SAP AG
BC610
6-35
SAP AG
BC610
6-36
2-2
FUNCTION Z00_CHECK_MATERIAL_CHANGEDBY.
*"---------------------------------------------------------------------*"*"Local interface:
*"
IMPORTING
*"
VALUE(OBJTYPE) LIKE SWETYPECOU-OBJTYPE
*"
VALUE(OBJKEY) LIKE SWEINSTCOU-OBJKEY
*"
VALUE(EVENT) LIKE SWETYPECOU-EVENT
*"
VALUE(RECTYPE) LIKE SWETYPECOU-RECTYPE
*"
TABLES
*"
EVENT_CONTAINER STRUCTURE SWCONT
*"
EXCEPTIONS
*"
OBJECT_NOT_FOUND
*"
INVALID_USER
*"
INVALID_MATERIAL
*"---------------------------------------------------------------------* This check fm checks, if the user who triggered the event (USER) is
* the same person who is related to the sample material and if
* the material changed is really one of my sample materials.
CONSTANTS:
MY_SAMPLE_MATERIAL_ROH LIKE MARA-MATNR VALUE 200-110,
MY_SAMPLE_MATERIAL_FERT LIKE MARA-MATNR VALUE 200-101,
MY_SAMPLE_MATERIAL_HALB LIKE MARA-MATNR VALUE 200-100,
MY_OWN_USER LIKE SY-UNAME VALUE WF-BC-CLERK.
DATA:
MY_SAMPLE_MATERIALS LIKE MARA-MATNR
OCCURS 3 WITH HEADER LINE.
DATA: OBJECT TYPE SWC_OBJECT.
DATA: CHANGER LIKE MARA-AENAM,
USER_ACT LIKE SWHACTOR,
USER
LIKE SY-UNAME.
SAP AG
BC610
6-37
SAP AG
BC610
6-38
2-3
FUNCTION Z00_RECTYPE_DETERMINE_MATTYPE.
*"---------------------------------------------------------------------*"*"Local interface:
*"
IMPORTING
*"
VALUE(OBJTYPE) LIKE SWETYPECOU-OBJTYPE
*"
VALUE(OBJKEY) LIKE SWEINSTCOU-OBJKEY
*"
VALUE(EVENT) LIKE SWETYPECOU-EVENT
*"
VALUE(GENERIC_RECTYPE) LIKE SWETYPECOU-RECTYPE
*"
EXPORTING
*"
VALUE(RECTYPE) LIKE SWEINSTCOU-RECTYPE
*"
TABLES
*"
EVENT_CONTAINER STRUCTURE SWCONT
*"
EXCEPTIONS
*"
OBJECT_NOT_FOUND
*"---------------------------------------------------------------------* This receiver type fm determins the process to be started by the
* material type
DATA: OBJECT TYPE SWC_OBJECT.
DATA: MTYPE LIKE MARA-MTART.
* create the material object
SWC_CREATE_OBJECT OBJECT OBJTYPE OBJKEY.
IF SY-SUBRC NE 0.
RAISE OBJECT_NOT_FOUND.
ENDIF.
* check material typ and set receiver type depending on value
SWC_GET_PROPERTY OBJECT MaterialType MTYPE.
IF MTYPE EQ FERT.
RECTYPE = WS96000011.
" Z00MSIPROC1
ELSE.
RECTYPE = WS96000012.
" Z00MSIPROC2
ENDIF.
ENDFUNCTION.
SAP AG
BC610
6-39
&RQWHQWV
l &RPSRQHQWV DQG DUFKLWHFWXUH
l :RUN LWHPV
SAP AG 1999
SAP AG
BC610
7-1
PDQDJHU $3,
SAP AG 1999
SAP AG
BC610
7-2
V\VWHP
SAP AG 1999
SAP AG
BC610
7-3
2EMHFW
PDQDJHU
LQYRNH
:RUNIORZ
GHILQLWLRQ
7DVN
GHILQLWLRQ
%25
H[HFXWH
UHVXOW
UHVXOW
$SSOLFDWLRQ
:RUN LWHP
PDQDJHU
FUHDWH
UHVXOW
Definition
System
:RUNIORZ
PDQDJHU
Runtime
System
UHVXOW
UHVXOW
(YHQW
PDQDJHU
SAP AG 1999
The workflow manager (WFM) reads the workflow definition and the step definition and creates one
work item (WI) per step using the work item manager (WIM). The WFM is then finished.
The WIM manages the WI and triggers the application via the object manager (OM).
If the underlying method is synchronous, the result and the export parameters of the method are
returned to the WIM via the OM.
If the underlying method is asynchronous, the result of the method is returned to the WIM via an
event that is triggered in the event manager (EM). This event must be defined as a "terminating
event" for the step.
After receiving the return parameters, the WIM checks the return code and, if successful, returns the
data to the WFM.
Event creator, conditions, process control and container operations are executed locally in the WFM
without a work item being created.
SAP AG
BC610
7-4
SAP AG 1999
SAP AG
BC610
7-5
Stop/continue process
SAP AG 1999
SAP AG
BC610
7-6
SAP AG 1999
Processing is monitored using the individual WI statuses. The processing sequence is determined by
the statuses and the possible transitions. The WI is also locked during processing using the individual
statuses.
Deadlines are monitored using the background job SWWDHEX and the report RSWWDHEX (see
below).
For precise evaluation of the agent assignment, refer to the unit "Roles".
An agent who is not a possible agent for the task underlying the WI never receives the WI in their
Business Workplace, even if they were the result of a role resolution.
All the activities executed by a user are logged with the WI. There is therefore a complete processing
history for each WI.
During execution, all secondary methods are started as well as the method from the task. Secondary
methods run in a separate session.
Before the method from the task is executed, the before methods are executed in an arbitrary
sequence. After the main method has been executed, the after methods are executed in an arbitrary
sequence.
SAP AG
BC610
7-7
SAP AG 1999
A work queue work item is a "logical unit" of objects and tasks that are to be executed together. Both
objects and tasks can be different.
A background work item is used to execute tasks that do not require dialog. They are executed
automatically by the WF runtime system and do not appear in the Business Workplace.
A container linkage work item serves as a logical relationship between several associated objects. It
corresponds to the assignment table from WF21. A container linkage does not possess any semantics
of its own and never appears in the Business Workplace.
A missed deadline work item is created by default when the WF system detects that a monitored
deadline has been missed.
A wait step work item receives events created externally or by other WIs. A wait step has no
processing logic and does not appear in the Business Workplace.
A workflow work item represents a workflow to be processed, the definition of which is then
processed by the WFM.
SAP AG
BC610
7-8
SAP AG 1999
The WI language determines the language of the short text and the status texts. The language of the
long text is determined by the users logon language.
When a workflow is started via an event, the language of the event is passed on to the workflow.
Under "Personal workflow settings" in the Business Workplace, the user can set whether his or her
work items in the Business Workplace always appear in the logon language. In this case, all WI texts
are put into the users current logon language when the Business Workplace is compiled. This setting
reduces performance considerably, however.
SAP AG
BC610
7-9
l :$,7,1*
ZDLWLQJ
l 6(/(&7('
UHVHUYHG
l 5($'<
l 67$57('
l &200,77('
l (5525
l &203/(7('
l &$1&(//('
UHDG\
LQ SURFHVV
H[HFXWHG
HUURU
FRPSOHWHG
ORJLFDOO\ GHOHWHG
SAP AG 1999
A WI has the status WAITING if its requested start has not yet been reached. With this status it
cannot be seen by any user.
A WI with status READY appears in the Business Workplace of the recipients. WIs running in the
background with this status are executed immediately.
The status SELECTED only applies to dialog and work queue work items. It means that the WI has
been reserved by one of the recipients and therefore disappears from the Business Workplace of the
others.
When the underlying method has been started but not yet completed, the WI has the status
STARTED. The WI remains in the Business Workplace of the current agent.
If the underlying method has been executed successfully but the WI has to be set to done manually,
it has the status COMMITTED.
If, during execution of the method, a return code not modeled in the related workflow was returned
or irreparable damage occurred in the WIM, the WI is assigned the status ERROR.
If processing of the WI has been completed successfully, it is assigned the status COMPLETED.
If the WI is no longer required within the flow logic of the workflow, it is assigned the status
CANCELLED.
SAP AG
BC610
7-10
6WDWXV 7UDQVLWLRQV
&DQFHOOHG
:DLWLQJ
5HDG\
(UURU
6WDUWHG
6HOHFWHG
&RPSOHWHG
&RPPLWWHG
SAP AG 1999
Not all work item types can assume all statuses (for example, SELECTED only for dialog and work
queue work items, COMMITTED only for dialog work items).
The change from one status into another always happens implicitly on the basis of an executed
activity (for example, "reserve" in the Business Workplace).
SAP AG
BC610
7-11
SAP AG 1999
Important: the function modules in the function group SWWA are not officially released externally,
meaning that their interface may change. However, all efforts are being made to keep enhancements
upwardly compatible.
Only the function module WORKITEM_ARCHIVE_OBJECT for archiving a work item is officially
released.
When a work item is started or created, the caller must first fill the task container with the input
parameters of the task according to the task definition.
The caller must also incorporate error handling measures if the WI cannot be created or started.
Before a work item is executed, the caller must check whether all the prerequisites for execution
have been fulfilled (for example, is the current user permitted to execute the WI).
All administration function modules (SWW_WI_ADMIN_*), for example, are in the SWWA
function group.
All function modules of the SAP WAPI interface can also be used (SAP_WAPI_*). These are in
function groups SWRC and SWRR.
SAP AG
BC610
7-12
SAP AG 1999
SAP WAPI is an SAP-specific API based on the interface definitions of the Workflow Management
Coalition.
The SAP WAPI function modules call again the function modules internally from SWWA. The
functionality is the same, but the interface is different.
If possible, the function modules from SWRI should be used instead of direct table access (e.g. to
tables SWWWIDEADL and SWWWIRET) for work item selection within analysis and reporting.
SAP AG
BC610
7-13
SAP AG 1999
The entire header data is located in the table SWWWIHEAD. The view SWWVPUBLIC contains
the elements that are available for general selection and do not represent internal administrative data
of the WIM.
Changes to the structure of the SWWVPUBLIC view are only upward compatible. The structures of
the remaining tables and others are not guaranteed. If data of a known work item is to be read, the
function modules SWW_WI_HEADER_READ, SWW_WI_DEADLINES_READ and
SWW_WI_RETURN_READ from the SWWA function group should be used (or as of 4.5A,
SWW_WIS_*_READ, if the data from several work items is to be imported).
Non-objects in the work item container include scalar values (char, integer) and structures.
Changes to work items must never be made by direct table changes, but always via the function
modules in the function group SWWA.
SAP AG
BC610
7-14
2EMHFW 5HIHUHQFHV
Used in BOR
Used in workflow
SAP AG 1999
The BOR only recognizes RHs (for example, as a result of macro SWC_CREATE_OBJECT, as
input for method calls, and so on). An RH is only valid during the runtime of the creating program
and expires immediately afterwards.
This is not sufficient for the workflow, since there may be program changes or several days between
the individual steps. For this reason, there must also be a persistent presentation. This presentation is
visible, for example, when you look at the work item container.
All BOR macros expect an RH; all workflow FMs expect PORs.
The workflow ensures correct conversion automatically. An explicit conversion is always necessary
when you write your own FMs that are called on the interface between the workflow system and the
BOR (for example, check FMs in the event manager).
The explicit conversion takes place using the macros SWC_CONTAINER_TO_RUNTIME and
SWC_CONTAINER_TO_PERSISENT from the include <cntn01>.
SAP AG
BC610
7-15
(YHQW 0DQDJHU
5XQWLPH KDQGOH
1 0 5 3
"" 42
(("(&#$" !
1 0 ) ' %
3HUVLVWHQW
REMHFW UHIHUHQFH
5)&
:)
5XQWLPH KDQGOH
%25$SSOLFDWLRQ
:)
3HUVLVWHQW
REMHFW UHIHUHQFH
%25$SSOLFDWLRQ
5XQWLPH KDQGOH
:)
3HUVLVWHQW
REMHFW UHIHUHQFH
%25$SSOLFDWLRQ
5XQWLPH KDQGOH
:)
SAP AG 1999
User-controlled conversion is always necessary when the caller requires a different type of
presentation than the current one.
With every user-controlled conversion, the caller must ensure that a "re-conversion" takes place
afterwards, since the original presentation is expected again in the subsequent context.
When a workflow is started directly via the API, the RHs created in the program using the BOR
macros must also be converted to PORs before SWW_WI_CREATE (or SWW_WI_START) is
called.
SAP AG
BC610
7-16
SAP AG 1999
The user-defined tab is never visible in processing chains, since the object method underlying the
step is executed immediately.
SAP AG
BC610
7-17
SAP AG 1999
SAP AG
BC610
7-18
(LWKHU
'LUHFW SURFHVVLQJ LQ WKH VXEVFUHHQ
2U
7UDQVIHU RI WKH 2. FRGH WR WKH VXSHURUGLQDWH :, VWDQGDUG VFUHHQ
SAP AG 1999
The programming is carried out via macros from the <widisp> include. This include must be
included in the module pool.
SAP AG
BC610
7-19
SAP AG 1999
The SAP_WAPI_* function modules implement the WfMC Interface 2 and are in the SWRC
function group.
SAP AG
BC610
7-20
SAP AG
n
BC610
7-21
The online documentation contains the complete list of IDs for transferring the OK codes.
SAP AG 1999
SP8D@F8uC$9 9
9 R Q I H G 9 EC 9 x
B y@9uqpR
x C I Ai
9 R Q I H G 9 C X X I Q
gaD8@E`w@9$SVA v
W 9 9A I X s r 9C U Wi RA QA 9 f 7
@u"t8@qpVhV@gSX
9 E Q 9 Q I H G 9 EC A 9 X W U
@FCedCcRba8D@`SVYVA T
9 R Q H G 9 EC BA 9 7
SIP8D@FD@86
5XQWLPH 'LVSOD\
X f 9C X i i 9 f A QY R 9CA 9 X W
wI FY I@SXbpuSi
X SuC 9$gVSpVcV$U (
i U
X X I QA f A QY UC
X C 7 i A C U I 9
$9ug&FFC$bC$@V"pQ
I idY @@fbS9u@XeVwX$$@I
i I 9 X f C QC X 9 I
B x f i R
U SSX pC 8y4Q
9 i A
9 E C Wi X W Qi C I W 7 Q C X 9 I
Fwqp&yS`YeVwX$$@I
SAP AG 1999
SAP AG
BC610
7-22
'HDGOLQH 0RQLWRULQJ
Latest start
Requested end
Latest end
SAP AG 1999
All deadlines are monitored using the background job SWWDHEX with job class A. The job calls
the report RSWWDHEX.
You can choose between deadline monitoring on an individual or on a periodic basis. Individual
monitoring is active by default.
With individual monitoring, the background job is rescheduled for the next deadline to be monitored
and is updated if a new deadline is entered for a WI that is sooner than any others. The background
job therefore, only runs if it is really needed.
Important: if the background job aborts for any reason, it must be rescheduled by starting the above
report.
This procedure is not economical for monitoring a large number of deadlines. In this case, you
should switch to periodic deadline monitoring (for example, every three minutes).
You can switch between the two monitoring types at any time via SWWA or using the report
RSWWDHIN.
SAP AG
BC610
7-23
SAP AG 1999
Inheritance only applies on creation of the subordinate work item. Subsequent changes to data in the
superordinate workflow are not passed on to existing dependent work items.
Every change in the data in the dependent work item is checked against the superordinate workflow.
It is not possible to postpone beyond the inherited deadlines.
SAP AG
BC610
7-24
l 0DQ\ GHDGOLQHV
6ZLWFK IURP VLQJOH FDVH EDVHG WR SHUPDQHQW
l 6HYHUDO LQVWDQFHV RI 6::'+(;
'HOHWH DOO LQVWDQFHV YLD MRE RYHUYLHZ
5HVFKHGXOH
l 1R LQVWDQFHV RI 6::'+(;
&KHFN VHOHFWLRQ IRU MRE RYHUYLHZ
5HVFKHGXOH
SAP AG 1999
When many deadlines are to be monitored, a conflict may arise with background job
SAP_REORG_JOBS. In this case, deadline monitoring should be suppressed while
SAP_REORG_JOBS is running.
When displaying background jobs in the job overview, remember that this is a cross-client display.
You should therefore check whether the background jobs displayed are actually scheduled in the
current client.
SAP AG
BC610
7-25
(UURU +DQGOLQJ
(UURU VLWXDWLRQ
:,
(UURU FRUUHFWLRQ
:,
(5525
),
),
(5525
&RUUHFWLRQ
(UURU 5HVWDUW
(UURU 5HVWDUW
SAP AG 1999
Error situation
1) The status of the work item changes to ERROR.
2) The error is propagated to the superordinate workflow.
3) The status of the superordinate workflow also changes to ERROR.
Error correction
1) The work item is corrected (for example, by correcting the work item container).
2) A "restart after error" is executed on the superordinate workflow.
3) The superordinate workflow propagates the restart to the work item.
4) A "restart after error" is executed on the work item implicitly.
Then the workflow is restarted from the top down and all work items belonging to the workflow are
also restarted. The restart must always be performed at the highest level workflow, and never from
the WI with the error.
Work items with errors should not be restarted with SM58 (prior to 4.0A), since steps already
executed may be executed a second time.
All correction actions on work items should be performed with great caution to avoid side effects.
SAP AG
BC610
7-26
7HPSRUDU\ HUURU
%DFNJURXQG
ZRUN LWHPV
:RUNIORZ
ZRUN LWHPV
'LDORJ
ZRUN LWHPV
1RQWHPSRUDU\
HUURU
67$57(' VWDWXV
UHVWDUW ZLWK
6::(55(
(5525 VWDWXV
VHQG DQ
HUURU PDLO WR
:) DGPLQLVWUDWRU
67$57(' VWDWXV
H[HFXWHG DJDLQ
E\ WKH XVHU
(5525 VWDWXV
:, UHPDLQV LQ
%XVLQHVV :RUNSODFH
RI WKH XVHU
SAP AG 1999
The status of background work items and workflow work items changes to ERROR after the nth
unsuccessful execution.
SAP AG
BC610
7-27
6::'+(;
7ULJJHU
'HDGOLQH GDWD
$FWLRQ
3UHGHILQHG DFWLRQ
WULJJHU YLD W5)&
-RE
3UHGHILQHG RU XVHU
GHILQHG DFWLRQ WULJJHU YLD
W5)&
,QWHUYDO
-RE FODVV $
VHOI VFKHGXOLQJ MRE
&RQILJXUDEOH
&RQILJXUDEOH RU
GHSHQGHQW RQ GHDGOLQHV
$XWKRUL]DWLRQ
1RUPDO DXWKRUL]DWLRQ
FKHFN
&KHFN
GHDFWLYDWHG
6FKHGXOLQJ
&XVWRPL]LQJ RU
DXWRFXVWRPL]LQJ
&XVWRPL]LQJ RU
DXWRFXVWRPL]LQJ
SAP AG 1999
Neither job allows real-time control since background jobs that are running are not interrupted.
SAP AG
BC610
7-28
SAP AG 1999
Initially, only temporary log entries are written to a buffer so that the commit logic of the caller is
not destroyed.
A log entry is written for all activities that can be triggered by a user (including) via the user
interface, if successful (FM SWW_WI_LOG_WRITE_SUCCESS).
A log entry is always written if an error occurs so that the call hierarchy can be traced to the point of
error (FM SWW_WI_LOG_WRITE_EXCEPTION).
The function module SWW_WI_LOG_FLUSH must be called before the database commit, so that
the temporary log entries can be written from the buffer to the database.
If work items are created via the WIM API (or, more generally, the work items are controlled via the
WIM API) and the commit is controlled by the creator (that is, the parameter DO_COMMIT was set
to SPACE), the creator must call the function module SWW_WI_LOG_FLUSH before commit
work. In all other cases, the call is performed by the workflow runtime system.
SAP AG
BC610
7-29
SAP AG 1999
All administrator FMs are checked with regard to authorization. They are used to process a WI in
exceptions.
Note: the necessary authorizations are contained in the authorization profile S_WF_WF_ADMIN.
When a waiting WI is initiated, its status is changed from WAITING to READY. This function can
be executed if deadline monitoring is not running due to overloading of the background queue or an
error in the background system.
The status of the WI is changed from SELECTED or STARTED to READY again. This function can
be used in order to make a WI that is blocked by an absentee visible for other recipients.
When restarting after an error, the status of the WI is changed from ERROR to STARTED, the
underlying method may be executed automatically.
The system administrator for WF can explicitly change the status of a WI to COMPLETED, but is
responsible for filling the container of the WI with the expected return parameters of the method
beforehand.
SAP AG
BC610
7-30
SAP AG 1999
tRFC is a Basis component (CALL FUNCTION ... IN BACKGROUND TASK). The FM called is
triggered after the next SAP Commit (see unit on events).
The tRFCs issued are logged until they are executed. If execution is successful, these entries are
deleted. If an error occurs during execution, this is also recorded in the log.
Only up to 3.1G: The log can be viewed via SM58. It is accessed with the name of the user who
called the tRFC. For the WF system, it is normally the user who is entered in the destination
WORKFLOW_LOCAL_<Clnt>.
There is another access possibility from the workflow development environment via "RFC monitor".
SAP AG
BC610
7-31
ID
Status
Task
SAP AG 1999
After the work item has been selected, the users can change and/or process the work item if they are
assigned to the underlying task via the task profile and the work item is not already reserved by
another recipient.
If the work item is not task-based (for example, wait steps, work queues, and so on), the user can
change and/or process it if it is not already reserved by another recipient.
SAP AG
BC610
7-32
SAP AG 1999
Access either via Utilities in the workflow development environment or directly via the transaction
SWUD.
All the tools and procedures that will be described in detail can be executed via this tool.
SAP AG
BC610
7-33
SAP AG 1999
The workflow log is always written and cannot be switched off. It follows the database commit and
writes to the database.
The workflow trace must be switched on explicitly. It is not dependent on the database commit and
writes to the file system of the application server.
The workflow trace is helpful with regard to problems in background work items or binding.
SAP AG
BC610
7-34
SAP AG 1999
The consistency check for Customizing must be carried out before you first work with SAP Business
Workflow.
Note: Linkages with errors are deactivated automatically and a mail is sent to the system
administrator for workflow.
SAP AG
BC610
7-35
SAP AG 1999
SAP AG
BC610
7-36
SAP AG 1999
A breakpoint should be set in the method implementation before the "test execution".
If the instance linkage table is filled correctly, the terminating event can also be triggered via the
workflow development environment for test purposes.
SAP AG
BC610
7-37
w
w
w
w
SAP AG 1999
SAP AG
BC610
7-38
SAP AG 1999
Reports RSWWWIDE and RSWWHIDE are only intended for internal use. The work items are
deleted from the database without further query or authorization check. They can be started through
the Administration menu in the workflow development environment.
The reports should always be called with the "display only" indicator set first to check them. The
actual deletion should then be performed using a background job.
Workflow work items automatically delete their dependent work items as well.
In a production system, the work items must be archived before they are deleted (transaction SARA).
The contents of the archive files can be deleted afterwards.
Archived work items can be read, but not reloaded for security reasons. The read program must be
written individually by the customer. An example program is supplied by SAP (RSWWARCR).
Other archiving objects can also archive work items using the archiving class WORKITEM. Work
items cannot, however, be deleted in this manner for reasons of data consistency.
Container linkage work items should be deleted using the report RSWWCIDE.
SAP AG
BC610
7-39
SAP AG 1999
RSWWARCR can be used as a template for user-defined programs. The user source code begins
after calling the function module SWW_WI_LIST_ARCHIVED_READ, which imports the whole
archive to internal tables. The tables contain all processes in a depth-first storage format.
RSWWARCP is a special case of a self-written read program. It searches for the associated process
for a particular application object and restructures the workflow log for this process (as far as
possible).
The archive data cannot be reloaded to the original WI tables, since the runtime system reuses the
WI numbers (i.e. data could be overwritten when reloaded).
SAP AG
BC610
7-40
5HSRUW 56:::,'(
3RVVLEOH LQ HYHU\ VWDWXV
'LUHFW VWDUW ZLWKRXW
DXWKRUL]DWLRQ FKHFN
([HFXWLRQ LQ GLDORJ RU
LQ EDFNJURXQG
/RJ GDWD QRW GHOHWHG
$UFKLYLQJ REMHFW
:25.,7(0
([HFXWLRQ LQ EDFNJURXQG
ODWHU
/RJ GDWD DOVR
DUFKLYHG DQG GHOHWHG
SAP AG 1999
WI data must never be deleted directly in tables, only using the function module
SWW_WI_DELETE.
If only the workflow log is to be deleted, report RSWWHIDE can be used for this.
SAP AG
BC610
7-41
SAP AG 1999
Packaging is particularly relevant if large quantities of data are imported into the system (for
example, with a batch input).
A check function module can be implemented instead of a "check step" in the workflow when the
workflow is started via an event, for example.
The WIM API can be used instead of an event if a workflow is started from a user-defined report that
is scheduled as a background job.
A destination can be specified for each event receiver in the type linkage table. Specific events can
then be received on a specific application server (to keep the other application servers free, for
example).
SAP AG
BC610
7-42
SAP AG 1999
General tasks should not be used if at all possible. If they are, a restrictive agent assignment should
be performed in the step definition.
The following lead to subsequent selection if they are adopted in the standard configuration:
Object
Group
_WI_GROUP_ID
Task text
To do by (date)
WI_LED
To do by (time)
n
_WI_OBJECT_ID
WI_LET
The buffering of organizational data can be controlled via the table T77S0.
Please refer to note 98407.
SAP AG
BC610
7-43
SAP AG 1999
SAP AG
BC610
7-44
SAP AG 1999
SAP AG
BC610
7-45
([HUFLVHV
8QLW :RUNIORZ 5XQWLPH 6\VWHP
7RSLF :RUN ,WHP 0DQDJHU $3,
You want to start a workflow not via an event, but directly via the API
of the work item manager (for example for performance reasons).
1-1
SAP AG
BC610
7-46
You want to display process-specific data for the end user before the
work item is executed.
2-1
Create a VFUHHQ in your function group that displays the following
data from the material master:
+ Material number
+ Last person to change the material
+ Material type
+ Lab/office of the material.
The user is also to be able to display the material stock at the click of a
button
Note: The screen entered must be defined as a "subscreen". In this
case, the OK code does not have to be declared explicitly as a field
in the screen layout.
Note: The material stock can be displayed via transaction MMBE.
2-1-2
SAP AG
BC610
7-47
3-1-2 Using the report RSWWWIDE, delete all the work items you created on
the first day of the workshop.
Note: First execute the report with the flag Display list only set.
Only if the list contains exclusively your work items, remove the
flag for the second run of the report and actually delete the work
items.
Important: Once you have deleted the work items, they are lost
irretrievably.
3-2
SAP AG
Optional extensions
BC610
7-48
6ROXWLRQV
8QLW :RUNIORZ 5XQWLPH 6\VWHP
7RSLF :RUN ,WHP 0DQDJHU $3,
1-1
REPORT Z00START .
INCLUDE <CNTN01>. " definition of container and object macros
PARAMETERS: OBJKEY LIKE MARA-MATNR DEFAULT 200-100.
DATA:TASK
LIKE SWWVPUBLIC-WI_RH_TASK VALUE WS96000011,
WI_ID
LIKE SWWVPUBLIC-WI_ID,
OBJECT
TYPE SWC_OBJECT.
DATA:AGENTS
LIKE SWHACTOR OCCURS 0 WITH
HEADER LINE,
WI_CONTAINER LIKE SWCONT
OCCURS 0 WITH HEADER
LINE.
* set the import parameter for flow Z00MSIPROC1
* first: create object reference (runtime handle)
SWC_CREATE_OBJECT OBJECT Z00MARA OBJKEY.
* second: write reference to work item container using parameter def
SWC_SET_ELEMENT WI_CONTAINER MaterialMaster OBJECT.
* third: convert references in container from runtime handle to
* persistent object reference
SWC_CONTAINER_TO_PERSISTENT WI_CONTAINER.
SAP AG
BC610
7-49
=
= NO_PRIO
= TASK
=
=
= WI_ID
=
=
=
= AGENTS " not needed here
=
=
=
=
=
=
= WI_CONTAINER
ID_NOT_CREATED
=1
READ_FAILED
=2
IMMEDIATE_START_NOT_POSSIBLE
=3
EXECUTION_FAILED
=4
INVALID_STATUS
=5
OTHERS
= 6.
IF SY-SUBRC NE 0.
" error message
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
" success message
MESSAGE ID WZ TYPE S NUMBER 703 WITH WI_ID.
ENDIF.
SAP AG
BC610
7-50
You want to display process-specific data for the end user even before the
work item is executed.
2-1
SAP AG
BC610
7-51
BC610
7-52
SAP AG
BC610
7-53
3-1-2 Using the report RSWWWIDE, delete all the work items you created on the
first day of the workshop.
Path (via SAP Easy Access):
Tools > ABAP Workbench > Development > ABAP Editor
SAP AG
BC610
7-54
INCLUDE RSWWINCL.
TABLES: Z00VHEACON. " view over SWWWIHEAD and _WF_INITIATOR
PARAMETERS: USER LIKE SY-UNAME DEFAULT SY-UNAME.
DATA:
* determine intitiator
INITIATOR-OTYPE = US.
INITIATOR-OBJID = USER.
* search list of candidate wis
IF USER NE SPACE.
" search for flows of this user
WRITE: / Number of flows started today by user , USER, :.
SELECT * FROM Z00VHEACON INTO TABLE CAND_WIS
WHERE WI_CD EQ SY-DATUM AND
WI_CHCKWI EQ SPACE
AND " top level flows only
VALUE
EQ INITIATOR.
ELSE. " search for flows independent of user
WRITE: / Number of flows started today by all users :.
SELECT * FROM Z00VHEACON INTO TABLE CAND_WIS
WHERE WI_CD EQ SY-DATUM AND
WI_CHCKWI EQ SPACE. " top level flows only
ENDIF.
DESCRIBE TABLE CAND_WIS LINES LINE_NO.
WRITE: LINE_NO.
SORT CAND_WIS BY WI_RH_TASK VALUE.
* display result list
LOOP AT CAND_WIS.
WRITE : / CAND_WIS-WI_ID, CAND_WIS-WI_RH_TASK, CAND_WIS-WI_STAT,
CAND_WIS-WI_CD, CAND_WIS-VALUE.
ENDLOOP.
SAP AG
BC610
7-55
3-2
Optional extensions
3-2-1 Create a report = :((./ that lists all unterminated workflow instances
started more than a week ago.
Solution:
Z00WEEKL
Path (via SAP Easy Access):
Tools > ABAP Workbench > Development > ABAP Editor
TASK
07.
LIKE SWWWIHEAD-WI_RH_TASK,
DAYS_AGO LIKE SWWWIHEAD-RETRY_CNT DEFAULT
DATA: CAND_WIS
HEADER LINE.
DATA: START_DATE
LIKE SY-DATUM.
SAP AG
BC610
7-56
$SSHQGL[
SAP AG 1999
SAP AG
BC610
8-1
$EEUHYLDWLRQ /LVW
$EEUHYLDWLRQ
API
BI
BOB
BOR
ECA
EM
FM
FG
FI
RH
LIS
LUW
POR
RFC
tRFC
WF
WI
WIM
WIS
/RQJ WH[W
Application Programming Interface
Background Work Item
Business Object Builder
Business Object Repository
Event Condition Action
Event Manager
Function Module
Function Group
Workflow Work Item
Runtime Handle
Logistics Information System
Logical Unit of Work
Persistent Object Reference
Remote Function Call
Transactional RFC
Workflow
Work Item (General)
Work Item Manager
Workflow Information System
)LUVW PHQWLRQ
Unit 3
Unit 6
Unit 2
Unit 2
Unit 5
Unit 3
Unit 2
Unit 6
Unit 6
Unit 2
Unit 7
Unit 5
Unit 2
Unit 5
Unit 5
Unit 1
Unit 6
Unit 3
Unit 7
SAP AG 1999
SAP AG
BC610
8-2
6$3 5HYLHZ
9ROXPH ,VVXH
06, %35
-XO\
Motor Sports International (MSI) has successfully implemented SAP R/3. SAP Business
Workflow helped in achieving the goals set by the company for optimizing business processes
(Business Processing Reengineering, or BPR).
The following study investigates the process used by MSI to achieve these objectives with the
help of the SAP Business Workflow tools. The study does not really outline the precise MSI
workflow implementation solution, but rather explains the business process in detail and
suggests courses of action.
This case study is not like a typical workflow process that would occur in your enterprise; it aims
to motivate you in this course and provide you with support for implementing workflow
successfully.
7KH SUREOHP DW 06, The existing system at MSI could not notify the designer of relevant
changes to material master records. This communication gap led to a delay in adjusting the
production line, which in turn resulted in large quantities of obsolete and unwanted warehouse
stock.
7KH VROXWLRQ DW 06, With the help of SAP Business Workflow, BPR helped MSI to make
considerable savings reducing warehouse stock.
,Q VKRUW 7KH ZRUNIORZ SURFHVV DW 06,
7ULJJHULQJ This business process always starts when a user changes the 2OG 0DWHULDO field
in a material master record. The result of the change triggers a workflow event (for example,
OldMaterialChanged), which then initiates one of two workflow processes.
The triggering event is actually initiated by a link to the SAP change documents. As soon as
the field is changed from a value * to your group number XX, the OldMaterialChanged
event is triggered.
*** Trigger
event ***
*Note: Enquiries at MSI have shown that this field is not used. Changes to its value
are therefore used to inform the designer of a relevant change to the material master.
'LVWLQJXLVKLQJ As mentioned above, the event triggers one of two workflows. The
definitions of the two workflows are identical, but different role resolutions are used. The
material type determines which workflow is started. The first workflow is started for material
type FERT for finished goods. All other material types start the second workflow.
0RQLWRULQJ: Not all changes to the 2OG 0DWHULDO field start the workflow process. For this case
study, you must ensure that the FKDQJHU of the material master is your logon ID.
SAP AG
BC610
*** Check
function module
***
8-3
*** Role
resolution ***
After the notification, the designer adjusts the production process to suit the change. To
inform the workflow system that this work has been completed, the designer changes the
%DVLF 0DWHULDO field of the relevant material master. This event is therefore a terminating
event of an asynchronous task.
*Note: Enquiries during the project indicate that nobody else uses the %DVLF 0DWHULDO
field. A change to the value represents a status change.
If the designer does not complete all activities within a specified time interval (for example,
five minutes), the superior of the designer must be informed of this delay.
As soon as the workflow system is notified that the designer has completed their work, it
sends a notification of completion stating that the process is completed and that the material
just changed can now return to production. The workflow determines who receives this
notification (note that in practice this would be implemented using role resolution). The first
workflow (for material type FERT) forwards the notification to the user who changed the
material at the start. The second workflow (all other material types) forwards the notification
to the designer's superior for review.
$QDO\]LQJ The management team at MSI expects a specific daily report on all newly started
workflows. As well as the total number, the list that is output also contains the workflow
initiator for each workflow instance.
*** Deadline
monitoring ***
*** Terminating
event ***
*** Notification
of completion ***
*** Workflow
runtime
environment ***
The system administrator wants to maintain the database with minimal effort so a monthly
archiving procedure must be planned. To support planning, the workflow administrator
requires a weekly report on the workflows that have been started but not yet terminated.
1DPH
0HDQLQJ
.H\
Material
ChangedBy
Plant
ExistenceCheck
$WWULEXWH
0HWKRG
Edit
Display
ChangeDocDisplay
SAP AG
BasicMaterialChang
ed
OldMaterialChanged
(YHQW
BC610
8-4