Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

SAP Records

Management

Starting a Workflow in a Record by


Entering Import Parameters
May 4, 2004

Starting a Workflow in a Record by Entering Import Parameters

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

5 Testing the Scenario ...................................................................................................... 9


  
 !"
#%$&' ()$&
+*&$&,#%-./') $&*&
*&$01234) )$&56
78#%*&9;:<


34$&)

Starting a Workflow in a Record by Entering Import Parameters

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.

3 Setting Up an Element Type in the Service Provider for


Workflows
Create a new element type in the service provider for workflows. Make the following entries on the
Connection Parameter tab page:

Connection parameter FUNCTION_START_WORKFLOW: name of a new function module for starting


the workflow, to be implemented by you (see below)

Connection parameter WF_DEFINITION: ID of the workflow template that you want to exe cute (see
above)

Connection parameters RFC_DESTINATION and RFC_DESTINATION_CALLBACK: NONE

Implementing a Function Module for the Connection


Parameter FUNCTION_START_WORKFLOW

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$&)

>

Starting a Workflow in a Record by Entering Import Parameters

4.1 Differences from the Standard Function Module


We do not use the standard function module since it triggers a dialog box for entering import parameters that
is not very user-friendly.
You use the standard function module on ly if the input parameters set by the user have complex data types
(for example, business object types, structures, or tables) and the workflow is started typically by an
administrator. If the input parameters of the workflow are scalar parameters that are
typed as ABAP
Dictionary references, then we recommend that you implement a separate function module. You can adopt
some parts of the standard function module when you do this.
For more information about the standard function module, see the
Records Manag ement documentation
under Customizing Service Provider for SAP Business Workflows.

4.2 Calling a Dialog for Entering Import Parameters


To call the dialog box for entering the import parameters, use the POPUP_GET_VALUES function module.
When you specify DDIC references, this function module provides you with a screen that includes F1 help
and F4 help.
In the FIELDS parameter of the POPUP_GET_VALUES function module, you have to specify the DDIC
references of the fields you want to display. Before you do this, use the definition of the workflow container to
see which import parameters have a DDIC reference. Extract the DDIC information ( tabname, fieldname)
and send it to the POPUP_GET_VALUES function module. The function module now generates the input
dialog box with the appropriate fields, field labels, F1 help, and F4 help (if they exist). However, the input is
not tested.
In our case, User Name (for work item recipients) and Latest End are displayed as input fields.

4.3 Example Code


The following is an example of the code for a function module that starts the workflow.
Notes:

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$&)

Starting a Workflow in a Record by Entering Import Parameters

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

CCCCC C CCCCCC CCCCCCCCC


CCM v CCv
tt CM[MCC v Mv v CC
CCM C
CM[M CC
CCMCCCCC tt CM[MCC v MCCCCCf
CCMCC
CM[MC[MCCf
CCMCCCC t CM[MC[MCCCCf
CCCCC CC t CCC t CCCCC CCCCCCC
h[MfwCCCC[MCC u CCCC u CCCCCMCf
Ch ChC CCMMMC[MMChCf
[MCh[
CMCCCCCCC
CCXCCCCCCC
CMCCCC
CCXCCCC
CC
CCC
[CCh[
CCCMCC
CCCCXCC
CCCCCC[MC
CCCCCCXCC
MM[
CCC
CCCCf
 C  C CCC[MCC [MGhG
[h  CCCCC[MCCCf
CCXf
 C  CCCCCC[MC CCC
CCCXCCC uCt C
G
wCCCv C
[MCCCC
t MXf
C CCCv  x GCXh
t MCCCCCCh
h C
CXCCCCCCCf
XCCC t MCCC M CCCf
[h CCCCC[MCCCf
CCXf
CCCCC CC C C C CXCC CCCCCCC
Cy t vC XCCCMCCCCC
MC tt CC x C u u
CC
MC t CCvCC u  CCCCCC C CCC CCCCCC
vC X
XCCCv MCCCCC
MC C CCC t
CC[MCC C
MC CC M u CX [ MCMC v C u
CCMCC C
MC Ct CCC
CCMCCCC
MC CCCCC
CywCG  MCCCM fu
CCCCC
CXC CCCC vv CCGCCCCC uu
CCCCC
CXC CCCC CCGCCCCC
CC C CXCCCCXC
hvC [M vC XCCCMCCCCCf
XCCCXCCCCCC CCC[MCCCCCC

h MCC

M

 MC t CCCC CCCCCC C v C MC C CCCC CCC  MC


h[MsvCMC v CC u CCXCCC C u CCXCCCCC
CMC C CCCCCMChCC[MCCCCMCh CC m MCf h
z{|}~
 ~ |~
  |"~
%&()&~
+&&,%-|/)~ &&
&01|4) )&6~
 8%&~;<~

4&)

Starting a Workflow in a Record by Entering Import Parameters

 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

CCX MXMCXCCCCCCf C CCCC C CCCC C XCCCMCCCCCM


CC[M
CCCCC CCC CCCCCC MC CCC CCCCC CCC CCCCC
h[MfwCCCCXCCCCCsCXCCCCCMCCCCC
Ch MC CCCCCMChCCCCC[MCCMCCCXCCCCCC
[MCh[
CCC
MCCC[MCCCCCC
CCCMCCC
y
CCCMCCC
CCC
CCCCCXCCC
CCC
CCCCCC[MCCC
CCC
CCCCCXCCCC
y
CCC CCC[MCCC
CCC
C[M CCC[MCCCCC
CCC
CCCCCC[MCCCCC
CCC
[CCh[
CCC
CCC
MCCCC
XCCCCC
CMCCCCC[MCCCCC CMCCCCMCCCCC
 C  CCCCCC[MC CCC
CCCXCCC CC
GXfwCCCCfM[MCCCC
XMCCChC CCC CCGCf
XMCCCh CC CXCCCCCCCf
XCCC MMCCC M CCCf
[h CCCCC[MCCCf
CCXf
CCCCC CCCCCCC
CywCC[MCCCM
CC[MCCCXCC
CXCCC CXC

CG CCCCCCC
CMC CCf
CM MM[ C CCf
CCCf

z{|}~
 ~ |~
  |"~
%&()&~
+&&,%-|/)~ &&
&01|4) )&6~
 8%&~;<~

4&)

Starting a Workflow in a Record by Entering Import Parameters

CC[MCCCCC CMC CXM C CC M CXM[MCMCCCCf


h[Mfw MCCCCCfw XCCCCf
 C C CM CCCCCCC C CCCC CCCCCC C CCCC
Ch MC CCCCCMChCCC[MCCCCC
[MCh[
C[MCCCCCCM
CCMCCC
C[MCCCCMCCCCCCX CCM CC
[CCh[
C[MCCCCC
XCCCCC
C[MCCCC
XCCCCf

MM C XCCCC Xhhh


GX MCCf
hC C[MCC MCCCChCCXCCCCCC M C CCC
CC[h
CCMCC MCCf
[   CMCC MhGh
CMCCC[CMGCCCC
MCCGCCCCf
CMCCC[CMGCCCCCC CMCCGCCCCCC
MCC C MCCCM M CMCCC[MCf
MCC MCCCC X CXCCCCCf
C M[f
MCCCC MCCCCCGCCMCCG G
CC[MMf
 M C CCC
Ch ChC mCCC[CM[CChC
[MCh[

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&)

Starting a Workflow in a Record by Entering Import Parameters

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

mXCCXMCCMCCCCCsC C CCCC MC CCC CC C CC CC


 C [ MCCCChCC CCCCCC MCXMCCC[MCCCC CCC
 MCCCChCCC CCCCCC XCC[MXCMCC CCC M
MCCCChCC CCCCCC MCXMC[MCCCC CCCf
M f CCCCCC CCCC  CC C CCCC
CCCMCC Cf
GMsCCCfMXCCCCf
XMCCChC CCC CChCC
XMCCCh CC CMCCCCCCC
XCCC XMCCC X CCCf
[h CCCMCMCCCCCf
CCXf

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&)

Starting a Workflow in a Record by Entering Import Parameters

[h CCCCC[MCCCf
CCXf
CCCCGC

5 Testing the Scenario


1)

Within a record, create an element for the element type created in step 3.
workflow import parameters appears.

The dialog box for entering

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)

Double-click the work item. The record should now be displayed.

z{|}~
 ~ |~
  |"~
%&()&~
+&&,%-|/)~ &&
&01|4) )&6~
 8%&~;<~

4&)

You might also like