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

Work Area using Advantages

Former Member
0 Likes
773

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.

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
689

hi,

Advatages of work area.

1) No memory waste.

2) program more readable.

Regards

Anver

5 REPLIES 5
Read only

anversha_s
Active Contributor
0 Likes
690

hi,

Advatages of work area.

1) No memory waste.

2) program more readable.

Regards

Anver

Read only

former_member632991
Active Contributor
0 Likes
689

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

Read only

Former Member
0 Likes
689

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

Read only

0 Likes
689

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.

Read only

0 Likes
689

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