<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi Paul<BR>
&nbsp;<BR>
That is a great suggestion,&nbsp;I will put it to the customer.&nbsp; Previously they declined my proposal to write a report because&nbsp;they actually want the agent to appear on a bespoke transaction that already exists so they might not go for it.&nbsp; I will try again anyway.<BR>
&nbsp;<BR>
If I were to follow the approach below, which function modules would I use to get the first two steps, have you&nbsp;written this yourself already?<BR>
&nbsp;<BR>
Kind Regards<BR>
Sunni<BR>&nbsp;<BR>&gt; Subject: RE: AW: AW: Getting current agent (name) from workflow work item<BR>&gt; To: sap-wug@mit.edu<BR>&gt; From: Paul.Bakker@osr.treasury.qld.gov.au<BR>&gt; Date: Wed, 27 Jan 2010 09:34:58 +1000<BR>&gt; <BR>&gt; Sunni,<BR>&gt; <BR>&gt; Is there a better way...? Actually, I'm wondering what your requirements<BR>&gt; are.<BR>&gt; <BR>&gt; Is it for a report to determine 'who is currently holding up the<BR>&gt; workflows'?<BR>&gt; <BR>&gt; If so, you might want to consider approaching it from the bottom up:<BR>&gt; - find all dialog items currently in 'READY' status<BR>&gt; - find their parents (or grandparents)<BR>&gt; - filter the results to show only the workflow(s) you are interested in<BR>&gt; <BR>&gt; Just a suggestion<BR>&gt; <BR>&gt; cheers<BR>&gt; Paul.<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Shoaib Mirza <BR>&gt; &lt;shoaib_mirza@hot <BR>&gt; mail.com&gt; To <BR>&gt; Sent by: &lt;sap-wug@mit.edu&gt; <BR>&gt; sap-wug-bounces@m cc <BR>&gt; it.edu <BR>&gt; Subject <BR>&gt; RE: AW: AW: Getting current agent <BR>&gt; 27/01/2010 08:58 (name) from workflow work item <BR>&gt; AM <BR>&gt; <BR>&gt; <BR>&gt; Please respond to <BR>&gt; "SAP Workflow <BR>&gt; Users' Group" <BR>&gt; &lt;sap-wug@mit.edu&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Hi Paul<BR>&gt; <BR>&gt; Thanks for your reply, you're right and I've just realised that this<BR>&gt; workflow does have subworkflows!!<BR>&gt; <BR>&gt; ---------<BR>&gt; So Im thinking.<BR>&gt; <BR>&gt; I take the top workitem that I have,<BR>&gt; select from table swwwihead to find the child workitems of type F, (there<BR>&gt; seem to be just two subworkflows started here always)<BR>&gt; save these as the new 'top' work items in an internal table<BR>&gt; <BR>&gt; select from swwwihead again for the first of the new work items (the new<BR>&gt; top work item)<BR>&gt; take the last entry of the list output type 'W' to represent the last<BR>&gt; dialog work item<BR>&gt; save this workitem nr<BR>&gt; <BR>&gt; repeat the above step for the next 'top' work item of the parallel branch<BR>&gt; for the other subworkflow, and save this work item nr<BR>&gt; <BR>&gt; run the below function module 'SAP_WAPI_WORKITEM_RECIPIENTS' to get the<BR>&gt; user/s for each derived work item<BR>&gt; ------------------<BR>&gt; <BR>&gt; I would have to repeat this for potentially hundreds of line items just<BR>&gt; before an alv list is output.<BR>&gt; <BR>&gt; Is there a better way?<BR>&gt; <BR>&gt; Best Regards<BR>&gt; Sunni<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; &gt; Subject: RE: AW: AW: Getting current agent (name) from workflow work item<BR>&gt; &gt; To: sap-wug@mit.edu<BR>&gt; &gt; From: Paul.Bakker@osr.treasury.qld.gov.au<BR>&gt; &gt; Date: Wed, 27 Jan 2010 07:59:37 +1000<BR>&gt; &gt;<BR>&gt; &gt; Sunni,<BR>&gt; &gt;<BR>&gt; &gt; I think there's a problem with your concept of 'last workitem'.<BR>&gt; &gt;<BR>&gt; &gt; A workflow can, of course, have multiple dialog workitems active at once<BR>&gt; &gt; (e.g. in parallel branches).<BR>&gt; &gt; Which one would you then want the details of?<BR>&gt; &gt;<BR>&gt; &gt; cheers<BR>&gt; &gt; Paul<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Shoaib Mirza<BR>&gt; &gt; &lt;shoaib_mirza@hot<BR>&gt; &gt; mail.com&gt; To<BR>&gt; &gt; Sent by: &lt;sap-wug@mit.edu&gt;<BR>&gt; &gt; sap-wug-bounces@m cc<BR>&gt; &gt; it.edu<BR>&gt; &gt; Subject<BR>&gt; &gt; RE: AW: AW: Getting current agent<BR>&gt; &gt; 27/01/2010 07:37 (name) from workflow work item<BR>&gt; &gt; AM<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Please respond to<BR>&gt; &gt; "SAP Workflow<BR>&gt; &gt; Users' Group"<BR>&gt; &gt; &lt;sap-wug@mit.edu&gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Hi<BR>&gt; &gt;<BR>&gt; &gt; This doesn't seem to work, or are we missing something in the code.<BR>&gt; &gt; This gives the details of the top level workflow item. I can not see the<BR>&gt; &gt; latest work item being processed in the workflow.<BR>&gt; &gt;<BR>&gt; &gt; Any ideas how to get this information?<BR>&gt; &gt;<BR>&gt; &gt; Thanks<BR>&gt; &gt; Sunni<BR>&gt; &gt;<BR>&gt; &gt; From: Benjamin.Koeb@comlineag.de<BR>&gt; &gt; To: sap-wug@mit.edu<BR>&gt; &gt; Date: Tue, 26 Jan 2010 20:22:00 +0100<BR>&gt; &gt; Subject: AW: AW: Getting current agent (name) from workflow work item<BR>&gt; &gt;<BR>&gt; &gt; Hi Sunni,<BR>&gt; &gt;<BR>&gt; &gt; that’s no problem, if you have the ‘top’ workitem, just select swwwihead<BR>&gt; &gt; with ‘where’-clause: WI_CHCKWI = your_top_wi_id<BR>&gt; &gt; Try this select statement:<BR>&gt; &gt; SELECT SINGLE * FROM SWWWIHEAD into wa_SWWWIHEAD<BR>&gt; &gt; WHERE WI_CHCKWI = lv_top_wi_id<BR>&gt; &gt; AND wi_type = 'W'<BR>&gt; &gt; AND ( WI_STAT = 'READY' or WI_STAT = 'STARTED' ).<BR>&gt; &gt; You should get the actual workitem, with this information you can call<BR>&gt; the<BR>&gt; &gt; function module.<BR>&gt; &gt;<BR>&gt; &gt; Hope that helps…<BR>&gt; &gt;<BR>&gt; &gt; Benny<BR>&gt; &gt;<BR>&gt; &gt; Von: sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] Im Auftrag<BR>&gt; &gt; von Shoaib Mirza<BR>&gt; &gt; Gesendet: Dienstag, 26. Januar 2010 18:17<BR>&gt; &gt; An: sap-wug@mit.edu<BR>&gt; &gt; Betreff: RE: AW: Getting current agent (name) from workflow work item<BR>&gt; &gt;<BR>&gt; &gt; Hi<BR>&gt; &gt;<BR>&gt; &gt; Thanks for that, but my issue is that I don't have the work item id of<BR>&gt; the<BR>&gt; &gt; current task. I only have the 'top' work item id of the workflow. That<BR>&gt; &gt; does not have any agents.<BR>&gt; &gt;<BR>&gt; &gt; So I need to go down the workflow to the final workitem and get the<BR>&gt; agents<BR>&gt; &gt; from that. (Maybe then I can use the function below to get the agents)<BR>&gt; &gt;<BR>&gt; &gt; Any ideas how I can do that.<BR>&gt; &gt;<BR>&gt; &gt; Kind Regards<BR>&gt; &gt; Sunni<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; From: Benjamin.Koeb@comlineag.de<BR>&gt; &gt; To: sap-wug@mit.edu<BR>&gt; &gt; Date: Tue, 26 Jan 2010 17:51:09 +0100<BR>&gt; &gt; Subject: AW: Getting current agent (name) from workflow work item<BR>&gt; &gt; Hi Sunni,<BR>&gt; &gt;<BR>&gt; &gt; you can read the actual (Workitem status = started) agent from table<BR>&gt; &gt; SWWWIHEAD-WI_AAGENT with key = WI_ID. This works fine for workitems with<BR>&gt; &gt; status = started, if the status = ready the field wi_aagent is empty! For<BR>&gt; &gt; workitems with status ready, try to use function module<BR>&gt; &gt; SAP_WAPI_WORKITEM_RECIPIENTS:<BR>&gt; &gt;<BR>&gt; &gt; CALL FUNCTION 'SAP_WAPI_WORKITEM_RECIPIENTS'<BR>&gt; &gt; EXPORTING<BR>&gt; &gt; workitem_id = lv_wi_id<BR>&gt; &gt; tables<BR>&gt; &gt; recipients = it_recipients.<BR>&gt; &gt;<BR>&gt; &gt; That’s my way, maybe there are better ones?<BR>&gt; &gt;<BR>&gt; &gt; Regards,<BR>&gt; &gt;<BR>&gt; &gt; Benny<BR>&gt; &gt;<BR>&gt; &gt; Von: sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] Im Auftrag<BR>&gt; &gt; von Shoaib Mirza<BR>&gt; &gt; Gesendet: Dienstag, 26. Januar 2010 17:37<BR>&gt; &gt; An: sap-wug@mit.edu<BR>&gt; &gt; Betreff: Getting current agent (name) from workflow work item<BR>&gt; &gt;<BR>&gt; &gt; Hi<BR>&gt; &gt;<BR>&gt; &gt; Please can you let me know how I would go about getting the current agent<BR>&gt; &gt; of a workflow from the workitem id of the workflow. I looked for a wapi<BR>&gt; &gt; but could not find one suitable.<BR>&gt; &gt;<BR>&gt; &gt; Kindest Regards<BR>&gt; &gt; Sunni<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Do you have a story that started on Hotmail? Tell us now<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Got a cool Hotmail story? Tell us now<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Not got a Hotmail account? Sign-up now - Free<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; SAP-WUG mailing list<BR>&gt; &gt; SAP-WUG@mit.edu<BR>&gt; &gt; http://mailman.mit.edu/mailman/listinfo/sap-wug<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ******************************************************************************************************************************************************<BR>&gt; <BR>&gt; &gt;<BR>&gt; &gt; Only an individual or entity who is intended to be a recipient of this<BR>&gt; e-mail may access or use the information contained in this e-mail or any of<BR>&gt; its attachments. Opinions contained in this e-mail or any of its<BR>&gt; attachments do not necessarily reflect the opinions of Queensland Treasury.<BR>&gt; &gt;<BR>&gt; &gt; The contents of this e-mail and any attachments are confidential and may<BR>&gt; be legally privileged and the subject of copyright. If you have received<BR>&gt; this e-mail in error, please notify Queensland Treasury immediately and<BR>&gt; erase all copies of the e-mail and the attachments. Queensland Treasury<BR>&gt; uses virus scanning software. However, it is not liable for viruses present<BR>&gt; in this e-mail or in any attachment.<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; ******************************************************************************************************************************************************<BR>&gt; <BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; SAP-WUG mailing list<BR>&gt; &gt; SAP-WUG@mit.edu<BR>&gt; &gt; http://mailman.mit.edu/mailman/listinfo/sap-wug<BR>&gt; <BR>&gt; Got a cool Hotmail story? Tell us now<BR>&gt; _______________________________________________<BR>&gt; SAP-WUG mailing list<BR>&gt; SAP-WUG@mit.edu<BR>&gt; http://mailman.mit.edu/mailman/listinfo/sap-wug<BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; SAP-WUG mailing list<BR>&gt; SAP-WUG@mit.edu<BR>&gt; http://mailman.mit.edu/mailman/listinfo/sap-wug<BR>                                               <br /><hr />We want to hear all your funny, exciting and crazy Hotmail stories. <a href='http://clk.atdmt.com/UKM/go/195013117/direct/01/' target='_new'>Tell us now</a></body>
</html>