Starting Workflow
Starting Workflow
Management
Contents
1 Introduction .................................................................................................................... 3
2 Prerequisites .................................................................................................................. 3
3 Setting Up an Element Type in the Service Provider for Workflows ......................... 3
4 Implementing a Function Module for the Connection Parameter
FUNCTION_START_WORKFLOW ................................................................................. 3
4.1 Differences from the Standard Function Module .................................................................................... 4
4.2 Calling a Dialog for Entering Import Parameters .................................................................................... 4
4.3 Example Code ............................................................................................................................................. 4
!"
#%$&' ()$&
+*&$&,#%-./') $&*&
*&$01234) )$&56
78#%*&9;:<
34$&)
1 Introduction
The following tutorial is aimed at consultants who are implementing Records Management. Prerequisites are
a working knowledge of Records Management, SAP Business Workflow, and ABAP objects.
Customers often want user workflows to be triggered directly from a record. This tutorial shows you a user friendly way of meeting this requirement.
Take the following scenario: you want a record to start a workflow in which the record itself is sent to another
employee. The user who starts the workflow needs to see a dialog box in which he or she can enter the
employee who receives the record. The user also needs to enter a deadline by which the recipient of the
record must process it.
This can be realized as follows: the service provider for workflows provides the
connection parameter
FUNCTION_START_WORKFLOW. You can set this parameter to the name of a function module that starts
the workflow. We want to use this connection parameter and implement a function module that calls a dialog
box for entering the import parameters and starts the workflow.
2 Prerequisites
You have created a workflow template that enables the record to be forwarded to another user while
specifying a deadline. The workflow template has the following input parameters:
User: This parameter must be typed as a DDIC reference, such as T77UA- UNAME.
Deadline: This parameter must be typed as a DDIC reference, such as SWWWIDEADL -WI_LED.
Record: The technical name of the parameter must be RECORD, and the parameter must have the
object type RECORD.
You integrate a standard task into the workflow template. This task calls the RECORD.DISPLAY method.
Connection parameter WF_DEFINITION: ID of the workflow template that you want to exe cute (see
above)
The standard SAP system already includes the function module SRM_SP_WFL_START_WO
RKFLOW,
which you can enter for the connection parameter FUNCTION_START_WORKFLOW. The interface of your
own function module must match the interface of the standard function module. To guarantee this, copy the
standard function module SRM_SP_WFL_START_WORKFLOW to your own function module.
!"
#%$&' ()$&
+*&$&,#%-./') $&*&
*&$01234) )$&56
78#%*&9;:<
34$&)
>
Most parts of this example are taken from the standard function module
SRM_SP_WFL_START_WORKFLOW, but we have given them new comments to make them easier to
understand. The new parts have bee n given the comments Enhancement BEGIN and Enhancement
END.
This example has been implemented in WebAS 6.20, and is only guaranteed to be valid for this release.
@ACBDCEGFHCB I
ECO E H @MRH
H
VXWCYCYCYYCYCYYCYCJYCKMYLCYCNYCJYK YCYCYL YCYCJYCP YYCLCYCQ YYCYCYPCYCJMYCSYCTCYN YCYCYU YCYCYYCYCYCYYCYCYYCYCYYCYCYCYYCYCYYCYCYYCYCYCYYCYCYYCYCYYCYCYCY
VXWVMW R[ZC\C]^ _`CaCbCcdC]C\bfe
VXW F H EhF[Bi
BD EO
ECl
ECO
NCg L @
VXW
@D
E
LT @ TLCT BD Thj @DKMQXk EGgCFTBOEhKCFPH PCB J ElKMQ
VXW
El k
LT @ TLCT BD ThjL O JXSCTK R O
gC@[T D L F Y @SCD T[K O R
VXW
LT @ TLCT BD ThjmK F[B gJXA[E LCT DMHT BECKMOG
TXFk B gCT El L K @CL BO K Eg OML o
VXW
HLT EhTF[LCBi T Thj g J
TLMk
gCT KP
Nn
VXW
BD
EMA B DXH
ECl
l ACo D
VXW T[pMg L @
LT @ TCLT BD ThjLHT L FE J SCF TXk El gCT K K L FCF
VXW
LT @ TLCT BD ThjmDP OMBLCD Q RCTCR N[J SXECk l gCT @MKCROP iPCJCP S
VXW
T TSMk
gT p
VXW EOMoMLR T TLCT Thj
oO F EMq H EGFHCB[OhR
TK EXA B E ADCEXA
VXW
D LCEhT F[HCBL K L
LCT
g LT
g
VXW
H
VXW T[p Tg FBE K BOGR
HTCE L BCJMHE TLCL A L H E
VXW
VXWCYCYCYYCYCYLCYCTCYCN YCYYCTYCJ YYCYCYJCYCK YCYCgCYg YCYCL YYCTCYCS YYCYCYCYYCYCYYCYCYYCYCYCYYCYCYYCYCYYCYCYCYYCYCYYCYCYYCYCYCYYCYCYYCYCYYCYCYCY
ECl Y HCHMR esr[tMdC\`fusrcCvtXqfuwrtMdCbx
U
gT g
K
OCEOye
S
!"
#%$&' ()$&
+*&$&,#%-./') $&*&
*&$01234) )$&56
78#%*&9;:<
34$&)
CvCC CCCC[MCC
CCCCC
vC X
XCC vv C
CCM CCv
CCM C
CCMCCCCC
CCMCC
t CCXCMCCCCC CC
t CCCCCCCC
C v MC v CCX v CCC
CM
CM
CM
CM
CM
CM
CM
CM
C
CM
CM
CM
C M M tt XCCXCCCCCC u
C M M t XCCXCCvCCC u
x C M u M XCCXCC C
x CCCCCCCC u
x CCCC u
x CCCC u
4
x CCCC u
4
u
C C CCCC
4
tt CXCCC uu
m
CXCCC
4
CC
CCCC
CCCC
CCCC
CCCC
CCCC
h MCC
M
4&)
C [ CMCCCC MhhG
Ch C[MC CMCCCChCCM C
[CCC[h [
CC CCMCC C
CCCC CCMCCCCf
CM
CCMCC C 4CXCCM CC[MCCCC mCC
CC C C C CXCC CC CCCC C MCCCXCCCCCC
h[MfMXCCCMCCCCCfwCXCCCCXC
C C CCC[MCCCCCC X XMCCC[MCCCCCC
MXCCCMCCCCChCCCC
MC CXMCM CCf
MCCCM CCCCC MXCCCXCCCCCChCCCf
MC CXMCM CCf
MCCCM CCCCC MXCCCXCCCCCChCCCf
CC f
CCXCC
h[M MCf
X
CChCC
XCChCCC
XCChCCCCC
mMCfC
MCCCM
[MCMCMCXCCCCCf
MXCCCMCCCCChCCCC 4CMCf
MXCCCMCCCCChCCC
MCf
MCCC MXCCCMCCCCC X M CCC[MCCCCCC
CM
CG CCCCCCC
CMC CCf
CM MM[ C CCf
CCCf
z{|}~
~|~
|"~
%&()&~
+&&,%-|/)~&&
&01|4))&6~
8%&~;<~
4&)
C[CCGCMC[M
CCC[MCCC
CChCC
MCMM[CC
4f
MMC
4f
CC[h[
CCCCCCC
CCCCCC
MM[
CCC
CMCCMC
MC[h
CCCGMXM[
MC
f
C CCCCC MhhG
[CC C CC[MCCCCC X MCCCCf
C[M CMM[ CXCCCMC M CMCCC[CM C CCCf
M[y
hC CXCC XCCCChCCXCCC
MCG
CC CC[MCCC[CMhCCCf
CCM M[MXCCXCCMCMCC
CCM M[MXCCXCCMCCCMCCC
CCM M[MXCCXCCCC
CCM M[MXCCXCCCCCC
CM[y
CM[CC
M f
CCCXCCC CC
GXfwCCCCfM[MCCCC
XMCCChC CCC CCGCf
XMCCCh CC CXCCCCCCCf
XCCC MMCCC M CCCf
[h CCCCC[MCCCf
CCXf
CCCCC CCCCCCC CC CCCCCCCCCC
z{|}~
~|~
|"~
%&()&~
+&&,%-|/)~&&
&01|4))&6~
8%&~;<~
4&)
CCC Cfm CCC MCCCC[ CCCC MC CC CCCCCC C CC CC CC CCCCC
CCCCC
C CMCCCCCCC Mhh M CMCCCCCCC C mCCf
C XCCCC CC C CCC CC
CC CCCCCC CCC CC CC CCCCCC CCCCCC
GXfw MCCCCfs MCCCCf
hC C[MCC CCCCCC[MChCCXCCCCC
XCC[h
CXCCCCC[MCCCCCCM CC[MCCCCC
CC[h
CXCCCCC
MCCCCC
CXCCCCC
MCCCCf
XMC[ MCCCC MhhG
CC
CM
MCCCC MCCCCChCC[MCCh h
CXMC[f
CCXf
C CCCCCC[MC CCC
CCCXCCC CC
GXfwCCCCfM[MCCCC
XMCCChC CCC CCGCf
XMCCCh CC CXCCCCCCCf
XCCC MMCCC M CCCf
[h CCCCC[MCCCf
CCXf
CCCCCCCC CC XCCCC CCCCCCCCCCC
h[MfMCCCCXCfwCCCC[MCCfwCCCC
Ch ChC CCMM MCMCCM[y
[MCh[
CMCCCCCCC
CC[MCCCCCCC
CMCCCC
CC[MCCCC
CC
CC
CCC[MCCCCCC[MCC CCCCCCXCC
[CCh[
MCCCCXC
MCCCCM
CCCMCC
CCCCXCC
MM[
CCC
CCCCf
C CCCC[MCC [MGh C MCCCCM [Mhhh
z{|}~
~|~
|"~
%&()&~
+&&,%-|/)~&&
&01|4))&6~
8%&~;<~
4&)
[h CCCCC[MCCCf
CCXf
CCCCGC
Within a record, create an element for the element type created in step 3.
workflow import parameters appears.
2)
Enter the parameters. In the test, use your own user name.
3)
Open the Business Workplace (transaction SBWP) . You should have received a work item.
4)
z{|}~
~|~
|"~
%&()&~
+&&,%-|/)~&&
&01|4))&6~
8%&~;<~
4&)