CALL FUNCTION - DESTINATION parameter_list
Short Reference
ABAP Syntax ... [EXPORTING p1 = a1 p2 = a2 ...]
[IMPORTING p1 = a1 p2 = a2 ...]
[TABLES t1 = itab1 t2 = itab2 ...]
[CHANGING p1 = a1 p2 = a2 ...]
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[system_failure = ns [MESSAGE smess]]
[communication_failure = nc [MESSAGE cmess]]
[OTHERS = n_others]].
ABAP_ADDITIONS:
1 EXPORTING p1 = a1 p2 = a2 ...
2 IMPORTING p1 = a1 p2 = a2 ...
3 TABLES t1 = itab1 t2 = itab2 ...
4 CHANGING p1 = a1 p2 = a2 ...
5 EXCEPTIONS exc1 = n1 exc2 = n2 ...
What does it do? These additions are used to assign actual parameters to
the formal parameters of the remotely called function module, and return
values to exceptions that are not class-based. These additions have the
same basic meaning as they do in general
function module calls .
Unlike general function module calls, however, RFC generally
ignores the interface to incorrectly specified formal parameters. These
differences and others are described in the following.
ABAP_ADDITION_1 EXPORTING p1 = a1 p2 = a2 ...
ABAP_ADDITION_2 IMPORTING p1 = a1 p2 = a2 ...
What does it do? The following differences apply to the additions
EXPORTING and IMPORTING :
In character-like formal parameters, the actual parameter can have a
length different from the formal parameter. In the called function
module, a shorter actual parameter is padded with blanks on the right in
the input and truncated in the output. If the actual parameter is
longer, the reverse applies.
Reference variables cannot be
passed directly or as components of deep structures. As in general
function module calls, however, it is not possible to pass tables with
deep row types, structures, and strings.
When passing internal tables with non-unique table
keys , the order of the duplicate rows in relation to these keys is
not retained.
ABAP_ADDITION_3 TABLES t1 = itab1 t2 = itab2 ...
What does it do? When using TABLES to pass data to
table parameters , the difference
is that only tables with flat row types and no
secondary table key can be
passed, and that an existing header line
is not passed.
Latest notes: As long as basXML is not
configured as the RFC protocol , the classic
binary RFC protocol is used implicitly for TABLES
parameters, and not the XML format xRFC, which is otherwise used
for deep types. Passing internal tables using the TABLES
parameters can therefore be considerably faster in this case (depending
on the data passed) than with other parameters.
basXML is now used as a unified
format for all types of RFC communication. The binary RFC
protocol currently still has better performance than basXML , but
this will change in the future. The TABLES addition is therefore
only required for RFM s for which performance is currently
critical.
ABAP_ADDITION_4 CHANGING p1 = a1 p2 = a2 ...
What does it do? With respect to the addition CHANGING , the same
differences apply as to the additions EXPORTING and IMPORTING
.
ABAP_ADDITION_5 EXCEPTIONS exc1 = n1 exc2 = n2 ...
What does it do? The addition EXCEPTIONS is used to perform classic
non-class-based exception handling,
which works in essentially the same way as general function module
calls. In addition, however, the special
exceptions SYSTEM_FAILURE and COMMUNICATION_FAILURE can
be specified to handle the exceptions raised by the RFC interface
itself. An optional MESSAGE addition can also be specified after
these exceptions. If one of the special classic exceptions
system_failure or communication_failure is raised, the first
line of the associated short dump is
inserted in the smess or cmess field. This field which
must be a flat character-like field. If a remotely called function
module raises a class-based exception during non-class-based exception
handling, this exception is not transported and raises the predefined
classic exception SYSTEM_FAILURE instead
Latest notes: Specifying
error_message after EXCEPTIONS has no effect in the RFC
.
If the classic exception SYSTEM_FAILURE is raised when a
message of type "A", "E", or "X" is sent,
the smess field contains the message short text when MESSAGE
is specified.
Class-based exception handling in RFCs is not possible in this release
track.
Example ABAP Coding More information:
Exception Handling in RFC .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved