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: 

what are the advantages using internal tables without headerline.

Former Member
0 Kudos

hi,

i have a doubt,please clarify.

data:itab like <databse table> occurs 0 with header line.

or

data:itab like <databse table>occurs 0,

wa like line type of itab.

in above two cases , in my view no difference.

in first case there will be one workarea will be created with same name itab,

in second case we are explicitly creating work area.

ok.

here my doubt is in what cases it is madatory to create internal table with explicitly work area?

thank in advance.

venu

3 REPLIES 3

Former Member
0 Kudos

In object oriented programing , you can't use the table with header line.

Former Member
0 Kudos

Hi,

It is a good practice to define a structure for your internal table. Then declare an internal table with the defined structure. Using a workarea to access to the internal table.

TYPES : BEGIN OF struc_tab,

rec1(10) TYPE c,

END OF struc_tab.

DATA : itab TYPE TABLE OF struc_tab,

wa_itab LIKE LINE OF itab.

There is no differences, just that we're avoiding declaring using 'With Occurs 0' or 'With Header Line' and in some cases in oo programming, headerline are not allowed.

Regards,

Loo

stamik
Explorer
0 Kudos

HEADERLINE is obsolote, and OCCURS is also obsolete.

use this syntax instead:

DATA: itab TYPE STANDARD TABLE OF <dbtab>,

wa_itab TYPE <dbtab>.

the reason why you should not use headerline is simple - its confusing because "itab" refers to both a structure and an internal table.

For more info, use the Extended Program Check or the Code Inspector tool. In fact, you should always run one of these tools before handing your development over for tests..