‎2007 Sep 17 7:32 PM
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.
‎2007 Sep 17 7:38 PM
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
‎2007 Sep 17 7:39 PM
Thanks Ferry, could you please let me know some more information on MOVE statement.
Regards.
‎2007 Sep 17 7:43 PM
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
‎2007 Sep 17 7:49 PM
Thanks Ferry, hopefully it should work in my case. Points awarded.