cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Function Module

Former Member
0 Kudos

Hi all,

I need to create a RFC Function module, I have the RFC destination given, May I know any further seetings needed for a RFC Function Module.

Thanks

Mungala.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There is no much difference between normal Function Module.But after developing a FM, to make it RFC enabled you have to take care of the following things:

1. In attributes click the radiobutton 'REMOTE ENABLED' .

2. Pass all the parameters by 'Pass By Value' .

Regards,

Padmam.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Mungala,

Please checkout this previous Forum posting

<b></b>

Regards,

Aby Jacob

Former Member
0 Kudos

Hi again,

<b>http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE2/BCFESDE2.pdf</b>

Thanks,

Aby Jacob

Former Member
0 Kudos

Hi Guys,

Is there anyway to indentify whether function module or code being called through other system to do some programming for local call and RFC call on a program.

Former Member
0 Kudos

Hi Mungala,

Please checkout the below URL


http://help.sap.com/saphelp_nw04/helpdata/en/22/042537488911d189490000e829fbbd/frameset.htm

CALL FUNCTION - RFC (RFC Variants)

Synchronous RFC

1. CALL FUNCTION func DESTINATION dest

parameter_list.

Asynchronous RFC

2. CALL FUNCTION func STARTING NEW TASK task

DESTINATION {dest

parameter_list

{PERFORMING subr}.

Transactional RFC

3. CALL FUNCTION func IN BACKGROUND TASK

parameter_list

.

======================

Displaying, Maintaining, and Testing Destinations

To display, create, or change destinations, choose the following from the SAP menu: Tools ® Administration ® Administration ® Network ® RFC Destinations (transaction SM59).


Remote destinations are stored in the table RFCDES. The table RFCDES describes logical destinations for remote function calls (RFCs). You cannot maintain the table RFCDES directly.
http://help.sap.com/saphelp_nw04/helpdata/en/22/042537488911d189490000e829fbbd/frameset.htm

Thanks,

Aby Jacob

Former Member
0 Kudos

hi

<b>RFC ( Remote Function calls )</b>

A remote function call is a call to a function module running in a system different from the caller's. The remote function can also be called from within the same system (as a remote call).

RFC consists of two interfaces : A calling interface for ABAP Programs and a calling interface for Non-SAP programs.

Any ABAP program can call a remote function using the CALL FUNCTION...DESTINATION statement. The DESTINATION parameter tells the SAP System that the called function runs in a system other than the caller's.

<b>RFC CLIENT and RFC SERVER</b>

RFC client is the instance that calls up the Remote Function Call to execute the function that is provided by an RFC server.

The RFC Interface takes care of :-

- Converting all parameter data to the representation needed in the remote system

Calling the communication routines needed to talk to the remote system.

Handling communications errors, and notifying the caller, if desired ( using EXCEPTIONS paramater of the CALL FUNCTION).

<b>Calling Remote function modules</b>

You can use the CALL FUNCTION statement to call remote functions by including an additional DESTINATION clause.

CALL FUNCTION ‘remotefunction’

DESTINATION dest

EXPORTING f1 =

IMPORTING f2 =

TABLES t1 =

EXCEPTIONS

The field ‘dest’ can be either a literal or a variable. Logical destinations are defined in the RFCDES table via transaction SM59 or via the menu path: Tools ->Administration,Administration->Network->RFC destinations.

<b>Calling remote functions locally :-</b>( i.e. call a remote function within the same system )

The two options to do this are –

CALL FUNCTION...DESTINATION = 'NONE'

CALL FUNCTION... [no DESTINATION used]

<b>Calling remote function modules BACK :-</b>

The remote function can invoke its own caller (if the caller is itself a function module), or any function module loaded with the caller.

You can trigger this call-back mechanism using

CALL FUNCTION... DESTINATION 'BACK‘.

<b>Types of RFC’s</b>

Synchronous RFC – The calling program continues the execution only after the called function is complete.

Asynchronous RFC - The calling program continues the execution without waiting for return from the called function.

Eg: CALL FUNCTION ‘remotefunction’ STARTING NEW TASK ‘taskname’.

Transactional RFC - The called function module is executed exactly once in the RFC server system.Each function call is seen as a transaction in the target system. Transactional RFCs use the suffix IN BACKGROUND TASK .

Eg : CALL FUNCTION ‘remotefunction’ IN BACKGROUND TASK

<b>Writing remote function modules</b>

In the function module attributes tab (transaction code SE37), set the processing type as Remote-enabled module to create a remote function module.

Write the code for the function module.

Define the destination of the RFC server in the RFC client system that calls the remote function ( via SM59 transaction).

Declaring Parameters: All parameter fields for a remote function module must be defined as reference fields, that is, like ABAP Dictionary fields.

Exceptions: The system raises COMMUNICATION_FAILURE and SYSTEM_FAILURE internally. You can raise exceptions in a remote function just as you would in a locally called function.

<b>Debugging Remote function calls</b>

It is not possible to debug a remote function call to another system.

However, when testing ABAP-to-ABAP RFC calls, you can use the ABAP debugger to monitor the execution of the RFC function in the remote system.

With remote calls, the ABAP debugger (including the debugging interface) runs on the local system. Data values and other run information for the remote function are passed in from the remote system.

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Former Member
0 Kudos

Hi

While you are creating Function module,it attributes make it as Remote Enabled call.

Go to Tcode SM59 and configure the settings.

Thanks