Variant 1
MOVE f TO g.
Effect
Moves the contents of field f to field g . Field f remains unchanged.
This statement is equivalent to:
g = f.
Example
DATA: NUMBER TYPE I,
FIVE TYPE I.
MOVE 5 TO FIVE.
MOVE FIVE TO NUMBER.
The fields NUMBER and FIVE now both 5.
Multiple assignments like NUMBER = FIVE = 5. are also possible. ABAP/4 executes them from right to left .
If the field types or lengths differ, type conversion follows automatically. Type I fields are handled like type P fields. If we select the fixed point arithmetic attribute for an ABAP/4 program, type P fields are either rounded according to the number of decimal places or filled with zeros.
In contrast to WRITE TO , the decimal character is always a period (.), regardless of the specification in the user master. MOVE allows you to copy tables and structures which contain other tables.
Two tables can be copied only if this is possible for their respective lines. If the line types are incompatible, conversions are performed line by line. If itab is a table with a header line, the table itself can be addressed with itab[] .
Run time errors
Recent posts at team blogs are
Syntax for change list line
Syntax for modify data in internal table
How to set EDI message control ?
Spiral model software testing
Change of State in Physics
MOVE f TO g.
Effect
Moves the contents of field f to field g . Field f remains unchanged.
This statement is equivalent to:
g = f.
Example
DATA: NUMBER TYPE I,
FIVE TYPE I.
MOVE 5 TO FIVE.
MOVE FIVE TO NUMBER.
The fields NUMBER and FIVE now both 5.
Multiple assignments like NUMBER = FIVE = 5. are also possible. ABAP/4 executes them from right to left .
If the field types or lengths differ, type conversion follows automatically. Type I fields are handled like type P fields. If we select the fixed point arithmetic attribute for an ABAP/4 program, type P fields are either rounded according to the number of decimal places or filled with zeros.
In contrast to WRITE TO , the decimal character is always a period (.), regardless of the specification in the user master. MOVE allows you to copy tables and structures which contain other tables.
Two tables can be copied only if this is possible for their respective lines. If the line types are incompatible, conversions are performed line by line. If itab is a table with a header line, the table itself can be addressed with itab[] .
Run time errors
- BCD_BADDATA : Source field (type P ) does not contain the correct BCD format
- BCD_FIELD_OVERFLOW : Result field defined too small (type P )
- BCD_OVERFLOW : Arithmetic operation overflow (type P )
- CONVT_NO_NUMBER : Source field cannot be interpreted as a number
- CONVT_OVERFLOW : Source field conversion overflow
- MOVE_COMPLEX_OVERLAP : Assignment not allowed for deep structures in case they overlap
- MOVE_NOT_SUPPORTED : Assignment between types involved is not supported
- MOVE_TO_LIT_NOTALLOWED : Constants and literals must not be overwritten
Recent posts at team blogs are
Syntax for change list line
Syntax for modify data in internal table
How to set EDI message control ?
Spiral model software testing
Change of State in Physics
ABAP TOPIC WISE COMPLETE COURSE
BDC OOPS ABAP ALE IDOC'S BADI BAPI Syntax Check
Interview Questions ALV Reports with sample code ABAP complete course
ABAP Dictionary SAP Scripts Script Controls Smart Forms
Work Flow Work Flow MM Work Flow SD Communication Interface
No comments:
Post a Comment