ABAP - Keyword Documentation →  ABAP - Reference →  Data Interfaces and Communication Interfaces →  RFC - Remote Function Call →  RFC Overview → 

RFC Destination

The information about the target system of an RFC call is stored in the RFC destination.

Static Destinations

The attributes of destinations are defined statically and managed in AS ABAP using the transaction SM59. Every destination managed in transaction SM59 has a unique name that can be specified after the addition DESTINATION in RFC. For every destination, a connection type, the partner program, and the target system are defined in transaction SM59. Logon data and further connection options can also be defined in the destination.

Note

The documented function module RFC_MODIFY_R3_DESTINATION edits static destinations managed in transaction SM59.

Dynamic Destinations

In cases whether it is not enough to use the static destinations managed using transaction SM59, the associated attributes can be grouped as a dynamic destination. This is done using the class CL_DYNAMIC_DESTINATION. Its method CREATE_RFC_DESTINATION creates a text field that can be specified in the current internal session in RFC after the addition DESTINATION and interpreted as a destination by the runtime environment. A destination from transaction SM59 can also be used as a template and modified accordingly. The validity of the new destination is not checked until it is used for an RFC.

A dynamic destination has the characters %% as a prefix. These dynamic destinations must only be created using the class CL_DYNAMIC_DESTINATION and must never be added to programs from external sources. Further methods in the class make it possible to

Executable Example

Dynamic RFC Destination

Predefined Destinations

There are two predefined destinations that do not have to be entered using transaction SM59:

Note

If the predefined destination "NONE" is used, no password must be specified when the user session is opened. If an RFC is performed for the current application server using a destination defined in the transaction SM59, the settings on the application server dictate whether logon data needs to be specified or not.

Application Servers as Destinations

As well as the destinations created in transaction SM59, dynamic destinations, and the two predefined destinations, destinations can also be specified directly, in the form hostname_sysid_sysnr. hostname is the host name of the application server, sysid is the name of an AS ABAP, and sysnr is the system number as it is displayed using the transaction SM51.

The only systems that an be reached like this are the current systems or systems connected using a trust relationship. The logon data of the current user is used for the current system; in other systems, a logon must take place.

Note

This data can be specified dynamically without presenting a security risk.

More Information

For a detailed description of the RFC destination, see the

RFC documentation on SAP Help Portal.