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

Difference

Former Member
0 Likes
795

What is the difference between normal fnctioncall and a remote function call..?

1 ACCEPTED SOLUTION
Read only

p291102
Active Contributor
0 Likes
763
6 REPLIES 6
Read only

Former Member
0 Likes
763

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.

Read only

p291102
Active Contributor
0 Likes
764
Read only

Former Member
0 Likes
763

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.

Kishore.

Read only

Former Member
0 Likes
763

Hi,

The main difference between simple Function and a RFC is that RFC can be called from outside of SAP system. Say, i have LotusNotes interacting with SAP for fetching the data from SAP. In that case, LotusNotes will be able to communicate with SAP through RFC's only.

For RFCs we need to define a RFC destination i.e. connection information which can be maintained through transaction SM59.

Hope this helps u.

Regards,

Himanshu.

Read only

Former Member
0 Likes
763

Sriram,

Funcation module is one of the modularization techniques in SAP.

Set of operations that can be done repeatedly are put into one module called Funciton module.

SAP contains two types, Normal as well as Remore enabled Function module.

Normal function module can execute locally, but where as remote enabled FM can be executed at remote system.

Regards,

Sujatha.

Read only

former_member189631
Active Contributor
0 Likes
763

Hi Tangirala,

As The name implies RFC Enables functions can be executed from remote system using RFC technology

If a Function module is marked as RFC enabled then it can

be access from out side of R/3. For Example Remote enabled RFCs Function modules /BAPIs can be accessed from Java,Visual Basic,Webdynpro,Visual Composer Pograms.....

Normal function modules can not be accesed from outside....

[Note: <b>All Bapis are RFC Enabled function modules,But all

Function modules are not Bapis/not RFC enabled</b>]

Regards,

Ramganesan K