2006 Jul 26 9:31 AM
Hello experts,
How do I call a method inside a method? they are both methods of the same class.
For example, I declared a class named as LCL_MAIN and has 4 methods namely get_data,
combine_data, get_asset and show_data. Now what I want to do is to call method get_asset
inside the method combine_data. How do I do that guys? Again, thank you guys and have
a nice day!
2006 Jul 26 10:09 AM
Hi,
with the me-> statement
class lcl_1 definition.
public section.
methods:
call_1.
private section.
methods:
call_2,
call_3.
endclass.
class lcl_1 implementation.
method call_1.
call method me->call_2.
endmethod.
method call_2.
WRITE:/ 'Hello class 2'.
endmethod.
method call_3.
endmethod.
endclass.
start-of-selection.
data clas type ref to lcl_1.
create object clas.
call method clas->call_1.
Cheers,
Stefan
Hello experts,
How do I call a method inside a method? they are both methods of the same class.
For example, I declared a class named as LCL_MAIN and has 4 methods namely get_data,
combine_data, get_asset and show_data. Now what I want to do is to call method get_asset
inside the method combine_data. How do I do that guys? Again, thank you guys and have
a nice day!
2006 Jul 26 10:09 AM
Hi,
with the me-> statement
class lcl_1 definition.
public section.
methods:
call_1.
private section.
methods:
call_2,
call_3.
endclass.
class lcl_1 implementation.
method call_1.
call method me->call_2.
endmethod.
method call_2.
WRITE:/ 'Hello class 2'.
endmethod.
method call_3.
endmethod.
endclass.
start-of-selection.
data clas type ref to lcl_1.
create object clas.
call method clas->call_1.
Cheers,
Stefan
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |