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

Queyr about move-corresponding

Former Member
0 Likes
1,508

Hi guys,

is move-corresponding capable of moving all entries of internal table w/o headerline to another internal table?

or is it only capable of moving one entry?

thanks a lot!

7 REPLIES 7
Read only

Former Member
0 Likes
1,006

moves all entries of internal table

Read only

0 Likes
1,006

it only moves content of header at a time..so to transfer complete internal table to another one of different structure u need to have a loop on the source table and either source table shud have header or u have to use work area to move the corresponding enteries to the destination table.

Read only

Former Member
0 Likes
1,006

It moves all entries of internal table.In case of work areas,where their structures are different then move -corresponding will move the data between the corresponding fields of those two work areas.However,it will give a warning in SLIN check.

Read only

Former Member
0 Likes
1,006

Move corresponding is to move a filed to another filed only.

for all entries you can use:

append lines of itab to itab1.

Vipin

Read only

Former Member
0 Likes
1,006

Basically Move corresponding is used to move data between internal tables or workareas of different structures.

It does field to field comerisan for this reson field name of both the structures must be same.

As this performs a field to field comperisan, it consume a lot of processing time so performance wise it is recommened "Not to use Move-corresponding statment" .

Regards

Bikas

Read only

Former Member
0 Likes
1,006

Hi,

To move values between the components of structures, use the statement :

MOVE-CORRESPONDING <struct1> TO <struct2>.

This statement moves the contents of the components of structure <struct1> to the components of <struct2> that have identical names. The other fields remain unchanged.

When it is executed, it is broken down into a set of MOVE statements, one for each pair of fields with identical names, as follows:

MOVE STRUCT1-<ci> TO STRUCT2-<ci>.

Any necessary type conversions occur at this level. This process is different to that used when you assign a whole structure using the MOVE statement, where the conversion rules for structures apply.

Example :

DATA: BEGIN OF ADDRESS,
          FIRSTNAME(20) VALUE 'Fred',
          SURNAME(20) VALUE 'Flintstone',
          INITIALS(4) VALUE 'FF',
          STREET(20) VALUE 'Cave Avenue,
          NUMBER TYPE I VALUE '11'.
          POSTCODE TYPE N VALUE '98765'.
         CITY(20) VALUE 'Bedrock',
         END OF ADDRESS.

DATA: BEGIN OF NAME,
           SURNAME(20),
           FIRSTNAME(20),
           INITIALS(4),
           TITLE(10) VALUE 'Mister',
          END OF NAME.

MOVE-CORRESPONDING ADDRESS TO NAME.

Yes all the values are moved to the corresponding fields.

Hope this will help you.

Plz reward if useful.

Thanks,

Dhanashri.

Read only

Former Member
0 Likes
1,006

Hi,

One thing I want to clear you that Header line is a work area that has a same name that of an internal table.

Move corresponding is used to move corresponding data between work areas.

you can move data between two internal table ,having same structure. For e.g.

itab1[] = itab2.

As per your requirement you want to move corresponding records from one internal table to other .For that you have to write some codes.

For e.g.

Data: itab type table of struc1 wiht header line,

itab2 type table of struc2 with header line.

loop at itab1.

move-corresponding from itab1 to itab2.

append itab2.

endloop.

In this way you can move your corresponding data between itab1 and itab2.

I hope this will help you.

Help children of U.N World Food Program by rewarding points and encourage others to answer your queries