Application Development and Automation 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: 
Read only

ABAP 7.4 inline data declaration/ memory allocation

Former Member
0 Likes
1,076

Hi,


Someone in my organization is trying to tell me that using inline data declaration uses more heap memory than standard data declaration/assignment.

Is there any truth in this statement or are they misinformed?

Cheers,

2 REPLIES 2
Read only

Former Member
0 Likes
743

AFAIK they are misinformed. The inline data declaration is just shorthand for the same statement without the inline data declaration preceded with the needed data declaration. However if you were used to reusing variables more for different tasks with the actual data declaration then you do now with inline declarations, they are right.


Also, it's an easy thing to quickly test.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
743

Gerrit Beukema is right.

As the documentation says

  • A valid statement with an inline declaration of a variable can generally be interpreted as a short form for a declaration statement used as a direct prefix.
DATA var TYPE ...
... var ...

Why should that use more memory? Especially why heap memory? Named data objects that are declared with declarations - whether inline or not - occupy stack memory.

They are misinformed, and I wonder where that misinformation comes from ...

(as Gerrit says, only if you declare much more data than before, instead of reusing helper variables, you increase the memory usage, but that's explicit, not implicit)