Professional Documents
Culture Documents
Sap - nw73 - Connectivity - RFC - 01 - RFC Basics - en - 48 PDF
Sap - nw73 - Connectivity - RFC - 01 - RFC Basics - en - 48 PDF
Sap - nw73 - Connectivity - RFC - 01 - RFC Basics - en - 48 PDF
The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.
Note
This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.
2015 SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP SE. The information contained herein may be changed without prior notice. Some software products marketed by SAP SE
and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by
SAP SE and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be
liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express
warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other
SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE in Germany and other
countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
Table of content
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 1 of 8
Table of content
1 RFC Basics
1.1 RFC Interface
1.2 RFC Communication Scenarios
1.3 RFC Destinations
1.4 RFC System Fields
1.5 RFC Authorizations
1.6 Code Pages
1.7 Maintaining Trust Relationships between SAP Systems
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 2 of 8
1 RFC Basics
Use
This section provides an introduction to the basic elements of RFC.
Here, you can learn about:
how the RFC Interface functions
the functionality provided by RFC
the technical requirements for RFC with SAP and external systems.
This section provides information about the following topics:
RFC Interface
RFC Communication Scenarios
RFC Destination
RFC System Fields
RFC Authorizations
Code Pages
Maintaining Trust Relationships between SAP Systems
Note
It is also possible to call a function module is the system by RFC. Normally though, the caller and the called function module are in different systems.
In the SAP system, these functions are provided by the RFC interface system. The RFC interface enables function calls between two SAP systems, or between
an SAP system and an external system.
The RFC interface system is made up of the following elements:
Calling interface for ABAP programs
Each ABAP program can call a remote function module using the command CALL FUNCTION...DESTINATION. The parameter DESTINATION informs the
SAP system that the called function module runs in a different system to the calling system. RFC communication with the remote system takes place as a
part of the CALL FUNCTION command.
RFC function modules in an SAP system must be real function modules and must be registered as remote enabled in the SAP system.
If the calling program and the called program are both ABAP programs, the RFC interface provides both communication partners. The calling program can
be any ABAP program. The called program must be a function module that is registered as remote enabled.
Interfaces for calling non-ABAP programs
If either the calling program or the called partner is not an SAP program, the program in question must be programmed in such a way that it can play the
role of the other partner in RFC communication.
RFC-supported and GUI-supported interfaces can be used by external programs to call function modules in SAP systems, and execute them in these
systems. Likewise, ABAP programs can also use these interfaces to use functions supplied by external programs.
Note
SAP provides a special RFC API for this purpose.
More Information
You can find more information about calling remote-enabled function modules in:
Calling RFC Function Modules in ABAP
You can find more information about writing function modules that you want to call remotely in:
Writing Remote Function Modules in ABAP
If you want to set up an RFC communication with external systems, read:
The RFC API
ABAP
ABAP
ABAP
ABAP
- AS ABAP
- External system
- SAP Java (SAP NetWeaver Application Server)
- External Java system
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 3 of 8
In this scenario, two SAP systems - actually two AS ABAP systems - communicate with each other. Here, the data exchange between the two partner systems is
made via the RFC interface. An additional conversion of the data format is not necessary.
Scenario 1: ABAP-ABAP
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 4 of 8
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 5 of 8
The server of the called function module must be available for sRFC and aRFC calls.
To be able to call a function module using the RFC interface, the function module in question must be flagged as being remote-capable in its properties, and for
its interface parameter, only value transfer is allowed. Only the value transfer is allowed for its interface parameter. Even for table parameters, a pass by value is
performed implicitly. Within the system in which they are defined, remote-capable function modules can either be called using the RFC interface, or like normal
function modules. The normal call is made using the statement CALL FUNCTION without using one of the additions DESTINATION, STARTING NEW TASK or
IN BACKGROUND TASK, IN BACKGROUND UNIT.. When making the call using the RFC interface, you must either specify the special destination "NONE"
(see below), or you must perform an aRFC or transactional RFC without specifying a destination.
All the possible destinations are stored in the database table RFCDES, whose content is managed using transaction SM59. When calling a function module
remotely from an ABAP program, the destination is specified using addition DESTINATION of the statement CALL FUNCTION, in the form of a key value in
column RFCDEST of database table RFCDES. The relevant rows of the database table contain all parameters defined in transaction SM59 that are used for
communicating with the external system.
There are two predefined destinations that do not have to be entered using transaction SM59:
Destination "NONE" has the effect that the function module is started on the same application server as the calling program, however through the RFC
interface and in its own RFC context . This destination is possible for all types of call.
Destination "BACK" can be used in a function module that is called remotely, and links back to the caller. You can only specify this in function modules that
have been called synchronously. Destination "BACK" can be used to call each remote-capable function module of the calling system in all methods. For a
synchronous callback, the relevant function group is loaded into the internal session of the calling program, if it is not yet available there. The existint RFC
connection is used for this callback.
As well as the destinations created in transaction SM59 and the two predefined destinations, you can also specify destinations directly, in the form
"hostname_sysid_sysnr". Here, "hostname" refers to the name of the application server, "sysid" is the name of an SAP system, and "sysnr" is the system
number, as is displayed using transaction SM51, for example.
More Information
You can find an overview of other authorization objects in the RFC environment in the RFC Security Guide, under:
Authorizations
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 6 of 8
The RFC between a Unicode system and a non-Unicode system has to convert the text data between the code pages used on both sides. Here, the following
situations are possible:
An input character cannot be converted into the output code page.
Example: A Chinese Unicode character cannot be displayed in any European code page according to ISO8859.
The conversion leads to an overrun of the output buffer.
Example: A sequence of Japanese Unicode characters may cause an output buffer of the same length to overrun, when converting into the Japanese
multibyte code page SHIFTJIS.
Characters in the input data are incorrect; for example, in non-Unicode multibyte code pages, not all combinations of 2 bytes are permitted.
Example: The Japanese code page SHIFTJIS (SAP number 8000) is a multibyte code page that has byte pairs whose first half lies in the range 0x800xEF, and whose second half lies in the range 0x40-0xFC. All other byte pairs are illegal and therefore cannot be converted. Data containing characters of
this kind are therefore already incorrect before conversion. They may have entered the system from outside, through uncontrolled channels, or may be the
result of using unsuitable text processing operations in the system.
RFC Between Unicode Systems and MDMP Systems
If the RFC is place between a Unicode system and a non-Unicode system with multiple code pages (MDMP system), the data is available on the MDMP side in
different code pages. In this case, the RFC takes into account the language keys included in the date, and assigns the code page used in the MDMP system to
each language.
The procedure described here is applied to tables of type 1 (these tables normally have a flat row structure). The RFC transmits deep structures in XML, and
codes the text data in UTF-8. If a non-Unicode system receives data like this, it converts it into the code page for the logon language. If a non-Unicode system
sends this type of data, it converts it from the code page that is currently set.
The language-compatible conversion of the data takes place in the Unicode systems. Here, the Unicode systems emulate non-Unicode systems, thereby
ensuring compatibility with old non-Unicode systems (downward compatibility).
During conversion, the Unicode system assigns the MDMP code page to the languages, as follows:
MDMP system calls Unicode system
The MDMP system passes on its assignment of languages to code pages in the RFC
log. For older MDMP systems, the Unicode system uses a predefined assignment list.
See Settings for Code Pages
The assignment is specified in the Unicode system, for the RFC destination. Transaction
SM59 enables you to display and maintain the assignment.
Note
If tables are defined as deep structures in an import, export or changing parameter, then the language is not evaluated.
Structures Without LANG Fields
If a structure does not have a LANG field, or if none of the LANG fields are flagged as the text language, the Unicode system performs the conversion as follows:
MDMP system calls Unicode system
Converts to the non-Unicode code page that is normally assigned to the logon language
(in the Unicode system). You also have the option of using the logon language for the
RFC destination (instead of that of the current context), by making a special setting for
the RFC destination in SM59 call transaction SM59 and selecting the RFC Bit Options
for this destination on the Special Options tab page in section Special Flags . Then
select the checkbox Determined Communication Code Page (hexadecimal value
0x200).
Note
In particular, IDocs that are used in the ALE interfaces do not have a language ID.
Unknown Languages
The transferred data might contain a language that is unknown in the MDMP system configuration. This can occur in both transfer directions, and independently of
the client/server role of the systems involved.
Data may also contain a LANG field with the value " " (space), although this value is invalid according to the value table. Here, the same rules apply as for
structures without LANG fields (see above).
Unicode system calls MDMP system
The RFC terminates with the error SYSTEM_FAILURE. In this case, you can activate
the user trace (SM04), in whose output you can find information about the unknown
language.
The RFC terminates with the error SYSTEM_FAILURE and sets the error message to
"Connection closed (no data)". You can find the unknown language by activating the user
trace in the MDMP system (SM04), repeating the RFC, and analyzing the trace files of
the called Unicode system.
Page 7 of 8
Note
For extra security, you can use SAP's SNC Interface ( Secure Network Communications) for third-party security systems such as Kerberos and SECUDE.
You can configure multiple SAP systems as mutual trusted systems. Setting up a trust relationship between two systems is normally initiated by the called
system (server system). Here, users of the calling system who are allowed to make RFC calls by this type of trust relationship must be identified in the called
system (trusted users).
Before a calling system can be defined, a destination must be created for this system in the calling system. The RFC users also need the relevant authorizations
in the calling system (authorization object S_RFCACL). You can check the authorizations for the logged on users in the calling system in advance, by using the
function module AUTHORITY_CHECK_TRUSTED_SYSTEM.
More Information
You can find detailed information about maintaining trust relationships in:
Maintaining Trust Relationships between SAP Systems
PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 8 of 8