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: 

Moving an entire dump in an internal table into another internal?

Former Member
0 Kudos

How can I move an entire dump ,in an internal table,into another internal with a where condition?

for example:

itab1 into itab2 where fld1 = 'something'

1 ACCEPTED SOLUTION

Former Member
0 Kudos

For this u have to use the loop construct.

LOOP AT ITAB1 WHERE FIELD1 = 'somwthing'.

MOVE-CORRESPONDING FIELDS TO ITAB2.

APPEND ITAB2.

ENDLOOP.

Regards,

Himanshu

5 REPLIES 5

Former Member
0 Kudos

For this u have to use the loop construct.

LOOP AT ITAB1 WHERE FIELD1 = 'somwthing'.

MOVE-CORRESPONDING FIELDS TO ITAB2.

APPEND ITAB2.

ENDLOOP.

Regards,

Himanshu

former_member225631
Active Contributor
0 Kudos

Itab2[] = itab1[]. Both internal tables should have same structure.

Former Member
0 Kudos

Hi,

You can move data from one ITAB to another ITAB1 like this:

ITAB[] = ITAB1[]. (if both have same structures)

move-corresponding Itab to ITAB1.

append Itab1.

clear ITAB1.

Loop at ITAB.

if <some condition>

assign filed of ITAb to ITAB1.

or use move-corresponding...

append..

clear...

endif.

endloop.

or Loop ate ITAB where f1 = < condition>

assign filed of ITAb to ITAB1.

or use move-corresponding...

append..

clear...

endloop.

reward points if useful

regards,

Anji

Former Member
0 Kudos

hi

use the following code

declare itab1 and itab2 with header

loop at itab1 where fld = 'something'.

move-corresponding itab1 to itab2.

append itab2.

endloop.

hope this will work.

regards

ravish

plz reward if helpful

Message was edited by:

ravish goyal

Former Member
0 Kudos

Hi,

Use LOOP with Condition , if both the internal tables are of same structure then no need to use the Move Corresponding , else use that and move the field values and append the data into the new one.

Hope this will help for you.

Regards,

Senthil N S