LET : Used to create variable and assign values locally
Before continuing further , let see some important points that needs to be taken care before using LET operator.
* Simple example : Here we will see a very simple example to use LET , later in further blogs we will see how we can make use of LET with other operators.
TYPES : BEGIN OF ty_int1,
value TYPE i,
value1 TYPE i,
END OF ty_int1.
DATA lt_int1 TYPE TABLE OF ty_int1.
* Lets use LET to change values of lt_int1
DO 5 TIMES.
DATA(ls_int1) = VALUE ty_int1( LET lv1 = sy-index + 10
lv2 = lv1 + 20
IN value = lv1
value1 = lv2
).
APPEND ls_int1 TO lt_int1.
CLEAR ls_int1.
ENDDO.
No comments:
Post a Comment