... [EXPORTING p1 = a1 p2 = a2 ...]
{ {[IMPORTING p1 = a1 p2 = a2 ...]
[CHANGING p1 = a1 p2 = a2 ...]}
| [RECEIVING r = a ] }
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[OTHERS = n_others] ].
1. ... EXPORTING p1 = a1 p2 = a2 ...
2. ... IMPORTING p1 = a1 p2 = a2 ...
3. ... CHANGING p1 = a1 p2 = a2 ...
4. ... RECEIVING r = a
5. ... EXCEPTIONS exc1 = n1 exc2 = n2 ...
6. ... OTHERS = n_others
With the exception of addition EXCEPTIONS, these additions
assign actual parameters a1 a2... to the formal parameters
p1 p2 ... or r
of the parameter interface of method meth. All data objects with a data type that matches the
type assignment of the corresponding formal parameter can be specified as actual parameters (see
typing check). With the exception of return value r for
functional methods, every formal
parameter assumes all attributes of the assigned actual parameters at calling time. You can handle non-class-based exceptions using addition EXCEPTIONS.
... EXPORTING p1 = a1 p2 = a2 ...
If non-optional input parameters are defined for the called method in statement
METHODS or CLASS-METHODS
after IMPORTING, actual parameters must be assigned to
these using EXPORTING. Actual parameters can be assigned
to optional input parameters. At the time of the call, either a reference to an actual parameter is
passed, or the content of an actual parameter is assigned to the relevant formal parameter, depending on the passing type.
... IMPORTING p1 = a1 p2 = a2 ...
If output parameters are defined for the called method in statement METHODS or CLASS-METHODS after
EXPORTING, actual parameters can be assigned to these using IMPORTING. In the case of
passing by value, the content of a formal parameter can only be assigned to the relevant actual parameter if the method ends without errors.
... CHANGING p1 = a1 p2 = a2 ...
If non-optional input/output parameters are defined for the called method in statement METHODS or CLASS-METHODS after
CHANGING, actual parameters must be assigned to these
using CHANGING. Actual parameters can be assigned to optional
input/output parameters. At the time of the call, either a reference to an actual parameter is passed, or the content of an actual parameter is assigned to the relevant formal parameter, depending on the passing type. In the case of
passing by value, the content of a formal parameter is only assigned to the relevant actual parameter if the method ends without errors.
... RECEIVING r = a
If a return value is defined for the called method in METHODS or CLASS-METHODS after RETURNING, an actual parameter can be assigned to this using RECEIVING. The data type of the actual parameter does not have to comply with the rules of typing syntax; it is sufficient if the formal parameter can be converted to the actual parameter in accordance with the conversion rules.
If the method ends without errors, the content of the formal parameter is assigned to the actual parameter. The content is converted if necessary.
A functional method with a return value is not usually called with CALL METHOD, but at
operand positions.
... EXCEPTIONS exc1 = n1 exc2 = n2 ...
... OTHERS = n_others
With EXCEPTIONS, you can assign return values to non-class-based exceptions exc1 exc2 .... A literal must be assigned to every exception exc1 exc2 ... that the caller is interested in. By specifying OTHERS asthe last entry after EXCEPTIONS, you can assign a common return value to all exceptions that are not explicitly included in the list exc1 exc2... by assigning a number literal n_others.You can assign the same return value to different exceptions (including OTHERS).
If an exception exc1 exc2 ... that has a return value assigned to it is raised in the method with statement RAISE or MESSAGE RAISING, the method is terminated immediately. Output parameters passed by a value, and the return value are not supplied, and the number n1 n2 ... assigned to the exception is available for evaluation in sy-subrc. If no exception is raised, a method call sets sy-subrc to 0.
If the caller of an exception raised by RAISE has not assigned a return value, the program terminates with a runtime error. If the caller of an exception raised by MESSAGE RAISING has not assigned a return value, the message is sent and the system continues according to the message type.
Since release 6.10, methods can propagate class-based exceptions rather than raising non-class-based exceptions, if these are declared in the interface with RAISING. The addition EXCEPTIONS must not be specified for these.