<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'>Probably
via the SAP WAPI functions&#8230;.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu] <b>On Behalf Of </b>Shoaib Mirza<br>
<b>Sent:</b> Wednesday, January 27, 2010 10:39 AM<br>
<b>To:</b> sap-wug@mit.edu<br>
<b>Subject:</b> RE: AW: AW: Getting current agent (name) from workflow work
item<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;
font-family:"Verdana","sans-serif"'>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; &quot;SAP Workflow <br>
&gt; Users' Group&quot; <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; &quot;SAP Workflow<br>
&gt; &gt; Users' Group&quot;<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&#8217;s no problem, if you have the &#8216;top&#8217; workitem, just select
swwwihead<br>
&gt; &gt; with &#8216;where&#8217;-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&#8230;<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&#8217;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<o:p></o:p></span></p>

<div class=MsoNormal align=center style='text-align:center'><span
style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana","sans-serif"'>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><o:p></o:p></span></p>

</div>

</div>

</body>

</html>