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

Into corresponding FILES

Former Member
0 Likes
997

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
Read only

Former Member
0 Likes
954

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

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
Read only

Former Member
0 Likes
955

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

Read only

0 Likes
954

and between and internal and DB table?

Read only

0 Likes
954

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

Thanks a lot

Read only

former_member189059
Active Contributor
0 Likes
954

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.

Read only

Former Member
0 Likes
954

data: waz99 type Z99BW92

loop at itab into wa.

move corresponding wa to wa99.

insert wa99 into Z99BW92.

endloop.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
954

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