‎2007 Oct 04 10:33 AM
hi to all abap gurus
thanks in advance
all of the objects in the class can acess its its static attributes . and if u change the static attribute in an object the change is visible in all other objects in the calsssss.
can u pls expain this and tell the diffrence bewteen static and instance metod s?
‎2007 Oct 04 10:42 AM
Hi,
<b>Instance Method</b>
You can declare instance methods by using the METHODS statement. They play a very important role as they can access all of the attributes of a class and can trigger all of the events of the class.
<b>Static Methods</b>
You can declare static methods by using the CLASS-METHODS statement. They are important and can only access static attributes and trigger static events.
<b>STATIC METHODS</b>
CAN ONLY USE STATIC COMPONENTS IN THEIR IMPLEMENTATION PART
CAN BE CALLED USING THE CLASS
Static methods (also referred to as class methods) are called using CALL METHOD <classname>=><class_method>.
If you are calling a static method from within the class, you can omit the class name.
You access static attributes using <classname>=><class_attribute>
Regards,
Padmam.