<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
&nbsp;<BR>
Hi<BR>
&nbsp;<BR>
This doesn't seem to work, or are we missing something in the code.<BR>
This gives the details of the top level workflow item.&nbsp;&nbsp;I can not see the&nbsp;latest work item&nbsp;being processed in the workflow.<BR>
&nbsp;<BR>
Any ideas how to get this information?<BR>
&nbsp;<BR>
Thanks<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 20:22:00 +0100<BR>Subject: AW: 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 p.ecxecxmsonormal, .ExternalClass li.ecxecxmsonormal, .ExternalClass div.ecxecxmsonormal
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxecxmsochpdefault, .ExternalClass li.ecxecxmsochpdefault, .ExternalClass div.ecxecxmsochpdefault
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink
{;}
.ExternalClass span.ecxecxmsohyperlinkfollowed
{;}
.ExternalClass span.ecxecxe-mailformatvorlage18
{;}
.ExternalClass p.ecxecxmsonormal1, .ExternalClass li.ecxecxmsonormal1, .ExternalClass div.ecxecxmsonormal1
{margin-right:0cm;margin-bottom:0cm;margin-left:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink1
{color:blue;text-decoration:underline;}
.ExternalClass span.ecxecxmsohyperlinkfollowed1
{color:purple;text-decoration:underline;}
.ExternalClass span.ecxecxe-mailformatvorlage181
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass p.ecxecxmsochpdefault1, .ExternalClass li.ecxecxmsochpdefault1, .ExternalClass div.ecxecxmsochpdefault1
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxE-MailFormatvorlage28
{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>that’s no problem, if you have the ‘top’ workitem, just select swwwihead with ‘where’-clause: &nbsp;</SPAN><B><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>WI_CHCKWI</SPAN></B><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US> = your_top_wi_id</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Try this select statement:</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp; SELECT SINGLE * FROM SWWWIHEAD into wa_SWWWIHEAD</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp; WHERE WI_CHCKWI = lv_top_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; </SPAN><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt">AND wi_type = 'W'</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Arial monospaced for SAP'; COLOR: black; FONT-SIZE: 9pt" lang=EN-US>&nbsp;&nbsp;&nbsp; AND ( WI_STAT = 'READY' or WI_STAT = 'STARTED' ).</SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>You should get the actual workitem, with this information you can call the function module.</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>Hope that helps…</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 18:17<BR><B>An:</B> sap-wug@mit.edu<BR><B>Betreff:</B> RE: AW: Getting current agent (name) from workflow work item</SPAN></P></DIV></DIV>
<P class=ecxMsoNormal>&nbsp;</P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">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;</SPAN></P>
<DIV style="TEXT-ALIGN: center" class=ecxMsoNormal align=center><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">
<HR id=ecxstopSpelling align=center SIZE=2 width="100%">
</SPAN></DIV>
<P style="MARGIN-BOTTOM: 12pt" class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">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</SPAN></P>
<DIV>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Hi Sunni,</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Regards,</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>Benny</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Calibri','sans-serif'; COLOR: #1f497d; FONT-SIZE: 11pt" lang=EN-US>&nbsp;</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></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><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt"></SPAN></P></DIV></DIV>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">&nbsp;</SPAN></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>
<P class=ecxMsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt">&nbsp;</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">Got a cool Hotmail story? <A href="http://clk.atdmt.com/UKM/go/195013117/direct/01/">Tell us now</A></SPAN></P></DIV>                                               <br /><hr />Not got a Hotmail account? <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now - Free</a></body>
</html>