I'm new to ABAP. Started learning about internal tables. I was reading on the ways to create internal tables.
I came across the following syntax to create an internal table from an existing database table:
data: it_mara type table of mara.
I'm confused since mara is a table and if both l.h.s and r.h.s are of the same type then shouldn't it be just:
data: it_mara type mara.
What is the need to convert mara into a table when it is already a table?
MARA
is a transparent table which means that it functions at the same time as the structure type MARA
. This is the way SAP works. :)
Historical reasons (always a good guess...).
The original and nowadays obsolete way to declare a table (with a header line was DATA it_mara TYPE mara OCCURS 10
. Without OCCURS
, you didn't declare a table, so it became a structure. My guess would be that in order to maintain backwards compatibility, that wasn't changed when TYPE TABLE OF
was introduced.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With