Abstract Classes and Methods in Object Oriented Programming
...Previous
Here you can write the code
Write the code In between
Method and End Method
Method AREA
....
Endmethod
Write the below code
method
AREA
* Local Data Declarations
DATA: lv_count TYPE i,
lv_res TYPE i.
* initialize Count value to '1'
lv_count = '1'.
DO 10 TIMES.
IF lv_count <= '10'.
lv_res = v_num * lv_count.
* Displa the multiplication table for a Given Number
WRITE: / v_num,
'*',
lv_count,
'=',
lv_res.
* Increment Count value
lv_count = lv_count + 1.
ELSE.
EXIT.
ENDIF.
ENDDO.
* Clear variable
CLEAR: v_num.
endmethod
Then save and activate the
class and method.
Finally execute the class
(F8)
It goes to below screen
Enter the number under
V_NUM as "6" and press execute button
.
The out will be displayed
like below.
|