Application Development 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: 

problem with work area move-corresponding

former_member242512
Participant
0 Kudos

Hi ,

im changing a very old program to increase its performance . Im using work areas for it .

There are statements :

LOOP AT itab.
    MOVE-CORRESPONDING itab TO itab2 .
endloop .

now i have workarea like wa_itab and wa_itab2 . also tables i_itab and i_itab2 without header line.

what will be my equivalent statements for above code . i dnt hve data to test so requires help .

Regards .

1 ACCEPTED SOLUTION

p604431
Active Participant
0 Kudos

Hi,

LOOP AT  i_itab INTO wa_itab.
MOVE-CORRESPONDING wa_itab TO wa_itab2 .
APPEND wa_itab2 TO i_itab2.
ENDLOOP.

4 REPLIES 4

Former Member
0 Kudos

hi

Try this,If the workarea and internal table structures are same

LOOP AT i_itab into wa_itab.

append wa_itab to i_itab2.

endloop.

p604431
Active Participant
0 Kudos

Hi,

LOOP AT  i_itab INTO wa_itab.
MOVE-CORRESPONDING wa_itab TO wa_itab2 .
APPEND wa_itab2 TO i_itab2.
ENDLOOP.

0 Kudos

thanks for all post . Problem solved .

Former Member
0 Kudos

Hi,

If both itab1 and itab2 are having same structure then you can use following code:

LOOP AT itab into wa_itab1.
    Append wa_itab1 to itab2.
    clear: wa_itab1.

Endloop.

Thanks,

Archana