04-30-2009 9:25 AM
Hi Experts,
Data : itab01 LIKE pa0001 occurs 0 with header line.
DATA: BEGIN OF pernr_struc.
DATA: pernr LIKE pa0001-pernr.
DATA: END OF pernr_struc.
DATA: pernr_list LIKE pernr_struc OCCURS 0 WITH HEADER LINE.
A. Move itab01[] to p_list[].
B. Loop at itab01.
APPEND itab01-pernr TO pernr_list.
Endloop.
Can anybody please kindly tell me that which is faster? A or B.
Please...
Thank you..
Sean
Moderator message - Performance tuning is what you do after the program is working - post locked
Edited by: Rob Burbank on Apr 30, 2009 9:00 AM
04-30-2009 9:29 AM
if your at itab01 and pernr_list are having exactly the same and same no of fields...you can go for 1st option,,,it will be faster..
04-30-2009 9:30 AM
Can you not just compare it yourself`? Please let us know the result.
Thomas
04-30-2009 9:43 AM
hi, i have tested using SE30 to analyze but due to some cache problem when selecting database, some other issue in my program and unconsistent of system performance i can determine whether which one is faster.
So could any one who know this please help to clarify abit for me.
I'll appreciate alot.
Thank you very much...
Regards,
sean
04-30-2009 10:37 AM
04-30-2009 11:12 AM
Hi Shum,
In this case it's not a matter of speed: MOVE will not work for you because the tables do not have the same structure (since PA0001 starts with MANDT you'll end up with the client in the first 3 characters of each record in your destination field).
Generally speaking, though, and provided the internal tables have the same structure, MOVing at once will be much faster than LOOPing and APPENDing.
Hope this helps,
Rui Dantas