<html><body>
<p>Hi ,<br>
<br>
When we call the method of a business object within any business object it works but this is done without instanciating a BO at all.<br>
<br>
Does this make any difference?<br>
<br>
<b><font size="4" color="#483D8B"><br>
Regards</font></b><font size="4"><br>
Nat Govender<br>
Toyota South Africa<br>
IT - SAP Workflow Specialist<br>
Internal Ext.   :  32645<br>
Direct Line    :  +27 031 910 2645<br>
Fax               :  086 607 0414<br>
E-mail           :  </font><a href="mailto:ngovender4@toyota.co.za"><u><font size="4" color="#0000FF">ngovender4@toyota.co.za</font></u></a><font size="4"><br>
</font><font size="4" color="#FF00FF"><br>
If you tell the truth, you don't have to remember anything. </font><br>
<img width="16" height="16" src="cid:1__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt="Inactive hide details for &quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;">&quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;<br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:2__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">&quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;</font></b><font size="2"> </font><br>
<font size="2">Sent by: sap-wug-bounces@mit.edu</font>
<p><font size="2">17-09-2009 03:40 PM</font>
<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center"><font size="2">Please respond to<br>
&quot;SAP Workflow Users' Group&quot; &lt;sap-wug@mit.edu&gt;</font></div></td></tr>
</table>
</ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">To</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">&quot;SAP Workflow Users' Group&quot; &lt;sap-wug@mit.edu&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">&lt;sap-wug-bounces@mit.edu&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<div align="right"><font size="2">Subject</font></div></td><td width="100%"><img width="1" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">RE: Function Module For Access a Method Of The BOR</font></td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<font color="#0000FF" face="Arial">From a quick glance everything looks okay generically.  I'd recommend some good old debugging.  Hit F5 to step into the method calls.  Just make sure the containers are getting passed properly and see if you are hitting any exceptions.  Your technique for calling the method is correct, just do some debugging to figure out why your not getting results back in the container.</font><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">--Seth</font><br>
<br>
<hr width="100%" size="2" align="left"><b><font face="Tahoma">From:</font></b><font face="Tahoma"> sap-wug-bounces@mit.edu [<a href="mailto:sap-wug-bounces@mit.edu">mailto:sap-wug-bounces@mit.edu</a>] </font><b><font face="Tahoma">On Behalf Of </font></b><font face="Tahoma">Nat 4 Govender</font><b><font face="Tahoma"><br>
Sent:</font></b><font face="Tahoma"> Thursday, September 17, 2009 12:03 AM</font><b><font face="Tahoma"><br>
To:</font></b><font face="Tahoma"> SAP Workflow Users' Group</font><b><font face="Tahoma"><br>
Cc:</font></b><font face="Tahoma"> SAP Workflow Users' Group; sap-wug-bounces@mit.edu</font><b><font face="Tahoma"><br>
Subject:</font></b><font face="Tahoma"> RE: Function Module For Access a Method Of The BOR</font><font size="4"><br>
</font>
<p><font size="4">Hi Seth,<br>
<br>
This is our code but we are not getting any results.<br>
<br>
<br>
</font><font size="4" color="#0000FF" face="Courier New"><br>
INCLUDE</font><font size="4" face="Courier New"> &lt;cntn01&gt; .<br>
</font><font size="4" color="#0000FF" face="Courier New"><br>
DATA</font><font size="4" face="Courier New"> : o_role </font><font size="4" color="#0000FF" face="Courier New">TYPE</font><font size="4" face="Courier New"> swc_object.<br>
</font><font size="4" color="#0000FF" face="Courier New"><br>
DATA</font><font size="4" face="Courier New"> : rule_agents </font><font size="4" color="#0000FF" face="Courier New">TYPE</font><font size="4" face="Courier New"> wfsyst-agent </font><font size="4" color="#0000FF" face="Courier New">OCCURS</font><font size="4" face="Courier New"> </font><font size="4" color="#4181FF" face="Courier New">0</font><font size="4" face="Courier New"> </font><font size="4" color="#0000FF" face="Courier New">WITH</font><font size="4" face="Courier New"> </font><font size="4" color="#0000FF" face="Courier New">HEADER</font><font size="4" face="Courier New"> </font><font size="4" color="#0000FF" face="Courier New">LINE</font><font size="4" face="Courier New">.<br>
<br>
swc_container b_container.<br>
<br>
swc_create_object o_role </font><font size="4" color="#3F803F" face="Courier New">'Z_STD_ROLE'</font><font size="4" face="Courier New"> </font><font size="4" color="#3F803F" face="Courier New">'AC90000005'</font><font size="4" face="Courier New">.<br>
swc_set_element b_container </font><font size="4" color="#3F803F" face="Courier New">'Plant'</font><font size="4" face="Courier New"> ip_plant.<br>
swc_set_element b_container </font><font size="4" color="#3F803F" face="Courier New">'MaterialGroup'</font><font size="4" face="Courier New"> ip_mat_grp.<br>
swc_call_method o_role </font><font size="4" color="#3F803F" face="Courier New">'Role90000005'</font><font size="4" face="Courier New"> b_container.<br>
swc_get_table b_container </font><font size="4" color="#3F803F" face="Courier New">'ActorTab'</font><font size="4" face="Courier New"> rule_agents.</font><font size="4"><br>
<br>
<br>
<br>
</font><font size="4" face="Courier New"><br>
The key for BOR Z_STD_ROLE is HRS1203-OTYPE and HRS1203-OBJID.</font><font size="4"><br>
<br>
</font><font size="4" face="Courier New"><br>
This is the input paramters for the method of BOR S_STD_ROLE.</font><font size="4"><br>
<br>
</font><img src="cid:4__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="734" height="212"><font size="4"><br>
</font><font size="4" face="Courier New"><br>
This is the code for the method role90000005</font><font size="4"><br>
</font><font size="4" face="Courier New"><br>
begin_method role90000005 changing container. <br>
swc_set_objectkey 'AC90000005'. <br>
swc_call_method self 'ResolveRole' container. <br>
CASE sy-subrc. <br>
WHEN 1001. <br>
exit_return 9001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. <br>
WHEN 1002. <br>
exit_return 9002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. <br>
WHEN 1003. <br>
exit_return 9003 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. <br>
WHEN 1004. <br>
exit_return 9004 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. <br>
ENDCASE. <br>
end_method. </font><font size="4"><br>
<br>
<br>
</font><b><font size="5" color="#483D8B"><br>
<br>
Regards</font></b><font size="5"><br>
Nat Govender<br>
Toyota South Africa<br>
IT - SAP Workflow Specialist<br>
Internal Ext. : 32645<br>
Direct Line : +27 031 910 2645<br>
Fax : 086 607 0414<br>
E-mail : </font><a href="mailto:ngovender4@toyota.co.za"><u><font size="5" color="#0000FF">ngovender4@toyota.co.za</font></u></a><font size="5" color="#FF00FF"><br>
<br>
If you tell the truth, you don't have to remember anything. </font><font size="4"><br>
</font><img src="cid:1__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="16" height="16" alt="Inactive hide details for &quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;"><font size="4">&quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;<br>
<br>
</font>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="54%">
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul><b>&quot;Stevens, Seth&quot; &lt;Seth.Stevens@anadarko.com&gt;</b> <br>
Sent by: sap-wug-bounces@mit.edu<font size="4"> </font>
<p>15-09-2009 04:22 PM<font size="4"> </font></ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>

<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center">Please respond to<br>
&quot;SAP Workflow Users' Group&quot; &lt;sap-wug@mit.edu&gt;</div></td></tr>
</table>
</td><td width="46%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="17%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="58" height="1"><div align="right">To</div></td><td width="83%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="1" height="1"><br>
&quot;SAP Workflow Users' Group&quot; &lt;sap-wug@mit.edu&gt;</td></tr>

<tr valign="top"><td width="17%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="58" height="1"><div align="right">cc</div></td><td width="83%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="1" height="1"></td></tr>

<tr valign="top"><td width="17%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="58" height="1"><div align="right">Subject</div></td><td width="83%"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="1" height="1"><br>
RE: Function Module</td></tr>
</table>

<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="1" height="1"></td><td width="336"><img src="cid:3__=CDBBFCABDF8A88518f9e8a93df9@toyota.co.za" width="1" height="1"></td></tr>
</table>
</td></tr>
</table>
<font size="4" color="#0000FF" face="Arial"><br>
Nat,</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
This is very simple to do. Create your RFC, then inside the RFC use the BOR macros to instantiate the business object and call your method. Something like below.</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
data lv_obj type swc_object.<br>
data: begin of lt_container occurs 0,<br>
include structure swcont.<br>
data: end of lt_container.</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
swc_create_object lv_obj 'your_obj_name' objkey.<br>
swc_call_method lv_obj 'your_method_name' lt_container.</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
You can use swc_set_element to set any import parameters in lt_container before calling the method then use swc_get_element to read any export parameters after calling the method. Syntax is swc_get_element lt_container 'your_param_name' lv_variable.</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
Hope this helps.</font><font size="4"><br>
</font><font size="4" color="#0000FF" face="Arial"><br>
--Seth</font><font size="4"><br>
<br>
<br>
</font><hr width="100%" size="2" align="left"><b><font size="4" face="Tahoma">From:</font></b><font size="4" face="Tahoma"> sap-wug-bounces@mit.edu [</font><a href="mailto:sap-wug-bounces@mit.edu"><u><font size="4" color="#0000FF" face="Tahoma">mailto:sap-wug-bounces@mit.edu</font></u></a><font size="4" face="Tahoma">] </font><b><font size="4" face="Tahoma">On Behalf Of </font></b><font size="4" face="Tahoma">Nat 4 Govender</font><b><font size="4" face="Tahoma"><br>
Sent:</font></b><font size="4" face="Tahoma"> Tuesday, September 15, 2009 2:59 AM</font><b><font size="4" face="Tahoma"><br>
To:</font></b><font size="4" face="Tahoma"> SAP Workflow Users' Group</font><b><font size="4" face="Tahoma"><br>
Cc:</font></b><font size="4" face="Tahoma"> sap-wug@mit.edu; sap-wug-bounces@mit.edu</font><b><font size="4" face="Tahoma"><br>
Subject:</font></b><font size="4" face="Tahoma"> Function Module</font>
<p><font size="5">Hi All,<br>
<br>
I would like to know if it is possible to create a function module (remote) that can access one of our methods of the business object.<br>
<br>
<br>
If so can you please advise how to go about to do that. I am not a ABAPer.<br>
<br>
</font><b><font size="6" color="#483D8B"><br>
<br>
<br>
Regards</font></b><font size="6"><br>
Nat Govender<br>
Toyota South Africa<br>
IT - SAP Workflow Specialist<br>
Internal Ext. : 32645<br>
Direct Line : +27 031 910 2645<br>
Fax : 086 607 0414<br>
E-mail : </font><a href="mailto:ngovender4@toyota.co.za"><u><font size="6" color="#0000FF">ngovender4@toyota.co.za</font></u></a><font size="6" color="#FF00FF"><br>
<br>
If you tell the truth, you don't have to remember anything. </font><tt><font size="4">_______________________________________________<br>
SAP-WUG mailing list<br>
SAP-WUG@mit.edu</font></tt><tt><u><font size="4" color="#0000FF"><br>
</font></u></tt><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug"><tt><u><font size="4" color="#0000FF">http://mailman.mit.edu/mailman/listinfo/sap-wug</font></u></tt></a><tt>_______________________________________________<br>
SAP-WUG mailing list<br>
SAP-WUG@mit.edu<br>
</tt><tt><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</a></tt><tt><br>
</tt>
<p></body></html>