Thursday, 21 September 2017

ABAP: MOVE: Assign value to a variable

Just like how we assign value to a variable using '=' operator, we cal also assign value to a variable using MOVE keyword.

Syntax
MOVE value TO variable.

Ex:
MOVE 10 TO var1.

Z_HELLO_WORLD
*&---------------------------------------------------------------------*
*& Report Z_HELLO_WORLD
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT Z_HELLO_WORLD.

DATA var1 TYPE I.

MOVE 10 TO var1.
Write 'Value of var1 is : '.
Write var1.

MOVE -450 TO var1.
Write / 'Value of var1 is : '.
Write var1.


Previous                                                 Next                                                 Home

No comments:

Post a Comment