<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" 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 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {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";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
span.postdetails1
        {color:black;}
span.genmed1
        {color:black;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

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

<div class=Section1>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>I have
implemented a rule based agent assignment using a function module. For some
reason the statement <br>
<br>
<b><span style='font-weight:bold'>swc_get_element ac_container <i><span
style='font-style:italic'>etc</span></i></span></b> is not working. I initially
tested the workflow as a whole and then did the 'simulate rule resolution' in
PFAC and have narrowed it down to this statement. <br>
<br>
I have put the include &lt;CNTN01&gt; in my global data for the function group.
<br>
<br>
Here is the code in the function module: <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=1 color="#006600"
face=Courier><span style='font-size:8.0pt;font-family:Courier;color:#006600'>FUNCTION
z_get_po_creator. <br>
*&quot;---------------------------------------------------------------------- <br>
*&quot;*&quot;Local interface: <br>
*&quot;&nbsp; TABLES <br>
*&quot;&nbsp; &nbsp; &nbsp; ACTOR_TAB STRUCTURE&nbsp; SWHACTOR <br>
*&quot;&nbsp; &nbsp; &nbsp; AC_CONTAINER STRUCTURE&nbsp; SWCONT <br>
*&quot;&nbsp; EXCEPTIONS <br>
*&quot;&nbsp; &nbsp; &nbsp; NOBODY_FOUND <br>
*&quot;---------------------------------------------------------------------- <br>
<br>
DATA: l_user LIKE wfsyst-initiator, <br>
&nbsp; &nbsp; &nbsp; l_ebeln TYPE ebeln. <br>
<br>
CLEAR:&nbsp; &nbsp;actor_tab. <br>
REFRESH: actor_tab. <br>
<br>
break-point.&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;For Testing Purposes
Only <br>
<br>
* Get the PO Number from ac_container <br>
&nbsp; swc_get_element ac_container 'PONUMBER' l_ebeln. <br>
<br>
&nbsp; IF sy-subrc EQ 0. <br>
<br>
&nbsp; SELECT SINGLE ernam FROM ekko INTO l_user WHERE ebeln EQ l_ebeln. <br>
<br>
&nbsp; &nbsp; &nbsp;actor_tab-otype =&nbsp; 'US'. <br>
&nbsp; &nbsp; &nbsp;actor_tab-objid =&nbsp; l_user. <br>
&nbsp; &nbsp; &nbsp;APPEND actor_tab. <br>
<br>
&nbsp; ELSE. <br>
&nbsp; &nbsp; &nbsp;RAISE nobody_found. <br>
&nbsp; ENDIF. <br>
<br>
ENDFUNCTION.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=1 color="#006600"
face=Courier><span style='font-size:8.0pt;font-family:Courier;color:#006600'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>And
finally, below are the contents of the ac_container itab from debug mode. <br>
<br>
ELEMENT TAB_INDEX ELEMLENGTH TYPE VALUE <br>
PONUMBER |000000 |000 | |4800000013 <br>
<br>
A single step through the statement <br>
<b><span style='font-weight:bold'>swc_get_element ac_container 'PONUMBER'
l_ebeln.</span></b> <br>
returns an sy-subrc of 4 and l_ebeln is not filled. ' <br>
<br>
PONUMBER' is the name of the container element on the rule and it has the same
type as l_ebeln. <br>
<br>
I am stuck now, can anybody help?<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=black
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:black'>Henry.</span></font><font
size=1 color=black face=Arial><span style='font-size:8.0pt;font-family:Arial;
color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

</div>

<br><br>
<P align=center><FONT style="BACKGROUND-COLOR: #ffffff">This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.</FONT></A></P>
</body>

</html>