Application Development 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: 

internal table declarations

Former Member
0 Kudos

hi,

please see these declarations, also in debugging screen, I see differentely

data: it_mara like mara,

it1_mara like standard table of mara,

it2_mara like standard table of mara with header line,

it3_mara like mara occurs 0 with header line.

is there any difference in it2_mara and it3_mara, which is the right way to declare in modern ABAP.

Also, I have noted that technically we should say internal table only when it is having a header line, Is this right ??

As I see table ICON in debugging only ITAB with header line only, some times it just say 'Table [initial]' and some time is show values.

how is the difference, please let me know.

thank you

regards

madhu

1 ACCEPTED SOLUTION

former_member583013
Active Contributor
0 Kudos

Correct form should be this one...


DATA: it1_mara type standard table of mara.

<i>with header line</i> and <i>occurs 0</i> are forbidden on OO ABAP...Internal tables shouldn't have header lines...

When <i>Initial</i> it's because there's no record inside the table...Also, it have been created but nothing attached to it -:)

Greetings,

Blag.

2 REPLIES 2

former_member583013
Active Contributor
0 Kudos

Correct form should be this one...


DATA: it1_mara type standard table of mara.

<i>with header line</i> and <i>occurs 0</i> are forbidden on OO ABAP...Internal tables shouldn't have header lines...

When <i>Initial</i> it's because there's no record inside the table...Also, it have been created but nothing attached to it -:)

Greetings,

Blag.

Former Member
0 Kudos

madhu,

OCCURS 0 specifies that it is an internal table which as 0 lines allocated to memory, and the HEADER LINE, means that there is an implicit header line or work area, so you do not need to create a separate explicit workarea in which to read the data into.

in simple words.....

occurs provide initial memory... if u want to give more memory then occurs 1 or 2 or 3 also u can give..

with header line.. with it provides a work area which u dont need to create again.