on 07-18-2016 2:35 PM
Hello Experts,
I have a requirement where I have to determine &_WF_INITIATOR& at runtime. Is it possible to set the &_WF_INITIATOR& at the beginning ?
This may sound a bit odd. You may ask me "Why on earth you're changing the &_WF_INITIATOR& ?"
The requirement goes like this. If the Initiator of the workflow has left the company, a replacement initiator would be maintained in some table. This replacement would behave as the new initiator.
Regards,
Kiran
My not simply use substitution? no need to change the workflow, and all workitems which belong to the user who left are immediately shown in the new user's business workplace. any new workitem which will be crated for the user who left will also be seen.
https://help.sap.com/saphelp_nw70ehp2/helpdata/en/8d/25f558454311d189430000e829fbbd/content.htm
You can set the substitution for other users in transaction RMPS_SET_SUBSTITUTE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello All,
I solved this by creating a new task. This will fetch the workflow initiator name stored in some Z-Table.
I am filling a container similar to Initiator and using this wherever the agent is Initiator.
Rob Dielemans and Ronen Weisz, thanks for sharing the info on using substitutes. I would definitely try that in future.
Thanks,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Usually you just use substitution when someone has left the company. In some cases where you need to redirect workitems you can also use SWIA to use an administrator forward (Shift+F12) to make sure that work continues.
You can use transaction SWI2_ADM1 to find out if workitems exist without an agent.
Kind regards, Rob Dielemans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
First of all how is the initiator used in your workflow design. Will it get a workitem at one point or only messages.
If user interaction is needed (dialog workitems like user decision) then setting up a substitute will fix all of your problems.
If this user is used in background processing on master data where this user is used as the changed by then you have a problem, but you can solve it by either changing the workflow container manuall, by cancelling the workflow in its entirety and executing the remaining steps manually outside workflow, or if no databases have been updated yet simply retrigger the workflow with the correct initiator.
If this user is only used in the end for a confirmation email. Then you can change the email id of the user that has left the company to someone who handles their remaining work.
Kind regards, Rob Dielemans
Hi Rob,
Thanks for the explanation. I have interactions like user decisions. That will solve the problem.
I am sending a reminder mails based on the Initiator. I am getting the initiator's mail ID.
Now, in this case if the substitute is maintained, will the mail reach to substitute?
Thanks,
Kiran
To determine &_WF_INITIATOR& use below logic
Call FM SAP_WAPI_WORKITEMS_TO_OBJECT for particular BO & Object Key
Then find your relative Workflow Id and do below
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
EXPORTING
WORKITEM_ID = L_WI_ID
TABLES
SIMPLE_CONTAINER = LT_CONTAINER
EXCEPTIONS
OTHERS = 1.
READ TABLE LT_CONTAINER WITH KEY ELEMENT = '_WI_OBJECT_ID'.
IF SY-SUBRC EQ 0.
MOVE LT_CONTAINER-VALUE TO LS_POR.
SELECT SINGLE * FROM SWXFORMABS
WHERE FORMNUMBER = LS_POR-OBJKEY.
IF SY-SUBRC EQ 0.
SWXFORMABS-PROCSTATE = L_INPUT.
IF SY-SUBRC EQ 0.
EXPORT L_PREPROCESSED TO MEMORY ID 'PREPROC'.
L_OKAY = 'X'.
ENDIF.
ENDIF.
ENDIF
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.