How to not screw up when returning a REF TO DATA
I’ve been using more and more references in ABAP.
I used to use REF TO only for classes but I’ve been finding more and more advantages in using them for other data types. But, just like in C++, care must be used when dealing with data references. Things can easily go very wrong.
In this article, I’ll try to show you how to use and how not to use REF TO DATA. Let’s start by an example of how not to do it.