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

MOVE AND MOVE CORRESPONDING

Former Member
0 Likes
2,690

HI EVERYBODY,

WHAT IS THE DIFF BETWEEN MOVE AND MOVECORRESPONDING?

HI EVERYBODY,

WHAT IS THE DIFF BETWEEN MOVE AND MOVECORRESPONDING?

10 REPLIES 10
Read only

Former Member
0 Likes
2,657

MOVE is used to tranfer values of one field at a time.MOVE-CORRESPONDING is used to transfer values of an entire structure containing several fields to fields of another similar structure.

Read only

Former Member
0 Likes
2,657

Hi kanny,

1. Move assigns the value to the specified field.

It is just like a = b.

2. Whereas

3. MOVE-CORRESPONDING STRUCT1 TO STRUCT2

means,

ALL FIELDS HAVING THE SAME NAME,

WILL BECOME EQUAL.

(Rest fields, which do not have same name,

will be ignored)

4. Suppose have a struct1 has 5 fields,

struct 2 has 9 fields,

so instead of giving 5 different lines,

STRUCT2-FIEDL1 = STRUCT1-FIELD1

STRUCT2-FIEDL2 = STRUCT1-FIELD2

STRUCT2-FIEDL3 = STRUCT1-FIELD3

STRUCT2-FIEDL4 = STRUCT1-FIELD4

STRUCT2-FIEDL5 = STRUCT1-FIELD5

We just use MOVE-CORRESPONDING STRUCT1 TO STRUCT2.

regards,

amit m.

Read only

0 Likes
2,657

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.

Read only

dani_mn
Active Contributor
0 Likes
2,657

HI,

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.

Regards,

Read only

Former Member
0 Likes
2,657

Hi,

MOVE: Moves the contents of field a to b

MOVE-CORRESPONDING : MOVE-CORRESPONDING from struc1 TO struc2

Hope this helps.

Regards,

Sunil.M

Read only

anversha_s
Active Contributor
0 Likes
2,657

hi,

move means same like

a = b.

move b to a. ( shuld be type matched)

move corressponding means.

move corressponing struct1 to struct2.

here all the fields shuld be in same order and type.

performance wise nvr use move corresponding.

it will take more time.

rgds

anver

if hlped mark points

Read only

Former Member
0 Likes
2,657

THANKS EVERYBODY,

MAY I KNOW WHY WE ARE USING THIS MODULE POOL EVENTHOUGH WE ARE HAVING THE FACILITY TO WRITE THE SAME CODE IN REPORTING?

REGARDS

KANNY

(WHEN THE GOING GETS TOUGH, TOUGH GETS GOING)

Read only

0 Likes
2,657

hi,

module pool is more structured.

in report programming we are writing the whole code in a single page.

but module pool , its like house.

kitchne for cookimg.

bathrrom for bathing

bed room for sleeping.

like that evry code is assaigned to its room.

so here rooms are PBO,PAI,SUBROUTINE,TOP INCLUDE..like that

here debuging is easy.

error handing is more easy.

hope u got an idea.

rhgds

anver

if hlped mark points

Read only

Former Member
0 Likes
2,657

YEA THANKS ANVERSHA!

AND MAY I KNOW ABOUT WORKFLOW IN DETAIL ESP CHANGING BINDING MANUALLY?

REGARDS

KANNY

(WHEN THE GOING GETS TOUGH, TOUGH GETS GOING)

Read only

0 Likes
2,657

hi ,

Please start a new thread in the case of work flow.

u will get more rplies.

kindly close this thread after marking helpful answers.

rgds,

anver

if hlped amrk points