Supported by
Supported by Inetum

Easily modify internal table record

images/thumbnail.jpg - Thumbnail

The new way to get data from internal tables is also the new way to put data into internal tables.

In the past, in order to modify data in an existing internal table record, you could either LOOP it into a structure, update the structure and then use MODIFY, or READ TABLE into a FIELD-SYMBOL which you could then modify. What were they thinking?

With 7.4, you can now get data from an internal table in this very simple way which I’m sure you’re already using:

DATA(text) = itbl[ kunnr = customer ]-text.

But did you know that this also works for modifications?

itbl[ kunnr = customer ]-text = text.

Maybe this was already obvious to everyone but me. I just realised it some days ago. If you knew it already… well, sorry about it.

Photo credit: mvongrue.

Greetings from Abapinho.