‎2007 Jul 25 8:23 PM
I am using 3 internal tables. First I am fetching the data from itab1 , by using itab1 again I am fetching data into itab2.
I am declaring the itab3 fields whose are contains in both itab1 and itab2. I am populating the data into itab3 by using itab1 and iatb2.
loop at iatb2.
read table itab1 with key key all fileds
itab3-filed1= itab1-filed1.
itab3-filed2= itab2-filed2.
endloop.
But it is taking lot of time. Please advice any peformence technique.
regards,
Ajay reddy
‎2007 Jul 25 8:26 PM
hi Ajay,
do this way
loop at iatb1.
read table itab2 with key
Include all the key fields
if sy-subrc = 0.
itab3-filed1= itab1-filed1.
itab3-filed2= itab2-filed2.
append itab3.
clear itab3.
endif.
endloop.
‎2007 Jul 25 8:26 PM
hi Ajay,
do this way
loop at iatb1.
read table itab2 with key
Include all the key fields
if sy-subrc = 0.
itab3-filed1= itab1-filed1.
itab3-filed2= itab2-filed2.
append itab3.
clear itab3.
endif.
endloop.
‎2007 Jul 25 8:36 PM
Hi Santhosh,
if i use the same code suggested by you. in debuging mode. time is expired .
if i populate large amount , i am getting the same.
please adivice any .
regards,Ajay reddy
‎2007 Jul 25 8:39 PM
hi,
sort the internal tables with the key fields and use
binary search
statment in the read table statement ...
sort itab1 by <key fields>.
sort itab2 by <key fields>.
loop at iatb1.
read table itab2 with key
Include all the key fields
binary search.
if sy-subrc = 0.
itab3-filed1= itab1-filed1.
itab3-filed2= itab2-filed2.
append itab3.
clear itab3.
endif.
endloop.
‎2007 Jul 25 8:39 PM
HI,
Are you sure the this loop is taking time or the select statement taking the time..
check ur select statements
Sort the Tables itab1 and itab2 by the same key..
loop at itab1.
read table itab2 with key 1 , 2 ,3 <b>binary search.</b>
if sy-subrc eq 0.
append itab3.
endif.
endloop.
‎2007 Jul 25 8:47 PM