Function Module For Access a Method Of The BOR

Stevens, Seth Seth.Stevens at anadarko.com
Thu Sep 17 09:31:03 EDT 2009


>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.
 
--Seth

________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Nat 4 Govender
Sent: Thursday, September 17, 2009 12:03 AM
To: SAP Workflow Users' Group
Cc: SAP Workflow Users' Group; sap-wug-bounces at mit.edu
Subject: RE: Function Module For Access a Method Of The BOR



Hi Seth,

This is our code but we are not getting any results.



INCLUDE <cntn01> .

DATA : o_role TYPE swc_object.

DATA : rule_agents TYPE wfsyst-agent OCCURS 0 WITH HEADER LINE.

swc_container b_container.

swc_create_object o_role 'Z_STD_ROLE' 'AC90000005'.
swc_set_element b_container 'Plant' ip_plant.
swc_set_element b_container 'MaterialGroup' ip_mat_grp.
swc_call_method o_role 'Role90000005' b_container.
swc_get_table b_container 'ActorTab' rule_agents.




The key for BOR Z_STD_ROLE is HRS1203-OTYPE and HRS1203-OBJID.


This is the input paramters for the method of BOR S_STD_ROLE.

 

This is the code for the method role90000005

begin_method role90000005 changing container. 
swc_set_objectkey 'AC90000005'. 
swc_call_method self 'ResolveRole' container. 
CASE sy-subrc. 
WHEN 1001. 
exit_return 9001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
WHEN 1002. 
exit_return 9002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
WHEN 1003. 
exit_return 9003 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
WHEN 1004. 
exit_return 9004 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. 
ENDCASE. 
end_method. 




Regards
Nat Govender
Toyota South Africa
IT - SAP Workflow Specialist
Internal Ext. : 32645
Direct Line : +27 031 910 2645
Fax : 086 607 0414
E-mail : ngovender4 at toyota.co.za <mailto:ngovender4 at toyota.co.za> 

If you tell the truth, you don't have to remember anything. 
 "Stevens, Seth" <Seth.Stevens at anadarko.com>




				"Stevens, Seth"
<Seth.Stevens at anadarko.com> 
				Sent by: sap-wug-bounces at mit.edu 

				15-09-2009 04:22 PM 
	
	Please respond to
"SAP Workflow Users' Group" <sap-wug at mit.edu>

 

To

"SAP Workflow Users' Group" <sap-wug at mit.edu>	


cc

	


Subject

RE: Function Module	
	 	

Nat,

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.

data lv_obj type swc_object.
data: begin of lt_container occurs 0,
include structure swcont.
data: end of lt_container.

swc_create_object lv_obj 'your_obj_name' objkey.
swc_call_method lv_obj 'your_method_name' lt_container.

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.

Hope this helps.

--Seth



________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Nat 4 Govender
Sent: Tuesday, September 15, 2009 2:59 AM
To: SAP Workflow Users' Group
Cc: sap-wug at mit.edu; sap-wug-bounces at mit.edu
Subject: Function Module


Hi All,

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.


If so can you please advise how to go about to do that. I am not a
ABAPer.




Regards
Nat Govender
Toyota South Africa
IT - SAP Workflow Specialist
Internal Ext. : 32645
Direct Line : +27 031 910 2645
Fax : 086 607 0414
E-mail : ngovender4 at toyota.co.za <mailto:ngovender4 at toyota.co.za> 

If you tell the truth, you don't have to remember anything.
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090917/e784510b/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 8419 bytes
Desc: 2B610189.gif
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090917/e784510b/attachment.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 105 bytes
Desc: graycol.gif
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090917/e784510b/attachment-0001.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 45 bytes
Desc: ecblank.gif
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090917/e784510b/attachment-0002.gif


More information about the SAP-WUG mailing list