Application Development and Automation 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: 
Read only

Internal tables without header lines

Former Member
0 Likes
1,230

When is it convenient to use internal tables without header line?

Example:

DATA: i_table TYPE STANDARD TABLE OF table,

wa_table TYPE table.

LOOP AT i_table INTO wa_table.

...

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

varma_narayana
Active Contributor
0 Likes
1,147

Hi

Internal tables with header lines has the following limitations.

1. We cannot use them as components while declaring Nested internal tables.

2. ABAP Objects does not support Internal table with header line.

3. Processing internal tables in a loop using field symbol gives better performance bcoz it does not involve copying the data from body to workarea/header line.

<b>Reward if helpful.</b>

7 REPLIES 7
Read only

former_member194669
Active Contributor
0 Likes
1,147

Hi,

Performance wise Workarea is faster in a loop

if you need better performance then

field-symbols : <fs> type any.

loop at itab assigning <fs>.

endloop

aRs

Read only

Former Member
0 Likes
1,147

Its always better performance wise to use internal table without header lines and using a work area to move data.

Read only

Former Member
0 Likes
1,147

I have one simple what i understand with internal table header line and without header line.

1. performance point of view - without header line is good than with header line.

2. you can't use with header line in oo ABAP.

See the simple example to calculate the time taken by each query

Internal table with header line :

data : begin of itab occurs 0 ,

matnr like mara-matnr,

end of itab.

data : a type i,

b type i,

c type i.

start-of-selection.

get run time field a.

select matnr from mara into table itab.

loop at itab.

write:/ itab-matnr.

endloop.

get run time field b.

c = b - a.

write c. -> look at C value ( Micro seconds)

Internal table without header line.

types : begin of ty_itab,

matnr type mara-matnr,

end of ty_itab.

data itab type standard table of ty_itab.

data wa_itab like line of itab.

data : a type i,

b type i,

c type i.

start-of-selection.

get run time field a.

select matnr from mara into table itab.

loop at itab into wa_itab.

write:/ wa_itab-matnr.

endloop.

get run time field b.

c = b - a.

write c. -> see the C value

now compare first query time and second query time.

Thanks

Seshu

Read only

Former Member
0 Likes
1,147

Actually if you "Extended Check" the program (Program > Check > Extended Program Check) , you will find that tables with header line is obsolete. So its better to use working area or field symbols.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,147

Hi,

In OOPS environment it is not possible to use internal table with header lines.

Read only

Former Member
0 Likes
1,147

Internal tables with header line are obsolete now..

functionality of itabs with header line will be removed in future version..

Regards

Prax

Read only

varma_narayana
Active Contributor
0 Likes
1,148

Hi

Internal tables with header lines has the following limitations.

1. We cannot use them as components while declaring Nested internal tables.

2. ABAP Objects does not support Internal table with header line.

3. Processing internal tables in a loop using field symbol gives better performance bcoz it does not involve copying the data from body to workarea/header line.

<b>Reward if helpful.</b>