2016 Sep 06 8:17 AM
Hi all.
As far as i know ABAP allows only return by value.
Does it really mean that every time I do something like this data(foo) = bar( ), and bar() returns an internal table, table's content is copied in memory?
2016 Sep 06 9:26 AM
In what context? For method and function modules, for example, you can have pass by value or by reference.
Perhaps an example would help?
2016 Sep 06 9:54 AM
Matthew Billingham wrote:
In what context? For method and function modules, for example, you can have pass by value or by reference.
I guess the OP meant RETURNING parameters of functional methods. The formal RETURNING param can only be defined as pass-by-value.
Does it really mean that every time I do something like this data(foo) = bar( ), and bar() returns an internal table, table's content is copied in memory?
IMO, the same rule applies to pass-by-value for RETURNING parameter.
Actually there is an SCI-check which checks for the low performance of transfer between the actual & formal params of a procedure.
It states in the longtext of the documentation & i quote:
Return parameters (RETURNING)
Since RETURNING parameters are always VALUE parameters, performance can only be improved by changing the parameter type. The RETURNING value parameter must be transformed to an EXPORTING reference parameter.
BR,
Suhas