SAP EQUALS RETURN VALUES

Get Example source ABAP code based on a different SAP table
  


ARTICLE
• = ABAP_RETURN_VALUE

= - Assigning Return Values and Results

Syntax
destination = meth( ) | func( ) | constr_expr | table_expr .

Effect
If one of the following calls or expressions is specified on the right side of the assignment operator =, its return value or result is determined and assigned to the left side, destination. If necessary, type-dependent conversions are performed in accordance with the conversion rules. The following items are possible on the right side:
A functional method call meth( ) including method chainings. The return value of a function method or an attribute addressed using a method chaining always has a full type that must match the type of the left side.
A predefined function func( ). The type of the return value (which in some numeric functions can be dependent on the data type of the argument) must match the type of the left side.
A constructor expression constr_expr. The type of the result is determined by the type specified for the constructor expression and must match the type of the left side.
A table expression table_expr. The type of the result must match the type on the left side.
The following can be specified for destination: A variable that is compatible with the return value or to whose type the return value or result can be converted. An inline declaration DATA(var). The data type of the declared variable var is the statically detectable type of the return value or result.

Note
If an arithmetic expression is specified as an argument for one of the overloaded numeric functions, the function itself works like an arithmetic expression and its assignment is one of the assignments of arithmetic expressions. This can cause the conversions to be performed in a different order.
INTHINT If on the right side a single functional method call is
INTHINT given that is included by parentheses, the
INTHINT the parentheses are ignored and the right side is not
INTHINT treated like an arithmetic expression.

Example
Assigns the return value of a method to an internal table declared inline. METHOD m1.
DATA(itab) = m2( ).
...
ENDMETHOD.