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: 

Into corresponding FILES

Former Member
0 Kudos

HI,

I have :

<i>LOOP AT ITAB1.

AT NEW POPER.

read table itab1 index sy-tabix.

append itab1 to itab2.

ENDAT.

ENDLOOP.

delete from Z99BW92.

INSERT Z99BW92 FROM TABLE ITAB2." ACCEPTING DUPLICATE KEYS.</i>

ITAB2 has 4 fields that have diferents orden than Z99BW92.

How can i use "corresponding files " here?

thanks a lot

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You can use MOVE-CORRESPONDING only when similar fields are present in both internal tables

LOOP AT ITAB1.

AT NEW POPER.

read table itab1 index sy-tabix.

MOVE-CORRESPONDING itab1 to itab2.

append itab2.

ENDAT.

clear itab2.

ENDLOOP.

<b>Reward points for useful Answers</b>

Regards

Anji

6 REPLIES 6

Former Member
0 Kudos

Hi

You can use MOVE-CORRESPONDING only when similar fields are present in both internal tables

LOOP AT ITAB1.

AT NEW POPER.

read table itab1 index sy-tabix.

MOVE-CORRESPONDING itab1 to itab2.

append itab2.

ENDAT.

clear itab2.

ENDLOOP.

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

and between and internal and DB table?

0 Kudos

ok. Y try it. Between 2 internal tables . I go to copy the strcuture from Z99 to ITAB2.

Thanks a lot

former_member189059
Active Contributor
0 Kudos

instead of <i>append itab1 to itab2.</i>, move the required fields into the workarea of itab2

eg itab2-field1 = itab1-field1.

and then append itab2.

Former Member
0 Kudos

data: waz99 type Z99BW92

loop at itab into wa.

move corresponding wa to wa99.

insert wa99 into Z99BW92.

endloop.

0 Kudos

Hi,

This option is not provided,

What you can do is.

DATA:ITAB3 TYPE TABLE OF Z99BW92.

LOOP AT ITAB2.

MOVE-CORRESPONDING ITAB2 to ITAB3.

APPEN ITAB3.

ENDLOOP.

INSERT Z99BW92 FROM TABLE ITAB3.

Regards,

Sesh