‎2007 Jan 09 10:46 AM
Hi,
Can you plz help..
Q1) Generally, when you work on data you put in internal table or work area.
ex1: loop at IT1 or WA1.
if .......
endif....
move To IT2.
endloop.
ex2: Loop at IT1 INTO wa.
.......
,,,,,,,
append wa INTO IT2.
endloop.
whats the adv in using second approach and how is better than first performance wise. i feel that more the internal tables or wa more memory usuage and delay in processing(especially interfaces).
Q2) In general while programming interfaces what is effective or good programming . what are all the do's and dont's.
‎2007 Jan 09 10:49 AM
hi,
Advatages of work area.
1) No memory waste.
2) program more readable.
Regards
Anver
‎2007 Jan 09 10:49 AM
hi,
Advatages of work area.
1) No memory waste.
2) program more readable.
Regards
Anver
‎2007 Jan 09 11:05 AM
Hi,
U have to use internal table for processing on the data taht u have fetched from the Database. it is the temporary storage for data.
While we use work area since the memory that is allocated for WA is in the same memory allocation that is being allocated to the program.As the memory wil be allocated as it is allocated to another variable of the programn.
On the otherhand if we use internal table with header line , then there is no need to explicitly move the data from IT toWA but the memory that is allocated to header line is outside the memory that is allocated for the program.
This is the main reason for the good performance with WA.
Best practice is to use the work area.
REgards,
Sonika
‎2007 Jan 10 4:30 AM
Using work area has almost the same overhead and memory requirement as a header line.
Using a work area is clearer to understand. For example, if you call a subroutine with the statement
PERFORM DO_SOMETHING using IT1
are you passing the table or the header line?
For performance improvement reading / looping on an internal table, use a field-symbol:
field-symbols <fs> like line of IT1.
loop at IT1 assigning <fs>.
<fs>-field1 = '123'.
append <fs> to IT2.
endloop.
Memory is less, and you don't need a MODIFY statement to update the internal table after changing a field.
Regards
Michael
‎2007 Jan 10 7:35 AM
Hi,
U have to use internal table for processing on the data taht u have fetched from the Database. it is the temporary storage for data.
While we use work area since the memory that is allocated for WA is in the same memory allocation that is being allocated to the program.As the memory wil be allocated as it is allocated to another variable of the programn.
On the otherhand if we use internal table with header line , then there is no need to explicitly move the data from IT toWA but the memory that is allocated to header line is outside the memory that is allocated for the program.
This is the main reason for the good performance with WA.
Best practice is to use the work area.
‎2007 Jan 10 8:05 AM
Hi Sanjay,
Why had you copied my reply as ur post ?
I think thats what i had posted yesterday.
Please don't copy???
Regards,
Sonika Ahuja