‎2008 Jul 10 12:54 PM
What is the difference between Move & assign statement?
Edited by: Arun Mehta on Jul 10, 2008 1:55 PM
‎2008 Jul 11 6:32 AM
Hi Arun,
Hope this will help u out.
Move :- To assign the value of a data object <f1> to a variable <f2>, use the following
statement:
MOVE <f1> TO <f2>. or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> does not have to be a variable - it can
also be a literal, a text symbol, or a constant. You must always specify decimal points
with a period (.), regardless of the user's personal settings.
Multiple value assignments in the form
<f4> = <f3> = <f2> = <f1>.
Assign :- ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of
the data object <f> correspond to any type specifications for the field symbol <FS>. The
field symbol adopts any generic attributes of <f> that are not contained in its own type
specification. Following the assignment, it points to <f> in memory.
Reward with pts if answered.
Regards,
Anurodh
‎2008 Jul 10 12:56 PM
hi
Plz refer to the following link.
[http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3260358411d1829f0000e829fbfe/content.htm]
[http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm]
regards
Sumit Agarwal
‎2008 Jul 10 12:58 PM
Hi
If you already know the name of the field that you want to assign to the field symbol when you write a program, use the static ASSIGN statement:
ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of the data object <f> correspond to any type specifications for the field symbol <FS>. The field symbol adopts any generic attributes of <f> that are not contained in its own type specification. After the assignment, it points to <f> in memory.
To assign the value of a data object <f1> to a variable <f2>, use the following statement:
MOVE <f1> TO <f2>.
or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> does not have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the useru2019s personal settings.
Multiple value assignments in the form
<f4> = <f3> = <f2> = <f1>.
are also possible. ABAP processes them from right to left as follows:
MOVE <f1> TO <f2>.
MOVE <f2> TO <f3>.
MOVE <f3> TO <f4>.
Regards
Pavan
Edited by: Pavan Bhamidipati on Jul 10, 2008 1:59 PM
‎2008 Jul 10 12:58 PM
Hi Arun,
please check this link
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
Best regards,
raam
‎2008 Jul 10 12:59 PM
Hi,
Move is used for moving value of any variable/work area to another variable.
where as Assign statement is specific to Field Symbols and one more thing when ever a field symbol is used it must be assigned some values else your program will give dump.
For more details write these key words in your program and do F1. You can read the documentation given by SAP.
Hope this helps!!
Regards,
Lalit
‎2008 Jul 10 12:59 PM
Hiii!
Move is basically used to move the values from one variable to another.
example.
a = 2.
MOVE a TO b.
This statement will move the value of a to b.
ASSIGN is used while using Field Symbols.
We use ASSIGN statement to assign a data object to field symbol.
Check out this link.
http://www.henrikfrank.dk/abaptips/abap%20language/dynamic%20programming/fieldsymbols.htm
Regards
Abhijeet Kulshreshtha
Edited by: Abhijeet Kulshreshtha on Jul 10, 2008 2:00 PM
‎2008 Jul 10 12:59 PM
hi arun,
To assign the value of a data object var to a variable var1,use the following statement:
MOVE var TO var1.
or the equivalent statement
var = var1
The contents of var remain unchanged. var does not have to be a variable - it can also be a literal, a text symbol, or a constant.
ASSIGN
it is maily used with field symbol.
If you already know the name of the field that you want to assign to the field symbol when you write a program, use the static ASSIGN statement:
ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of the data object <f> correspond to any type specifications for the field symbol <FS>. The field symbol adopts any generic attributes of <f> that are not contained in its own type specification. After the assignment, it points to <f> in memory.
regards,
sandeep
‎2008 Jul 10 1:18 PM
hi Arun
Mainly ASSIGN is used when moving from /to <b> memory location </b> generally uised in field symbols
Assigning Field Symbols
Instead of using the names of data objects, you can also assign field symbols to field symbols in all variants of the ASSIGN statement.
ASSIGN <FS1> TO <FS2>.
in a static ASSIGN and:
ASSIGN [TABLE FIELD] (<f>) TO <FS2>(Nothing but memory location)
<b>move </b>
To assign the value of a data object source to a variable destination, use the following statement:
MOVE source TO destination.
or the equivalent statement
destination = source.
The content of source remains unchanged, source does not therefore have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the useru2019s personal settings.
The source and target fields can be of different data types
amit
Edited by: Amit Kumar on Jul 10, 2008 2:18 PM
‎2008 Jul 10 1:21 PM
Hi
Move :- To assign the value of a data object <f1> to a variable <f2>, use the following statement:
MOVE <f1> TO <f2>.
or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> does not have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the useru2019s personal settings.
Multiple value assignments in the form
<f4> = <f3> = <f2> = <f1>.
Assign :- ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of the data object <f> correspond to any type specifications for the field symbol <FS>. The field symbol adopts any generic attributes of <f> that are not contained in its own type specification. Following the assignment, it points to <f> in memory.
With Regards
Nikunj Shah
‎2008 Jul 10 1:21 PM
Hi
Move :- To assign the value of a data object <f1> to a variable <f2>, use the following statement:
MOVE <f1> TO <f2>.
or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> does not have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the useru2019s personal settings.
Multiple value assignments in the form
<f4> = <f3> = <f2> = <f1>.
Assign :- ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of the data object <f> correspond to any type specifications for the field symbol <FS>. The field symbol adopts any generic attributes of <f> that are not contained in its own type specification. Following the assignment, it points to <f> in memory.
With Regards
Nikunj shah
‎2008 Jul 11 6:32 AM
Hi Arun,
Hope this will help u out.
Move :- To assign the value of a data object <f1> to a variable <f2>, use the following
statement:
MOVE <f1> TO <f2>. or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> does not have to be a variable - it can
also be a literal, a text symbol, or a constant. You must always specify decimal points
with a period (.), regardless of the user's personal settings.
Multiple value assignments in the form
<f4> = <f3> = <f2> = <f1>.
Assign :- ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of
the data object <f> correspond to any type specifications for the field symbol <FS>. The
field symbol adopts any generic attributes of <f> that are not contained in its own type
specification. Following the assignment, it points to <f> in memory.
Reward with pts if answered.
Regards,
Anurodh