06-04-2009 12:59 PM
Hello Experts,
can you say you can call a
instance method with ->
and
static method =>
within the ABAP OO-Programming.
Or is it vice versa ?
Regards
ilhan
06-04-2009 1:07 PM
Hi IIhan,
You are right.
to call instance method:
ref_obj->method_name
EXPORTING
.............
to call static method
ref_obj=>method_name
EXPORTING
---------
George
06-04-2009 1:07 PM
Hi,
Its correct.
Refer
data instance_name type ref to class_name.
create object instance_name...
call method instance_name->instance_method( ... )
you may call static methods (also called class methods) only on class, does not need an instance
call method class_name=>static_method( ... )
Regards
Sumana
06-04-2009 1:07 PM
Hi IIhan,
You are right.
to call instance method:
ref_obj->method_name
EXPORTING
.............
to call static method
ref_obj=>method_name
EXPORTING
---------
George
06-04-2009 1:08 PM
Hi,
=> is used for accessing static component of a class. It is actually called Class Component Selector .
-> is Object Component Selector
Regards
06-04-2009 1:09 PM
no need to worry much for this...
in abap editor click patern->ABAP Object patern->
give instance name, class name, method name which ever u need.
it will put the method skeleton for you...