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

Data Transfer between two internal tables

Former Member
0 Likes
1,136

Hi SDN,

If I have two internal tables itab_a and Itab_b and I want to copy a subset of itab_a to itab_b using a conditional statement, is it possible and how?

Second, what if I want to append the smaller internal table itab_b to itab_a, how would you do that.

My task is to take some of the rows from a into b, change one field and append back to a. So if a had 100 rows, now it would have 110.

Please help.

Thanks.

Saf.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
555

If I have two internal tables itab_a and Itab_b and I want to copy a subset of itab_a to itab_b using a conditional statement, is it possible and how?

LOOP AT ITAB_A.

IF ITAB_A-SOME_FIELD = SOME_VALUE.

MOVE-CORRESPONDING ITAB_A TO ITAB_B.

APPEND ITAB_B.

ENDIF.

ENDLOOP.

3 REPLIES 3
Read only

Former Member
0 Likes
556

If I have two internal tables itab_a and Itab_b and I want to copy a subset of itab_a to itab_b using a conditional statement, is it possible and how?

LOOP AT ITAB_A.

IF ITAB_A-SOME_FIELD = SOME_VALUE.

MOVE-CORRESPONDING ITAB_A TO ITAB_B.

APPEND ITAB_B.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
555

"Second, what if I want to append the smaller internal table itab_b to itab_a, how would you do that."

Assuming that both tables have the same fields in them:

APPEND LINES OF ITAB_B[] TO ITAB_A[].

Read only

0 Likes
555

Thanks, John. Points awarded