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

Conditional MOVE-CORRESPONDING

Former Member
0 Likes
5,555

Hi, I need to write a piece of code to move records from one internal table to another table. I got to know about the MOVE-CORRESPONDING statement in ABAP. Now my question is: if I use the following, what will the system do:

MOVE-CORRESPONDING ITAB1 TO ITAB2.

Will all the contents of ITAB1 be moved to ITAB2? I want to add a condition to it. Is that possible?

Thanks.

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
2,653

Hi,

Syntax:

MOVE-CORRESPONDING <sourcestruct> TO <destinationstruct>.

This statement assigns the contents of the components of structure <sourcestruct> to the components of the <destinationstruct> structure that have identical names.

If you want to add a condition to, it is better using MOVE statement instead.

Regards,

Ferry Lianto

Read only

0 Likes
2,653

Thanks Ferry, could you please let me know some more information on MOVE statement.

Regards.

Read only

ferry_lianto
Active Contributor
0 Likes
2,653

Hi,

You can do someting like this.


IF <sourcestruct-field1> = <condition>
  MOVE <sourcestruct-field2> TO <destinationstruct-field3>.
  MOVE <sourcestruct-field3> TO <destinationstruct-field4>.
  ...
ENDIF.

Regards,

Ferry Lianto

Read only

0 Likes
2,653

Thanks Ferry, hopefully it should work in my case. Points awarded.