Calling Remote Functions Locally

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.)

CALL FUNCTION Remotefunction

DESTINATION ‘NONE’

 

EXPORTING

F1 = a1

 

F2 = a2

TABLES

t1 = ITAB

EXCEPTIONS

...

Local Call:

·        CALL FUNCTION...   [no DESTINATION used]

This is a local call, even though the function module is registered as remote. The module does not run in a separate roll area, and is essentially like a normal function call. Parameter transfer is handled as for normal function modules. In particular, if the call leaves some EXPORTING parameters unspecified, it terminates abnormally.

CALL FUNCTION Remotefunction

EXPORTING

F1 = a1

 

F2 = a2

TABLES

t1 = ITAB

EXCEPTIONS

...

You can also call a function for parallel processing within the same system. For more details, see Parallel Processing with Aynchronous RFCs.

Calling Remote Functions