2006 Sep 19 7:16 AM
HI EVERYBODY,
WHAT IS THE DIFF BETWEEN MOVE AND MOVECORRESPONDING?
HI EVERYBODY,
WHAT IS THE DIFF BETWEEN MOVE AND MOVECORRESPONDING?
2006 Sep 19 7:19 AM
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.
2006 Sep 19 7:20 AM
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.
2006 Sep 19 7:20 AM
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.
2006 Sep 19 7:20 AM
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,
2006 Sep 19 7:21 AM
Hi,
MOVE: Moves the contents of field a to b
MOVE-CORRESPONDING : MOVE-CORRESPONDING from struc1 TO struc2
Hope this helps.
Regards,
Sunil.M
2006 Sep 19 7:27 AM
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
2006 Sep 19 7:29 AM
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)
2006 Sep 19 7:33 AM
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
2006 Sep 19 7:46 AM
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)
2006 Sep 19 7:48 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |