10-08-2007 10:50 AM
i have a FM and i want to convert it into RFC function module
if i just select Remote-enabled module from attributes it says reference parameters are not allowed with RFC
how to do it?
10-08-2007 10:56 AM
hi karan,
go to SE37
select the radio button RFC enabled module.
provide the import and expport parameters for the function module.
while doing that select the checkbox PASS VALUE for the parameters which you are declaring in it.
write the logic in Source code.
Activate it and use it.
<b><i>Rewardpoints if useful</i></b>
Chandra
10-08-2007 10:56 AM
RFC's are nothing but the FM. If you have the FM ready then you can very easily convet it to RFC. but if you want to change your program to RFC then you may require to redesign everything.
Please give me reward point If it is useful
Thanks
Murali Poli
10-08-2007 10:56 AM
hi karan,
go to SE37
select the radio button RFC enabled module.
provide the import and expport parameters for the function module.
while doing that select the checkbox PASS VALUE for the parameters which you are declaring in it.
write the logic in Source code.
Activate it and use it.
<b><i>Rewardpoints if useful</i></b>
Chandra
10-08-2007 10:58 AM
Hi, ensure u are following below mentioned points.....
Creation:
You create a RFC function module just as you create a normal function module.
<b>After you create the function module, in the general tab of the function module select the "Remote Enabled" radio button which makes the function module as RFC function module.
Also the parameters should be Pass by value so select the "Pass value" check box against each of the parameters.
Last but not the least. RFC function modules cannot have exceptions, so define a return structure and pass all your messages like success, error etc. in the return structure.</b>
After the function module is created, the RFC function moule can be called using the statement
CALL FUNCTION <FN Name> DESTINATION <RFC Dest>.
where RFC Dest it the remote destination created in SM59.
RFC (Remote Function Call) is similar to the general SAP fun module: except that in the attributes you click the radio button: RFC enabled;
and you will be passing an Import parameter DESTINATION to it.
Other code and usage will be similar to any fun module;
Have a look at any fun module in SE37 to understand better about the different components of Fun modules;
Refer this link:
http://help.sap.com/saphelp_nw04/helpdata/en/22/042518488911d189490000e829fbbd/frameset.htm
A Normal Function Module cant be called from external system. but a RFC(Remote Function) can be.
e.g. If I have a Lotus Notes sysytem interacting with my SAP system. Now, to access trhe data from SAP, Lotus Notes system has to call some functions in SAP. RFC is designed for that purpose only that an extrenal system can access SAP system.
Regards
Vasu
10-08-2007 10:59 AM
10-08-2007 11:06 AM
Hi Karan,
There is a Check box for "Pass Value", In RFC FM you need tick that so it will be passed as value.
Best Regards,
Hikaruno