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

append data to internal table

Former Member
0 Likes
3,789

i m calling one FM inside the loop, this FM will return data in internal table. for each loop count i want to save this data to same other internal table, how to do that?

i want to append the one internal tables data to another internal table how to do that?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,534

Hi

APPEND LINES OF ITAB1 TO ITAB2.

Max

6 REPLIES 6
Read only

Former Member
0 Likes
1,535

Hi

APPEND LINES OF ITAB1 TO ITAB2.

Max

Read only

Former Member
0 Likes
1,534

Hi

declare: ITAB, ITAB1 and ITAB2.

Loop at ITAB.

clear ITAB1.

call function < fun module>

it will export data into ITAB1 (data fetched from fun Module)

move the data from ITAB1 to ITAB2.

append ITAB2.

clear ITAB2.

endloop.

Use the data of ITAB2 further as needed.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
1,534

Declare 2 tables ITAB2 and ITAB3 of similar structures and dod this

LOOP AT ITAB.

  CALL FUNCTION
      TABLES = ITAB2.

  APEEND LINES OF ITAB2 to ITAB3.
  REFRESH ITAB2.

ENDLOOP.

Read only

Former Member
0 Likes
1,534

Hi,

Check out this :-

 Loop at itab1 into wa_itab1.

Call Fm : xyz
      returning table : itab2.

if lines of itab2 not initial.
loop at itab2 into wa_itab2.
append itab3.
endloop.

endloop.

Hope this helps u.

Reward points if helpful.

Regards,

Deepu.K

Read only

Former Member
0 Likes
1,534

hi lucky

Declare the tables of Itab1 and Itab2.

Loop at ITAB.

call function <fm>

move the data from ITAB1 to ITAB2.

append ITAB2.

endloop.

in case if u want to transfer the one specific field alone from itab1 means .

move itab1 to itab2 transporting fieldaname where <condition>.

do reward if its helpful,

thanks and regards

vijay

Message was edited by:

vijay kumar gopal

Read only

Former Member
0 Likes
1,534

Hi Lucky,

Refer this code :

LOOP AT I_TAB1.

CALL FUNCTION <FUNCTION NAME>

EXPORTING

............................

IMPORTING

............................

TABLES = I_TAB2.

APEEND LINES OF I_TAB2 to I_TAB3.

REFRESH I_TAB2.

ENDLOOP.

REWARD POINTS IF HELPFUL.

Regards,

Hemant