ABAPCALL_METHOD_PARAMETERS - CALL METHOD PARAMETERS

General Data in Customer Master   PERFORM Short Reference  
This documentation is copyright by SAP AG.

CALL METHOD - parameter_list

Short Reference



Syntax

...    [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] ].

Additions

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

Effect

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 thetyping of the corresponding formal parameter according to the rules of thetyping check can be specified as actual parameters.Functions and expressions can also be passed toinput parameters as actual parameters (as of Release 7.1).

With the exception of the return code r forfunctionalmethods and arithmetic expressions for input parameters, every formal parameter assumes all attributesof the assigned actual parameters when called. You can handle non-class-based exceptions using the addition EXCEPTIONS. The order of the additions is fixed.

Addition 1

... EXPORTING p1 = a1 p2 = a2 ...

Effect

If non-optional input parameters are defined for the called method in statement METHODSor CLASS-METHODSafter IMPORTING, actual parameters must be assigned to these using EXPORTING. Actual parameterscan be assigned to optional input parameters. When called, either a reference to an actual parameteris passed, or the content of an actual parameter is assigned to the relevant formal parameter, depending on the passing type.

From Release 7.1, you can specify functionsand expressions as actual parameters for input parameters. In this case, special rules apply.

Note

In particular, specifying arithmetic expressions as actual parameters entails the use of functional methods.

Addition 2

... IMPORTING p1 = a1 p2 = a2 ...

Effect

If output parameters are defined for the called method in statement METHODSor CLASS-METHODS after EXPORTING, actual parameters can be assigned to these using IMPORTING. In the case ofpassingby value, the content of a formal parameter is only assigned to the relevant actual parameter if the method ends without errors.

Addition 3

... CHANGING p1 = a1 p2 = a2 ...

Effect

If non-optional input/output parameters are defined for the called method in statement METHODSor CLASS-METHODSafter CHANGING, actual parameters must be assigned to these using CHANGING. Actual parameterscan be assigned to optional input/output parameters. When called, either a reference to an actual parameteris passed, or the content of an actual parameter is assigned to the relevant formal parameter, depending on the passing type. In the case ofpassingby value, the content of a formal parameter is only assigned to the relevant actual parameter if the method ends without errors.

Addition 4

... RECEIVING r = a

Effect

If a return code is defined for the called method in METHODSor CLASS-METHODSafter 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 general rules of thetyping check; it is sufficient if the return code can be converted to the actual parameter in accordance with theconversion 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.

Note

A functional method with a return code is not usually called with CALL METHOD, but inoperand positions.

Addition 5

... EXCEPTIONS exc1 = n1 exc2 = n2 ...

Addition 6

... OTHERS = n_others

Effect

You can use EXCEPTIONS to assign return values tonon-class-basedexceptions exc1 exc2 .... Each exception exc1 exc2 ... that the caller wants to handlemust be assigned to a number literal n1 n2 .... You can specify all numbers between 0 and 65535. The behavior outside of this range is undefined.

By specifying OTHERS as the last item after EXCEPTIONS, you can assign all exceptionsnot listed explicitly in exc1 exc2... a common return code, by assigning a number literal n_others. You can assign the same return code to different exceptions (including OTHERS).

If the statement RAISE or MESSAGERAISING is used to raise an exception exc1 exc2 ... (to which a return code is assigned)the method is ended immediately, any output parameters or return codes passed by value are canceled,and the number n1 n2 ... assigned to the exception is available to be evaluated 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 code, the program terminates with a runtime error. If the caller of an exception raised by MESSAGE RAISING has not assigned a return value, themessage is sent and the system continues according to the message type.

Methods that use RAISING to declareclass-based exceptions in the interface cannot have the EXCEPTIONS addition specified in their calls.

Note

If the value 0 is assigned to an exception, this indicates that the caller wants to ignore this exception. If the exception is raised in the method, no runtime error occurs, but the exception cannot be handled.


Vendor Master (General Section)   General Data in Customer Master  
This documentation is copyright by SAP AG.


Length: 10026 Date: 20120518 Time: 201400     triton ( 296 ms )