2007 Jul 13 5:47 AM
Hi all,
can any one explain which will be better performance wise,
internal table with headerline or without headerline
and why?
any useful suggestion will be rewarded.
Regards
cnu
2007 Jul 13 8:36 PM
at any point of time use internal table without header line,it will be good performance as well OO ABAP will allow only internal table without header line.
Just use one simple example :
create one simple program with header line,use get run time field.
create one simple program without header line,use get run time field.
see the results ,here time will be micro seconds,so take 1000 records to internal table and do calculate the time.
Thanks
Seshu
at any point of time use internal table without header line,it will be good performance as well OO ABAP will allow only internal table without header line.
Just use one simple example :
create one simple program with header line,use get run time field.
create one simple program without header line,use get run time field.
see the results ,here time will be micro seconds,so take 1000 records to internal table and do calculate the time.
Thanks
Seshu
2007 Jul 13 6:52 AM
Hi,
I dont think there is any difference in performance in any of the case, but the extension with header line is not allowed in abap objects so it is adviced not to avoid using that.
2007 Jul 13 6:54 AM
2007 Jul 13 10:21 AM
Hi,
Internal tables without header lines are better performance wise, then internal table with header lines. That is why, now a days its not recomended to use internal table with header line. But a seprate work area can be made to work around with header line.
hope this clears ur doubt..
2007 Jul 13 11:07 AM
As for performance: use field symbols !!! This will greatly improve performance.
In general I'd discourage using itabs with header line as this is often ambigious such as in FORM myform TABLES ...
Besides, the outside world (such as java) doesn't know about itabs with header lines, so for future use in NetWeaver applications and the like this will cause headaches.
2007 Jul 13 11:17 AM
HI
all ways declare internal table structure firt
like
types : begin of it_tab1,
f1(20),
f2(40),
f3(20),
end of it_tab1.
data : it_tab2 type it_tab1 occurs 1,
wa_tab2 type it_tab1,
in the performance way this is good to use
regards
naresh
2007 Jul 13 8:20 PM
Any performance improvements by using header lines, work areas or field symbols is inconsequential. There are far bigger things to worry about first:
REPORT ztest MESSAGE-ID 00.
DATA: BEGIN OF itab_old OCCURS 0,
f1,
END OF itab_old.
TYPES: BEGIN OF data_area,
f1,
END OF data_area.
DATA: itab_and_wa TYPE TABLE OF data_area WITH HEADER LINE,
itab_only TYPE TABLE OF data_area,
wa_only TYPE data_area.
FIELD-SYMBOLS: <fs> TYPE data_area.
DATA: start TYPE i,
end TYPE i,
dif TYPE i.
* Fill the internal tables
DO 50 TIMES.
APPEND INITIAL LINE TO: itab_and_wa,
itab_only,
itab_old.
ENDDO.
* Take a number of readings
DO 5 TIMES.
* First check the performance of various internal tables
GET RUN TIME FIELD start.
LOOP AT itab_old.
ENDLOOP.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time to loop internal table with OCCURS :',
dif, 'microseconds'.
GET RUN TIME FIELD start.
LOOP AT itab_and_wa.
ENDLOOP.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time to loop internal table with header :',
dif, 'microseconds'.
GET RUN TIME FIELD start.
LOOP AT itab_only INTO wa_only.
ENDLOOP.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time to loop internal table without header:',
dif, 'microseconds'.
GET RUN TIME FIELD start.
LOOP AT itab_only ASSIGNING <fs>.
ENDLOOP.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time to loop internal table with ASSIGNING:',
dif, 'microseconds'.
* Check the performance of nested loops
GET RUN TIME FIELD start.
LOOP AT itab_old.
LOOP AT itab_and_wa.
LOOP AT itab_only INTO wa_only.
LOOP AT itab_only ASSIGNING <fs>.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD end.
dif = end - start.
WRITE: /001 'Time for nested loop over four tables :',
dif, 'microseconds'.
SKIP.
ENDDO.Rob
Message was edited by:
Rob Burbank
2007 Jul 13 8:36 PM
at any point of time use internal table without header line,it will be good performance as well OO ABAP will allow only internal table without header line.
Just use one simple example :
create one simple program with header line,use get run time field.
create one simple program without header line,use get run time field.
see the results ,here time will be micro seconds,so take 1000 records to internal table and do calculate the time.
Thanks
Seshu
2007 Jul 13 8:46 PM
Seshu - that's exactly what the program I posted above does (except for the part about showing that internal tables without header lines are better for performance
Rob
2007 Jul 13 8:59 PM
Dear Rob,
I opened thread and gave the answer,my writting skills is very slow.
once i posted then i saw your post.
sorry for that.
Thanks
Seshu
2007 Jul 13 9:02 PM
I know what you mean - the forum is so sssllloooowwww lateley.
Rob
2007 Jul 16 4:10 AM
Use internal without header line, if possible , use field symbols !
it will imporve your code performance .
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |