08-12-2007 7:18 PM
08-12-2007 7:31 PM
Hi,
MOVE just move the values without looking at the field names. Meaning it just the moves the number of characters from the source to the target structure OR variable.
MOVE-CORRESPONDING looks for the corresponding field names in the target structure and move those values only..
DATA: BEGIN OF source,
matnr type matnr,
end of source.
DATA: BEGIN OF target,
vbeln type vbeln,
matnr type matnr,
end of target.
source-matnr = 'asdfasf'.
MOVE-CORRESPONDING source to target.
write: / 'vbeln- ', target-vbeln.
write: / 'matnr- ', target-matnr.
clear: target.
skip 1.
MOVE source to target.
write: / 'vbeln- ', target-vbeln.
write: / 'matnr- ', target-matnr.
* If you see the second output the value in matnr is moved to
* vbeln in target.
for MOVE the both structures should be same, becasue it startring copy first field of first structure to first field of second structure.
MOVE-CORRESPONDING will look for fields with similar names in both the structures and move only those fields which have same name.
move means same like
a = b.
move b to a. ( shuld be type matched)
Regards,
Gaurav
<b>Reward points if helpful</b>