Skip to Content

Internal table return by value

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 06, 2016 at 08: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?

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.