Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table return by value

maxim_schibnev
Explorer
0 Kudos

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?

2 REPLIES 2

matt
Active Contributor
0 Kudos

In what context? For method and function modules, for example, you can have pass by value or by reference.

Perhaps an example would help?

0 Kudos

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