<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi&nbsp;<BR>
&nbsp;<BR>
Thanks for that, but my&nbsp;issue is that I don't have the work item id of the current task.&nbsp; I only have the&nbsp;'top' work item id of the&nbsp;workflow.&nbsp; That does not have any agents.<BR>
&nbsp;<BR>
So I need&nbsp;to go down the workflow to the final workitem&nbsp;and get the agents from that.&nbsp; (Maybe then I can use the function below to get the agents)<BR>
&nbsp;<BR>
Any ideas how I can do that.<BR>
&nbsp;<BR>
Kind Regards<BR>
Sunni<BR>&nbsp;<BR>
<HR id=stopSpelling>
From: Benjamin.Koeb@comlineag.de<BR>To: sap-wug@mit.edu<BR>Date: Tue, 26 Jan 2010 17:51:09 +0100<BR>Subject: AW: Getting current agent (name) from workflow work item<BR><BR>
<STYLE>
.ExternalClass .ecxshape
{;}
</STYLE>

<STYLE>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxE-MailFormatvorlage18
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;}
.ExternalClass div.ecxSection1
{page:Section1;}
</STYLE>

<DIV class=ecxSection1>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Hi Sunni,</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>you can read the actual (Workitem status = started) agent from table SWWWIHEAD-WI_AAGENT with key = WI_ID. This works fine for workitems with status = started, if the status = ready the field wi_aagent is empty! For workitems with status ready, try to use function module SAP_WAPI_WORKITEM_RECIPIENTS:</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>CALL FUNCTION 'SAP_WAPI_WORKITEM_RECIPIENTS'</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXPORTING</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; workitem_id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = lv_wi_id</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tables</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; recipients&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = it_recipients.</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>That’s my way, maybe there are better ones?</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Regards,</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Benny</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN></P>
<DIV>
<DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=ecxMsoNormal><B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt">Von:</SPAN></B><SPAN style="FONT-FAMILY: 'Tahoma','sans-serif'; FONT-SIZE: 10pt"> sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu] <B>Im Auftrag von </B>Shoaib Mirza<BR><B>Gesendet:</B> Dienstag, 26. Januar 2010 17:37<BR><B>An:</B> sap-wug@mit.edu<BR><B>Betreff:</B> Getting current agent (name) from workflow work item</SPAN></P></DIV></DIV>
<P class=ecxMsoNormal>&nbsp;</P>
<P style="MARGIN-BOTTOM: 12pt" class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">Hi<BR>&nbsp;<BR>Please can you&nbsp;let me&nbsp;know how I would go about getting the current agent of a workflow from the workitem id of the workflow.&nbsp; I looked for a wapi but could not find one suitable.<BR>&nbsp;<BR>Kindest Regards<BR>Sunni</SPAN></P>
<DIV style="TEXT-ALIGN: center" class=ecxMsoNormal align=center><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">
<HR align=center SIZE=2 width="100%">
</SPAN></DIV>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">Do you have a story that started on Hotmail? <A href="http://clk.atdmt.com/UKM/go/195013117/direct/01/">Tell us now</A></SPAN></P></DIV>                                               <br /><hr />Got a cool Hotmail story? <a href='http://clk.atdmt.com/UKM/go/195013117/direct/01/' target='_new'>Tell us now</a></body>
</html>