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

diff between

Former Member
0 Likes
707

hi plz tell me the

diff between normal and rfc function module

5 REPLIES 5
Read only

Former Member
0 Likes
686

Hi,

Function modules are routines with a defined interface, supporting optional parameters and labelled exceptions, intended to perform specific tasks encouraging re-use.

Functions that are remotely callable via SAP's proprietary remote function call (RFC) protocol, have additional technical restrictions, primarily that the parameters cannot be changing and/or passed by reference, as previously mentioned. When a function module is marked as RFC-enabled, SAP checks that the function's interface meets the restrictions and also generates an internal stub routine to allow the RFC communication to take place (but we don't really need to know anything about that stub).

When a function module raises an exception, control is passed back to the calling program. When the calling program is an external RFC client, the caller receives only a return code indicating that an application exception was raised and the name of the exception as an upper-case text string. The caller is then responsible for inspecting the exception text to see what kind of error occurred.

BAPI stands for Business API and are implemented as function modules that follow SAP-specified standards. They do not need to be RFC-enabled, but since the purpose of BAPI's is to expose business functionality internally and externally, then you will find that most are RFC-enabled.

The main standards that BAPI's must implement are:

1) The interface remains static between releases, or at least backwards-compatible.

2) Exceptions are not used, instead outcome information is returned to caller via a special parameter called a RETURN parameter (the structure of which is somewhat standardised, there are a couple of alternatives). The RETURN parameter provides more information, particularly the SAP message details and text.

3) Database updates are not to be performed directly by a BAPI. Instead the BAPI is to perform the necessary validations and then queue the updates to be processed by the next COMMIT WORK (usually done by calling a subroutine via syntax PERFORM ... ON COMMIT).

In cases where a single BAPI call processes multiple transactions, it is common for the RETURN information to be passed as a table parameter.

Calling application must remember to invoke the ABAP COMMIT WORK statement. This can be done externally by calling RFC function module BAPI_TRANSACTION_COMMIT.

This brings me to me biggest pet peave about BAPI's and the RFC protocol. For some reason that is beyond my understanding of the RFC protocol (upon which many other things such as ABAP to Java and .NET integration are based), is that the end of each function call performs an implicit database commit. This is the reason why BAPI transactions are not allowed to perform database updates directly, because doing so would otherwise prevent chaining multiple BAPI calls into a single unit of work.

However this is really a catch 22 situation, because the problem with the BAPI approach of queueing updates is that chances are the subsequent BAPI call, which I'd like to be part of the same unit of work, will fail because the database updates of the first BAPI call have not been made yet.

Take for example the following scenario (please note that I'm not an SD person):

Create a customer

Create a sales order for that customer

This can't be done in a single unit of work, because the call to the "Create Customer" BAPI (whatever that is) will not create the customer in the database (it will just queue it for update) and so the second BAPI call to "Create Sales Order" will fail because the customer number does not exist yet.

regards,

KK

Read only

Former Member
0 Likes
686

RFC is Remote Function Call which can be used to execute

the function module on remote system to get the required

data.To call the function module remotely,we have to enable

the remote call radio button located in the attribute of

the function module.

Normal function module is one which can be used to

execute the function module in the local system to get the

required data.

Read only

Clemenss
Active Contributor
0 Likes
686

Hi sriharitha,

Use the F1 key, I couldn't explain better.

Regards,

Clemens

Read only

Former Member
0 Likes
686

Hi,

RFC is used to call the function module from the remote

system, where as normal functin module is used within the

system.

RFC is Remote Function Call which can be used to execute

the function module on remote system to get the required

data.To call the function module remotely,we have to enable

the remote call radio button located in the attribute of

the function module.

Normal function module is one which can be used to

execute the function module in the local system to get the

required data.

RFC stands for REMOTE FUNCTION CALL RFCs are used to

establish a connection between two different application

servers rfc used for accessing functions of a function

module in a function group present on different application

servers with in a landscape i.e., for transfer of data

directly between source and target client on remote systems

in sap system landscape.

in sap basis rfc is used for remote client copies.

Tcode RFC- sm59 display/maintain

FUNCTION MODULE contains functions in particular to a module

like finance , HR , MM....... .Function module is always

created under function group. one group can contain one or

more function modules a function module can be accessed from

remote system where u can call it as RFC call.

u create function module in following way

1.tcode- sm37

2.create a function group

3.activate the function group

4.create the function module

5. activate the function module

6. access the function module

If its useful reward points

Read only

Former Member
0 Likes
686

Hi,

Function modules are procedures that are defined in function groups (special ABAP programs with type F) and can be called from any ABAP program. Function groups act as containers for function modules that logically belong together,Function modules allow you to encapsulate and reuse global functions in the R/3 System. They are stored in a central library,Unlike subroutines, you do not define function modules in the source code of your program.

3 types.

1)normal function module

2)remote function module

Difference between FM and subroutines

3)update function module

Cheers,

vasavi.