<br><font size=2 face="sans-serif">Good to hear from the experts! Accept
my apology for misinterpreting your request.</font>
<br>
<br><font size=2 face="sans-serif">The redirect that Mark was interested
in happens after the login user has been determined to have valid work
items.</font>
<br><font size=2 face="sans-serif">At that point, we call transaction SO01.
Sample code shown below.</font>
<br>
<br><font size=1 face="Arial Monospaced for SAP">DATA: wi_tab
LIKE swwwlhead OCCURS 0 WITH HEADER LINE.</font>
<br><font size=1 face="Arial Monospaced for SAP">DATA: wl_user_tab LIKE
swhactor OCCURS 0 WITH HEADER LINE. </font>
<br><font size=1 face="Arial Monospaced for SAP">DATA: lcount
TYPE i.</font>
<br><font size=1 face="Arial Monospaced for SAP">DATA: wl_subrc
TYPE sysubrc. </font>
<br>
<br><font size=1 face="Arial Monospaced for SAP"> CALL FUNCTION
'SWR_WL_CREATE' "get user's worklist</font>
<br><font size=1 face="Arial Monospaced for SAP"> EXPORTING
</font>
<br><font size=1 face="Arial Monospaced for SAP">
language = sy-langu
"system language </font>
<br><font size=1 face="Arial Monospaced for SAP">
user =
sy-uname "user logged on </font>
<br><font size=1 face="Arial Monospaced for SAP"> TABLES
</font>
<br><font size=1 face="Arial Monospaced for SAP">
worklist = wi_tab
</font>
<br><font size=1 face="Arial Monospaced for SAP"> EXCEPTIONS
</font>
<br><font size=1 face="Arial Monospaced for SAP">
orginfo_not_found = 1
</font>
<br><font size=1 face="Arial Monospaced for SAP">
OTHERS =
2
</font>
<br><font size=1 face="Arial Monospaced for SAP">
.
</font>
<br><font size=1 face="Arial Monospaced for SAP"> LOOP AT
wi_tab.
</font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* check for
runaway WIs - general tasks w/ no agent assigned</font>
<br><font size=1 face="Arial Monospaced for SAP"> CALL
FUNCTION 'RH_WI_AGENTS_GET' "get agents for work items
</font>
<br><font size=1 face="Arial Monospaced for SAP">
EXPORTING
</font>
<br><font size=1 face="Arial Monospaced for SAP">
act_wi_id
= wi_tab-wi_id </font>
<br><font size=1 face="Arial Monospaced for SAP">
TABLES
</font>
<br><font size=1 face="Arial Monospaced for SAP">
wi_agent_list = wl_user_tab
</font>
<br><font size=1 face="Arial Monospaced for SAP">
EXCEPTIONS
</font>
<br><font size=1 face="Arial Monospaced for SAP">
no_active_plvar = 1
</font>
<br><font size=1 face="Arial Monospaced for SAP">
no_agent_found = 2
</font>
<br><font size=1 face="Arial Monospaced for SAP">
general_task = 3
</font>
<br><font size=1 face="Arial Monospaced for SAP">
background_task = 4
</font>
<br><font size=1 face="Arial Monospaced for SAP">
OTHERS
= 5. </font>
<br>
<br><font size=1 face="Arial Monospaced for SAP"> IF
sy-subrc = 3. "no specific agent(s) found </font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* runaway WIs
need to be reserved by someone </font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* Reserve WI
to static user ID until alternative found </font>
<br><font size=1 face="Arial Monospaced for SAP">
DATA: wl_agent TYPE sy-uname VALUE 'JOHNDOE'. </font>
<br><font size=1 face="Arial Monospaced for SAP">
CALL FUNCTION 'SAP_WAPI_RESERVE_WORKITEM' </font>
<br><font size=1 face="Arial Monospaced for SAP">
EXPORTING
</font>
<br><font size=1 face="Arial Monospaced for SAP">
workitem_id = wi_tab-wi_id
</font>
<br><font size=1 face="Arial Monospaced for SAP">
actual_agent = wl_agent
</font>
<br><font size=1 face="Arial Monospaced for SAP">
do_commit = 'X'
</font>
<br><font size=1 face="Arial Monospaced for SAP">
IMPORTING
</font>
<br><font size=1 face="Arial Monospaced for SAP">
return_code = wl_subrc
</font>
<br><font size=1 face="Arial Monospaced for SAP">
.
</font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* Remove the
General Task WI from logon user's list</font>
<br><font size=1 face="Arial Monospaced for SAP">
DELETE wi_tab INDEX sy-tabix.
</font>
<br>
<br><font size=1 color=blue face="Arial Monospaced for SAP">***** NOTIFY
WF ADMINISTRATORS OF WI *****
</font>
<br><font size=1 face="Arial Monospaced for SAP">
IF wl_subrc = 0. "WI was successfully reserved
</font>
<br><font size=1 face="Arial Monospaced for SAP">
<<<insert some kind of e-mail communicaton process here>>></font>
<br><font size=1 face="Arial Monospaced for SAP">
ENDIF.
</font>
<br><font size=1 face="Arial Monospaced for SAP"> ENDIF.
</font>
<br><font size=1 face="Arial Monospaced for SAP"> ENDLOOP.
</font>
<br>
<br><font size=1 face="Arial Monospaced for SAP"> DESCRIBE
TABLE wi_tab LINES lcount.</font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* Only
process transaction when workitems are present</font>
<br><font size=1 face="Arial Monospaced for SAP"> IF lcount
> 0.</font>
<br><font size=1 color=blue face="Arial Monospaced for SAP">* shows
SAP Office Inbox</font>
<br><font size=1 face="Arial Monospaced for SAP"> CALL
TRANSACTION 'SO01'.</font>
<br><font size=1 face="Arial Monospaced for SAP"> ENDIF.</font>
<br>
<br>
<br>
<br><font size=1 face="sans-serif"><b>Michael Pokraka <wug.replies@workflowconnections.com></b>
</font>
<p><font size=1 face="sans-serif">05/10/2005 08:44 AM</font>
<p>
<br>
<br><font size=2><tt>Indeed, it's the quiet ones that you've got to watch
out for!<br>
<br>
Just thought I might throw in another variation of the same theme: The
same<br>
check on RH_WI_AGENTS_GET can also be done if the client happens to run
a<br>
custom RSWUWFML. Neither method is foolproof as they rely on nobody reserving<br>
the item in between runs/logons, but having used the RSWUWFML it seemed
to<br>
catch most of them. <br>
<br>
Cheers<br>
Mike<br>
<br>
--- Mark Pyc <mark.pyc@gmail.com> wrote:<br>
G'day Tedde,<br>
This is a new one on me! How many more tricks do you have up your sleeve?<br>
The usage I liked was where in log-on exit you check if a user has<br>
newWorkitems and if so redirect them to the business workplace as theirstart<br>
transaction. This is much nicer than setting the businessworkplace as the<br>
standard log in transaction statically as it only applies to those who
have<br>
work to do.<br>
Same exit I presume? How do you set the business workplace as the first<br>
screen?<br>
Have fun,Mark</tt></font>
<br><font size=2><tt><br>
On 5/9/05, Tedde Taege <ttaege@nebraska.edu> wrote:</tt></font>
<br>
<br><font size=2><tt>At the urging of workflow gurus Mark P. & Mike
P., I am posting an idea that was included in my presentation at ASUG.
</tt></font>
<br>
<br><font size=2><tt>I have been burnt by general tasks that get sent into
everyone's workflow> inbox. Here is a way that lowers the exposure
from a runaway general task by checking for general tasks as each user
logs into the system. </tt></font>
<br>
<br><font size=2><tt>In user exit EXIT_SAPLSUSF_001 - ZXUSRU01 (function
group XUSR) which executes at user login: </tt></font>
<br><font size=2><tt>• Retrieve work list for
user (function SWR_WL_CREATE) </tt></font>
<br><font size=2><tt>• Check agents assigned
for work items (function RH_WI_AGENTS_GET) </tt></font>
<br><font size=2><tt>• Reserve general task
work items to a specific ID (i.e. workflow> administrator) (function
SAP_WAPI_RESERVE_WORKITEM) </tt></font>
<br><font size=2><tt>• Upon a successful reservation,
notify workflow administration about the work item </tt></font>
<br>
<br><font size=2><tt>Use caution with this exit because if you mess up
here, then your users might not able to log into the system.</tt></font>
<br><font size=2><tt><br>
</tt></font>
<br>