CALL FUNCTION


Variant 4

CALL FUNCTION func DESTINATION dest.

Additions




1. The same as with CALL FUNCTION func
2. ... EXCEPTIONS syst_except = rc MESSAGE mess

Effect

Executes the function module externally as a Remote Function Call ( RFC ); dest can be a literal or a variable.
Depending on the specified destination, the function module is executed in another R/3 or R/2 System. Externally callable function modules must be flagged as such in the function library (of the target system).
Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.

You can maintain existing destinations by selecting Tools -> Administration -> Administration -> Network -> RFC .

Notes

Special destinations:

Note

Parameter passing. When you pass data to an externally called function module, there are some differences to the normal function module call:

Note

Passing structured data objects. Since transport to another system may require data conversion, the structure of field strings and internal tables must be known to the runtime system when the call is made. The structure of a field string or internal table is not known if it was defined with

... LIKE structure ,

if the structure passed was passed to the subroutine with the explicit addition STRUCTURE , or if it is a parameter of a function module.

In these cases, external calls can result in a conversion error.

Note

C interface. You can call externally callable function modules from C programs. It is also possible to store function modules in a C program and call them via CALL FUNCTION ... DESTINATION . For this purpose, SAP provides a C interface .

Addition 2

... EXCEPTIONS syst_except = rc MESSAGE mess

Effect

Function module calls with the addition DESTINATION can handle two special system exceptions:
SYSTEM_FAILURE

This is triggered if a system crash occurs on the receiving side.
COMMUNICATION_FAILURE

This is triggered if there is a connection or communication problem.
In both cases, you can use the optional addition

... MESSAGE mess

to receive a description of the error.

Note

Runtime errors


Index
© SAP AG 1996