Application Development 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: 

function module types

Former Member
0 Kudos
407

what is the difference between normal function module and the remote function module?

points will be awarded.

Cheers

troy

11 REPLIES 11

Former Member
0 Kudos
154

Hi,

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

reward if useful

regards,

anji

Former Member
0 Kudos
154

Hi,

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.

Hope it helps.

Regards,

Himanshu

Former Member
0 Kudos
154

Hi,

remote function modue can also be used as normal function module.

remote function module is for accessing the data from other clients.in this while calling the function module we will mention the logical system name.(that will be already assigned to the clients.which are different for different clients).

regards,

bharat.

Former Member
0 Kudos
154

Hi Troy,

Please refer the links,

Best Regards.

    • Reward points if it is useful.

Former Member
0 Kudos
154

Troy,

Remote FM will availble to Non SAP systems.You can call from other servers

which are in network.

General FM are with in the server you can call.Not available to outside of the server.

Don't forget to reward if useful

abhijeet_mukkawar
Active Contributor
0 Kudos
154

hi,

Normal FM can be called anywhere in the same system, but when you want to access your FM from out side eg, web dynpro or want to expose them as web service so as to be accessed from anywhere the FM should be "Remote enabled".

hope it clears your doubt.

regards,

abhijeet

Message was edited by:

abhijeet mukkawar

former_member189631
Active Contributor
0 Kudos
154

Hi Troy,

RFC is a technology which is used to access a functions (Modules) from

the remote systems.

If a function module is set as remote enabled which can be access from

the remote system via RFC.Eg: U can access the Remote enabled function modules in ur VB,Webdynpro,Java,Visual composer program.

A function module can be set as remote enabled by SE37->Go to ur FM->click the option Button "remote enabled".

But Normal function modules can not accessd from the remote system.

Good Example for RFC enabled function module is : BAPI(Business Application Programming Interface)

Note: All BAPIs are Remote enabled but not all remote enabled function modules are BAPI.

CALLING A FUNCTION MODULE:

1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"

--> Write the Corresponding FM name --> Hit Enter

2)The appropriate import ,export Parameters will be displayed in ur editor

3)Pass the Values Here.

Regards,

Ramganesan K.

Former Member
0 Kudos
154

hi,

the main diff in RFC is u have to pass the parameters by value only..........u can also call the RFC FM from non-sap also.

regards,

ram.

0 Kudos
154

what is passing by parametrs and passing by value?

0 Kudos
154

Hi Krishna,

There are three ways of passing parameters to a subroutine:

• Pass by reference

• Pass by value

• Pass by value and result

The syntax on the form statement determines how variables are passed. The syntax on perform does not. What this means will be explained in the next section. The first thing needed is to learn how to code each method.

<b>Advantages</b>

By reference : Passes a pointer to the original memory location, Very efficient

By value : Allocates a new memory location for use within the subroutine. The memory is freed when the subroutine ends, Prevents changes to passed variable

By value and result : Similar to pass by value, but the contents of the new memory is copied back into the original memory before returning. Allows changes and allows a rollback

<b>Passing Parameters by Reference</b>

When you pass a parameter by reference, new memory is not allocated for the value. Instead, a pointer to the original memory location is passed. All references to the parameter are references to the original memory location. Changes to the variable within the subroutine update the original memory location immediately.

With internal subroutines, there is little difference between passing parameters by reference and accessing global variables from within the subroutine.

<b>Passing Parameters by Value</b>

When you pass a parameter by value, new memory is allocated for the value. This memory is allocated when the subroutine is called and is freed when the subroutine returns. Therefore, references to the parameter are thus references to a unique memory area that is known only within the subroutine; the original memory location is separate. The original is unchanged if you change the value of the parameter.

<b>Passing Parameters by Value and Result</b>

Pass by value and result is very similar to pass by value. Like pass by value, a new memory area is allocated and it holds an independent copy of the variable. It is freed when the subroutine ends, and that is also when the difference occurs.

When the endform statement executes, it copies the value of the local memory area back into the original memory area. Changes to the parameter within the subroutine are reflected in the original, but not until the subroutine returns.

This may seem like a small difference, but the difference become greater. You can change whether the copy takes place or not.

The copy always takes place unless you leave the subroutine by using one of two statements:

• stop

• message ennn

The stop statement terminates the subroutine and goes directly to the end-of-selection event. If p1 was passed by value and result, changes to p1 are discarded before end-of-selection is triggered. In a sense, stop behaves like a mini-rollback for value and result parameters. When it is used inside of a subroutine, the stop statement is usually preceded by a test for an abnormal condition within the program. If the abnormal condition arises, stop is executed. It discards the changes to value and result variables, and triggers end-of-selection, where cleanup procedures are then executed.

Use pass by value and result for parameters you want to change, but there may be a possibility that you will want to discard the changes if an abnormal condition should arise in your subroutine.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Former Member
0 Kudos
154

THANKS ALL