Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Create a Remotely Enabled Function Module

Former Member
0 Likes
4,875

Hi All,

How to Create a Remotely Enabled Function Module.

I Want to Create a FM Using Sample Data , This for Practice

What Fields can i give in the Import and Export Parameters.

Please Give me one Example

Can Any one Give me the Steps to do this.

Regards

Vamsi

8 REPLIES 8
Read only

former_member404244
Active Contributor
0 Likes
2,053

Hi,

in the attributes of the FM u have to specify the radio button Remote enabled function module thats it..rest evryting is same like normal function module..

while calling in the program u need to call like this..

CALL FUNCTION <Function module name> destination <destination name>

Regards,

Nagaraj

Read only

0 Likes
2,053

Hi,

I Don't Know How to create a Sample FM

Will u Please Help me Regarding this

My Aim is to create a FM in SE37 And Remotely Enable it.

So that I can Use it as a BAPI Cal in XI

Please Let me know

Regards

Vamsi

Read only

Former Member
0 Likes
2,053

Hi,

RFC function modules are is normal function modules, just if you select the Remote Enabled radio button then it will work as RFC

If you want to call a function module, which is registered as being remote in an SAP system, in the same SAP system, you have two options for making this call:

· As a remote call

· As a local call

The CALL FUNCTION statement and the parameter handling is different for both cases (this is explained in more detail under Parameter Handling in Remote Calls).

Remote Call:

· CALL FUNCTION...DESTINATION = 'NONE'

This is a remote call, even though DESTINATION = 'NONE' means that the remote function will run in the same system as the caller. As a remote call, the function module runs in its own roll area, and parameter values are handled as for other remote calls (described in Parameter Handling in Remote Calls.)

Look at the below function modules

http://help.sap.com/saphelp_nw04/helpdata/en/22/04255e488911d189490000e829fbbd/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

Read only

0 Likes
2,053

Hi,

I will tel u What I Want to Do Exactly

1) Created Function Group in Se80

2) Created Function Module in Se37

3) Given in Import-----Para1 ,,para2 Variables

4)Given in Export---para3

Here I want to do is that

I want to Add para1 and para2 values and keep it into para3

Then How can i Write the Code in Source code TAB

Should i Uncomment the Lines in the Source code Or Should I Write it separately

Regards

Vamsi

Read only

Former Member
0 Likes
2,053

Hi

1.create one Function Groupthen right click on that and create Function Module .

2.Double click on that Function Module in that there is a tab called <b>Attribute</b> click on that.

3.There one Tab called processing type in that choose the option Remote-enabled module...

Refer to the following link for more information.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f078394a-4469-2910-c4bf-853c7567....

Regards,

Sudha S

Read only

former_member404244
Active Contributor
0 Likes
2,053

hi,

in the source code tab write directly..

para3 = para1 + para2.

thats it....

Regards,

nagaraj

Read only

0 Likes
2,053

Hi,

Should I Declare those Variables in the Source code???

OR

Directly Can I Wtite para3 = para1 + para2

Regards

Vamsi

Read only

sukhbold_altanbat
Active Participant
0 Likes
2,053

Hi Vamsi,

Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.

Do the following steps for creating RFC in server A.

1. log on to server A

2. go to se37

3. Edit -> function groups-> create function group and give the function group name (say ZGRP).

4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.

5. go to attribute tab -> choose remote-enabled module from processing type.

so that your FM will become RFC.

6. provide the import parameter in import tab.

we will provide only two import parameters.

- parameter name : P_NUM1, typing: TYPE, associated type : I & <b>check the pass value</b> (all the parameters of RFC must pass by value).

- parameter name : P_NUM2, typing: TYPE, associated type : I & <b>check the pass value</b>

7. provide the export parameter in export tab.

parameter name : P_SUM, typing: TYPE, associated type : I & <b>check the pass value</b>

8. write the given simple code in source code tab.

FUNCTION Z_TEST_RFC.

P_TOT = P_NUM1 + P_NUM2.

ENDFUNCTION.

Do the following steps for creating ABAP program which will call the RFC in server B.

1. se38 - > creat a program.

2. write the given simple code.

data tot type i.

call function 'Z_TEST_RFC' destination '<b>XXXXXX</b>'

exporting

p_num1 = 10

p_num2 = 15

importing

p_tot = tot.

write tot.

please note that <b>XXXXXX</b> is RFC connection which is avialable in <b>sm59</b> transaction in server A.

-go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of <b>XXXXXX</b> in the code.

finally you can execute the normal abap program that will call the RFC and display the result.

Regards,

Sukhee