<html><body>
<p>Hi John,<br>
<br>
This is how we have done the very similar thing but for a different business object.<br>
<br>
Parameters for the method.<br>
<img src="cid:1__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" width="731" height="258"><br>
<br>
Method Code<br>
<br>
begin_method selectapprovalagents changing container. <br>
constants: <br>
$yes like fist-oper value 'X', <br>
$no like fist-oper value '-'. <br>
data: <br>
o_task type swc_object, <br>
valid_selection like fist-oper value $no, <br>
title like rseu1-tit_text, <br>
task_id like swwwihead-wi_rh_task, <br>
selectmultiple like syst-input, <br>
selectedobject like rhobjects-object, <br>
selectedobjectlist like table of rhobjects-object <br>
with header line, <br>
namelist like table of rhobj_name with header line, <br>
objectlist like table of rhobjects-object with header line, <br>
profile like table of ust04-profile with header line. <br>
swc_get_element container 'SelectMultiple' selectmultiple. <br>
swc_get_element container 'Title' title. <br>
swc_get_element container 'Task_ID' task_id. <br>
swc_get_table container 'Profile' profile. <br>
<br>
while valid_selection eq $no. <br>
clear namelist. refresh namelist. <br>
clear objectlist. refresh objectlist. <br>
perform fill_namelist_objectlist tables namelist objectlist profile.<br>
swc_container new_container. <br>
swc_set_element new_container 'SelectMultiple' selectmultiple. <br>
swc_set_table new_container 'NameList' namelist. <br>
swc_set_table new_container 'ObjectList' objectlist. <br>
swc_create_object o_task 'WF_TASK' task_id. <br>
swc_call_method o_task 'Dispatch' new_container. <br>
if sy-subrc eq 8017. <br>
exit_cancelled. <br>
endif. <br>
if selectmultiple is initial. <br>
swc_get_element new_container 'SelectedObject' selectedobject.<br>
* PERFORM authority_check USING selectedobject <br>
* subrc. <br>
read table objectlist with key selectedobject. <br>
if sy-subrc ne 0. <br>
* IF subrc EQ $not_authorised. <br>
valid_selection = $no. <br>
message i016(zworkflowmessages). <br>
* MESSAGE i017(zworkflowmessages). <br>
* ELSEIF subrc EQ $invalid_agent_type. <br>
* MESSAGE i018(zworkflowmessages). <br>
else. <br>
valid_selection = $yes. <br>
endif. <br>
else. <br>
swc_get_table new_container 'SelectedObjectList' <br>
selectedobjectlist. <br>
loop at selectedobjectlist. <br>
* PERFORM authority_check USING selectedobjectlist <br>
* subrc. <br>
read table objectlist with key selectedobjectlist. <br>
if sy-subrc ne 0. <br>
* IF subrc EQ $not_authorised. <br>
valid_selection = $no. <br>
message i016(zworkflowmessages). <br>
* MESSAGE i017(zworkflowmessages). <br>
* ELSEIF subrc EQ $invalid_agent_type. <br>
* MESSAGE i018(zworkflowmessages). <br>
else. <br>
valid_selection = $yes. <br>
endif. <br>
endloop. <br>
endif. <br>
endwhile. <br>
swc_set_element container 'SelectedObject' selectedobject. <br>
swc_set_table container 'SelectedObjectList' selectedobjectlist. <br>
end_method. <br>
<br>
<br>
*&---------------------------------------------------------------------*<br>
*& Form FILL_NAMELIST_OBJECTLIST <br>
*&---------------------------------------------------------------------*<br>
form fill_namelist_objectlist tables p_namelist structure rhobj_name <br>
p_objectlist <br>
p_profile. <br>
tables: ust04, usr01. <br>
data: <br>
current_index like sy-tabix, <br>
short_text like objec-stext, <br>
i_bname like table of ust04-bname with header line. <br>
<br>
loop at p_profile. <br>
select bname from ust04 into (i_bname) <br>
where profile = p_profile. <br>
collect i_bname. <br>
endselect. <br>
endloop. <br>
read table i_bname with key sy-uname. <br>
if sy-subrc eq 0. delete i_bname index sy-tabix. endif. <br>
<br>
loop at i_bname. <br>
concatenate 'US' i_bname into p_objectlist. <br>
call function 'RH_CHECK_ORG_OBJECT_EXISTS' <br>
exporting <br>
act_object_ext = p_objectlist <br>
importing <br>
act_stext = short_text <br>
exceptions <br>
no_active_plvar = 1 <br>
no_org_object = 2 <br>
org_object_not_found = 3 <br>
others = 4. <br>
move p_objectlist to p_namelist-object. <br>
move short_text to p_namelist-stext. <br>
append p_objectlist. <br>
append p_namelist. <br>
endloop. <br>
endform. " FILL_NAMELIST_OBJECTLIST <br>
<br>
<br>
<br>
<br>
<br>
Binding from task to method<br>
<img src="cid:2__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" width="1024" height="768"><br>
<br>
Binding from workflow to task<br>
<img src="cid:3__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" width="787" height="690"> <br>
<br>
<br>
<br>
<br>
<b><font size="4" color="#483D8B"><br>
Regards</font></b><font size="4"><br>
Nat Govender<br>
Toyota South Africa<br>
IT - SAP Workflow Specialist<br>
Internal Ext. : 32645<br>
Direct Line : +27 031 910 2645<br>
Fax : 086 607 0414<br>
E-mail : </font><a href="mailto:ngovender4@toyota.co.za"><u><font size="4" color="#0000FF">ngovender4@toyota.co.za</font></u></a><font size="4"><br>
</font><font size="4" color="#FF00FF"><br>
If you tell the truth, you don't have to remember anything. </font><br>
<img width="16" height="16" src="cid:4__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt="Inactive hide details for kaukabr@yahoo.com">kaukabr@yahoo.com<br>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:5__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">kaukabr@yahoo.com</font></b><font size="2"> </font><br>
<font size="2">Sent by: sap-wug-bounces@mit.edu</font>
<p><font size="2">29-05-2009 05:25 AM</font>
<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center"><font size="2">Please respond to<br>
"SAP Workflow Users' Group" <sap-wug@mit.edu></font></div></td></tr>
</table>
</ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">"SAP Workflow Users' Group" <sap-wug@mit.edu></font></td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
</td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">Re: Document Park workflow</font></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:6__=CDBBFF56DFB856088f9e8a93df9@toyota.co.za" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<font size="4" face="Roman">Hi John,</font><br>
<font size="4" face="Roman">You need to create POPUP method task after your decision Task and create button in the task "Select Approvers", so when ever user click on Select Approvers Button A popup method pops up a menu of a role then he/she can select approvers from there. </font><br>
<font size="4" face="Roman">But yu need to create a correct method in your Business Object and a task of background method in the WF .</font><br>
<font size="4" face="Roman">I hope this helps the requirement of your client.</font><br>
<font size="4" face="Roman">Regards,</font><br>
<font size="4" face="Roman">Aziz.</font><br>
<br>
<hr width="100%" size="2" align="left"><b><font face="Tahoma">From:</font></b><font face="Tahoma"> Nash John <emailtonash@gmail.com></font><b><font face="Tahoma"><br>
To:</font></b><font face="Tahoma"> SAP Workflow Users' Group <sap-wug@mit.edu>; sap-wug-request@mit.edu</font><b><font face="Tahoma"><br>
Sent:</font></b><font face="Tahoma"> Thursday, May 28, 2009 9:11:31 PM</font><b><font face="Tahoma"><br>
Subject:</font></b><font face="Tahoma"> Document Park workflow</font><font size="4" face="Roman"><br>
<br>
Hi <br>
I’m working on FI document park workflow. We are having a custom workflow which gets triggered when ever a document is parked. The workflow is working fine and is correctly finding the agents. However there is a new change request that client does not want workflow to determine agent, instead client want to select approvers from a list and workfitem should go to that person. How can I achieve this(provideing list of approvers to user). is there a user exit or something available?<br>
<br>
Thanks<br>
<br>
Nash</font><tt>_______________________________________________<br>
SAP-WUG mailing list<br>
SAP-WUG@mit.edu<br>
</tt><tt><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</a></tt><tt><br>
</tt><br>
</body></html>