<html><body>
<p>Hi Seth,<br>
<br>
This is our code but we are not getting any results.<br>
<br>
<br>
<br>
<font color="#0000FF" face="Courier New">INCLUDE</font><font face="Courier New"> <cntn01> .<br>
<br>
</font><font color="#0000FF" face="Courier New">DATA</font><font face="Courier New"> : o_role </font><font color="#0000FF" face="Courier New">TYPE</font><font face="Courier New"> swc_object.<br>
<br>
</font><font color="#0000FF" face="Courier New">DATA</font><font face="Courier New"> : rule_agents </font><font color="#0000FF" face="Courier New">TYPE</font><font face="Courier New"> wfsyst-agent </font><font color="#0000FF" face="Courier New">OCCURS</font><font face="Courier New"> </font><font color="#4181FF" face="Courier New">0</font><font face="Courier New"> </font><font color="#0000FF" face="Courier New">WITH</font><font face="Courier New"> </font><font color="#0000FF" face="Courier New">HEADER</font><font face="Courier New"> </font><font color="#0000FF" face="Courier New">LINE</font><font face="Courier New">.<br>
<br>
swc_container b_container.<br>
<br>
swc_create_object o_role </font><font color="#3F803F" face="Courier New">'Z_STD_ROLE'</font><font face="Courier New"> </font><font color="#3F803F" face="Courier New">'AC90000005'</font><font face="Courier New">.<br>
swc_set_element b_container </font><font color="#3F803F" face="Courier New">'Plant'</font><font face="Courier New"> ip_plant.<br>
swc_set_element b_container </font><font color="#3F803F" face="Courier New">'MaterialGroup'</font><font face="Courier New"> ip_mat_grp.<br>
swc_call_method o_role </font><font color="#3F803F" face="Courier New">'Role90000005'</font><font face="Courier New"> b_container.<br>
swc_get_table b_container </font><font color="#3F803F" face="Courier New">'ActorTab'</font><font face="Courier New"> rule_agents.</font><br>
<br>
<br>
<br>
<br>
<font face="Courier New">The key for BOR Z_STD_ROLE is </font><font face="Courier New">HRS1203-</font><font face="Courier New">OTYPE and HRS1203-</font><font face="Courier New">OBJID.</font><br>
<br>
<br>
<font face="Courier New">This is the input paramters for the method of BOR S_STD_ROLE.</font><br>
<br>
<img src="cid:1__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" width="734" height="212"><font face="Courier New"><br>
</font><br>
<font face="Courier New">This is the code for the method role90000005</font><br>
<br>
<font face="Courier New">begin_method role90000005 changing container. </font><br>
<font face="Courier New">swc_set_objectkey 'AC90000005'. </font><br>
<font face="Courier New">swc_call_method self 'ResolveRole' container. </font><br>
<font face="Courier New">CASE sy-subrc. </font><br>
<font face="Courier New"> WHEN 1001. </font><br>
<font face="Courier New"> exit_return 9001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. </font><br>
<font face="Courier New"> WHEN 1002. </font><br>
<font face="Courier New"> exit_return 9002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. </font><br>
<font face="Courier New"> WHEN 1003. </font><br>
<font face="Courier New"> exit_return 9003 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. </font><br>
<font face="Courier New"> WHEN 1004. </font><br>
<font face="Courier New"> exit_return 9004 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. </font><br>
<font face="Courier New">ENDCASE. </font><br>
<font face="Courier New">end_method. </font><br>
<br>
<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:2__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt="Inactive hide details for "Stevens, Seth" <Seth.Stevens@anadarko.com>">"Stevens, Seth" <Seth.Stevens@anadarko.com><br>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:3__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">"Stevens, Seth" <Seth.Stevens@anadarko.com></font></b><font size="2"> </font><br>
<font size="2">Sent by: sap-wug-bounces@mit.edu</font>
<p><font size="2">15-09-2009 04:22 PM</font>
<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center"><font size="2">Please respond to<br>
"SAP Workflow Users' Group" <sap-wug@mit.edu></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:4__=CDBBFCA7DF88CE498f9e8a93df9@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:4__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">"SAP Workflow Users' Group" <sap-wug@mit.edu></font></td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:4__=CDBBFCA7DF88CE498f9e8a93df9@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:4__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt=""><br>
</td></tr>
<tr valign="top"><td width="1%"><img width="58" height="1" src="cid:4__=CDBBFCA7DF88CE498f9e8a93df9@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:4__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt=""><br>
<font size="2">RE: Function Module</font></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img width="1" height="1" src="cid:4__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt=""></td><td width="336"><img width="1" height="1" src="cid:4__=CDBBFCA7DF88CE498f9e8a93df9@toyota.co.za" border="0" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<font color="#0000FF" face="Arial">Nat,</font><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">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><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">data lv_obj type swc_object.</font><br>
<font color="#0000FF" face="Arial">data: begin of lt_container occurs 0,</font><br>
<font color="#0000FF" face="Arial"> include structure swcont.</font><br>
<font color="#0000FF" face="Arial">data: end of lt_container.</font><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">swc_create_object lv_obj 'your_obj_name' objkey.</font><br>
<font color="#0000FF" face="Arial">swc_call_method lv_obj 'your_method_name' lt_container.</font><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">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><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">Hope this helps.</font><br>
<font size="4"> </font><br>
<font color="#0000FF" face="Arial">--Seth</font><br>
<font color="#0000FF" face="Arial"> </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"> Tuesday, September 15, 2009 2:59 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-wug@mit.edu; sap-wug-bounces@mit.edu</font><b><font face="Tahoma"><br>
Subject:</font></b><font face="Tahoma"> Function Module</font><font size="4"><br>
</font>
<p><font size="4">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>
<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><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>