<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2>Nat,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2>Not sure I'm 100% following what you are saying. If
you call a method from within the object itself you do not need to instantiate
the object because it is already instantiated, you use the reserved word
SELF. If you are calling a method from a different business object OR from
an independent ABAP program you must first instantiate the
object.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2>The exception to both these statements is if you are
calling an instance independent (static) method. In this case you never
need to instantiate the object as this is the purpose of a static
method.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=680133813-21092009><FONT face=Arial
color=#0000ff size=2>--Seth</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Nat 4
Govender<BR><B>Sent:</B> Sunday, September 20, 2009 11:36 PM<BR><B>To:</B> SAP
Workflow Users' Group<BR><B>Cc:</B> SAP Workflow Users' Group;
sap-wug-bounces@mit.edu<BR><B>Subject:</B> RE: Function Module For Access a
Method Of The BOR<BR></FONT><BR></DIV>
<DIV></DIV>
<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 color=#483d8b
size=4><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 color=#0000ff
size=4>ngovender4@toyota.co.za</FONT></U></A><FONT size=4><BR></FONT><FONT
color=#ff00ff size=4><BR>If you tell the truth, you don't have to remember
anything. </FONT><BR><IMG height=16
alt='Inactive hide details for "Stevens, Seth" <Seth.Stevens@anadarko.com>'
src="cid:680133813@21092009-1B74" width=16 border=0>"Stevens, Seth"
<Seth.Stevens@anadarko.com><BR><BR><BR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<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>"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>17-09-2009 03:40 PM</FONT>
<TABLE border=1>
<TBODY>
<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></TBODY></TABLE></P></UL></UL></UL></UL></TD>
<TD width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD width="1%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=58 border=0><BR>
<DIV align=right><FONT size=2>To</FONT></DIV></TD>
<TD width="100%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=1 border=0><BR><FONT
size=2>"SAP Workflow Users' Group"
<sap-wug@mit.edu></FONT></TD></TR>
<TR vAlign=top>
<TD width="1%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=58 border=0><BR>
<DIV align=right><FONT size=2>cc</FONT></DIV></TD>
<TD width="100%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=1 border=0><BR><FONT
size=2><sap-wug-bounces@mit.edu></FONT></TD></TR>
<TR vAlign=top>
<TD width="1%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=58 border=0><BR>
<DIV align=right><FONT size=2>Subject</FONT></DIV></TD>
<TD width="100%"><IMG height=1 alt=""
src="cid:680133813@21092009-1B7B" width=1 border=0><BR><FONT
size=2>RE: Function Module For Access a Method Of The
BOR</FONT></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR vAlign=top>
<TD width=58><IMG height=1 alt="" src="cid:680133813@21092009-1B7B"
width=1 border=0></TD>
<TD width=336><IMG height=1 alt="" src="cid:680133813@21092009-1B7B"
width=1 border=0></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><FONT
face=Arial color=#0000ff>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 face=Arial
color=#0000ff>--Seth</FONT><BR><BR>
<HR align=left width="100%" SIZE=2>
<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 face="Courier New" color=#0000ff
size=4><BR>INCLUDE</FONT><FONT face="Courier New" size=4> <cntn01>
.<BR></FONT><FONT face="Courier New" color=#0000ff size=4><BR>DATA</FONT><FONT
face="Courier New" size=4> : o_role </FONT><FONT face="Courier New"
color=#0000ff size=4>TYPE</FONT><FONT face="Courier New" size=4>
swc_object.<BR></FONT><FONT face="Courier New" color=#0000ff
size=4><BR>DATA</FONT><FONT face="Courier New" size=4> : rule_agents
</FONT><FONT face="Courier New" color=#0000ff size=4>TYPE</FONT><FONT
face="Courier New" size=4> wfsyst-agent </FONT><FONT face="Courier New"
color=#0000ff size=4>OCCURS</FONT><FONT face="Courier New" size=4> </FONT><FONT
face="Courier New" color=#4181ff size=4>0</FONT><FONT face="Courier New" size=4>
</FONT><FONT face="Courier New" color=#0000ff size=4>WITH</FONT><FONT
face="Courier New" size=4> </FONT><FONT face="Courier New" color=#0000ff
size=4>HEADER</FONT><FONT face="Courier New" size=4> </FONT><FONT
face="Courier New" color=#0000ff size=4>LINE</FONT><FONT face="Courier New"
size=4>.<BR><BR>swc_container b_container.<BR><BR>swc_create_object o_role
</FONT><FONT face="Courier New" color=#3f803f size=4>'Z_STD_ROLE'</FONT><FONT
face="Courier New" size=4> </FONT><FONT face="Courier New" color=#3f803f
size=4>'AC90000005'</FONT><FONT face="Courier New" size=4>.<BR>swc_set_element
b_container </FONT><FONT face="Courier New" color=#3f803f
size=4>'Plant'</FONT><FONT face="Courier New" size=4>
ip_plant.<BR>swc_set_element b_container </FONT><FONT face="Courier New"
color=#3f803f size=4>'MaterialGroup'</FONT><FONT face="Courier New" size=4>
ip_mat_grp.<BR>swc_call_method o_role </FONT><FONT face="Courier New"
color=#3f803f size=4>'Role90000005'</FONT><FONT face="Courier New" size=4>
b_container.<BR>swc_get_table b_container </FONT><FONT face="Courier New"
color=#3f803f size=4>'ActorTab'</FONT><FONT face="Courier New" size=4>
rule_agents.</FONT><FONT size=4><BR><BR><BR><BR></FONT><FONT face="Courier New"
size=4><BR>The key for BOR Z_STD_ROLE is HRS1203-OTYPE and
HRS1203-OBJID.</FONT><FONT size=4><BR><BR></FONT><FONT face="Courier New"
size=4><BR>This is the input paramters for the method of BOR
S_STD_ROLE.</FONT><FONT size=4><BR><BR></FONT><IMG height=212
src="cid:680133813@21092009-1B82" width=734><FONT size=4><BR></FONT><FONT
face="Courier New" size=4><BR>This is the code for the method
role90000005</FONT><FONT size=4><BR></FONT><FONT face="Courier New"
size=4><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 color=#483d8b
size=5><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 color=#0000ff
size=5>ngovender4@toyota.co.za</FONT></U></A><FONT color=#ff00ff
size=5><BR><BR>If you tell the truth, you don't have to remember anything.
</FONT><FONT size=4><BR></FONT><IMG height=16
alt='Inactive hide details for "Stevens, Seth" <Seth.Stevens@anadarko.com>'
src="cid:680133813@21092009-1B74" width=16><FONT size=4>"Stevens, Seth"
<Seth.Stevens@anadarko.com><BR><BR></FONT>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD width="54%">
<UL>
<UL>
<UL>
<UL>
<UL>
<UL>
<UL>
<UL><B>"Stevens, Seth"
<Seth.Stevens@anadarko.com></B> <BR>Sent by:
sap-wug-bounces@mit.edu<FONT size=4> </FONT>
<P>15-09-2009 04:22 PM<FONT size=4>
</FONT></P></UL></UL></UL></UL></UL></UL></UL></UL>
<TABLE border=1>
<TBODY>
<TR vAlign=top>
<TD width=168 bgColor=#ffffff>
<DIV align=center>Please respond to<BR>"SAP Workflow Users' Group"
<sap-wug@mit.edu></DIV></TD></TR></TBODY></TABLE></TD>
<TD width="46%">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD width="17%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=58>
<DIV align=right>To</DIV></TD>
<TD width="83%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=1><BR>"SAP Workflow Users' Group"
<sap-wug@mit.edu></TD></TR>
<TR vAlign=top>
<TD width="17%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=58>
<DIV align=right>cc</DIV></TD>
<TD width="83%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=1></TD></TR>
<TR vAlign=top>
<TD width="17%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=58>
<DIV align=right>Subject</DIV></TD>
<TD width="83%"><IMG height=1 src="cid:680133813@21092009-1B7B"
width=1><BR>RE: Function Module</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR vAlign=top>
<TD width=58><IMG height=1 src="cid:680133813@21092009-1B7B"
width=1></TD>
<TD width=336><IMG height=1 src="cid:680133813@21092009-1B7B"
width=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><FONT face=Arial
color=#0000ff size=4><BR>Nat,</FONT><FONT size=4><BR></FONT><FONT face=Arial
color=#0000ff size=4><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 face=Arial
color=#0000ff size=4><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 face=Arial color=#0000ff
size=4><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
face=Arial color=#0000ff size=4><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 face=Arial color=#0000ff size=4><BR>Hope this
helps.</FONT><FONT size=4><BR></FONT><FONT face=Arial color=#0000ff
size=4><BR>--Seth</FONT><FONT size=4><BR><BR><BR></FONT>
<HR align=left width="100%" SIZE=2>
<B><FONT face=Tahoma size=4>From:</FONT></B><FONT face=Tahoma size=4>
sap-wug-bounces@mit.edu [</FONT><A
href="mailto:sap-wug-bounces@mit.edu"><U><FONT face=Tahoma color=#0000ff
size=4>mailto:sap-wug-bounces@mit.edu</FONT></U></A><FONT face=Tahoma size=4>]
</FONT><B><FONT face=Tahoma size=4>On Behalf Of </FONT></B><FONT face=Tahoma
size=4>Nat 4 Govender</FONT><B><FONT face=Tahoma
size=4><BR>Sent:</FONT></B><FONT face=Tahoma size=4> Tuesday, September 15, 2009
2:59 AM</FONT><B><FONT face=Tahoma size=4><BR>To:</FONT></B><FONT face=Tahoma
size=4> SAP Workflow Users' Group</FONT><B><FONT face=Tahoma
size=4><BR>Cc:</FONT></B><FONT face=Tahoma size=4> sap-wug@mit.edu;
sap-wug-bounces@mit.edu</FONT><B><FONT face=Tahoma
size=4><BR>Subject:</FONT></B><FONT face=Tahoma size=4> 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 color=#483d8b
size=6><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 color=#0000ff
size=6>ngovender4@toyota.co.za</FONT></U></A><FONT color=#ff00ff
size=6><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 color=#0000ff
size=4><BR></FONT></U></TT><A
href="http://mailman.mit.edu/mailman/listinfo/sap-wug"><TT><U><FONT
color=#0000ff
size=4>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></P></BODY></HTML>