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

INTO OR ASSIGN

Former Member
0 Likes
696

Hello,

can you tell me what is the advantage to use "ASSIGNING" instead of "INTO" when i using LOOPS?

Thanks Ronald

Hello,

can you tell me what is the advantage to use "ASSIGNING" instead of "INTO" when i using LOOPS?

Thanks Ronald

4 REPLIES 4
Read only

Former Member
0 Likes
666

When using ASSINING, you can modify the data directly.

If using INTO, you have to add MODIFY itab FROM wa at the end of the loop.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
666

Hi,

When you use ASSIGNING you can directly modify the values in the TABLE when you modify the workarea, where as when you use INTO you needto use MODIFY Statement to push the changes on to the internal table.

Also its fast AS there will not be any copying of the data into the work area and back to internal table from workarea after MODIFY

Regards,

Sesh

Read only

Former Member
0 Likes
666

they are used in different contexts

when you are assigning to a field symbol, then u need to use ASSIGNING

LOOP AT ITAB ASSIGNING <FS>.

When you are assigning to a workarea then u have to use INTO

LOOP AT ITAB INTO WA_ITAB.

Read only

Former Member
0 Likes
666

It is also a performance issue. If you have a lot of entries in your table you should use assign, because then it is faster to work with references.