2008 Nov 19 3:28 PM
I am trying to create a BADI Definition in the Enhancement Spot.
When I am creating a method in the BADI interface; I have the option of INSTANCE and STATIC.
Please elaborate the difference between the two; giving examples.
2008 Nov 19 8:29 PM
it's an elementary concept of object-oriented programming languages, please look at books or lots of threads in the forum.
briefly, you may call instance methods only on instances:
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( ... )
2008 Nov 19 8:29 PM
it's an elementary concept of object-oriented programming languages, please look at books or lots of threads in the forum.
briefly, you may call instance methods only on instances:
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( ... )
2008 Nov 20 4:01 AM
Hi,
Instance methods are called using the following syntax:
CALL METHOD instance_name->instance_method_name.
A static method which is also called as class method can be called using the class and does not require an Instance. Static methods are called using the following syntax:
CALL METHOD class_name=>instance_method_name