cancel
Showing results for 
Search instead for 
Did you mean: 

difference bw operators

Former Member
0 Kudos

Could anyone pls explain me the difference b/w " -> " and " => " operator and significance

thanks in advance....

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member189058
Active Contributor
0 Kudos

-> is used to select instance components of Class

=> is used to select Static Component.

Pl go through the link that I sent in the previous thread. You will find all answers there.

Quted from SAP Library:

Addressing the Components of Objects

Programs can only access the instance components of an object using references in object reference variables. This is done using the object component selector -> (ref is a reference variable):

· To access an attribute attr: ref->attr

· To call a method meth: CALL METHOD ref->meth

You can access static components using the class name or the class component selector => as well as the reference variable. It is also possible to address the static components of a class before an object has been created.

· To access a static attribute attr: class=>attr

· To call a static method meth: CALL METHOD class=>meth

Note that the properties of instance attributes behave like static components. It is therefore possible to refer in a LIKE addition to the visible attributes of a class u2013 through the class component selector or through reference variables, without prior creation of an object.

Each class implicitly contains the reference variable me. In objects, the reference variable mealways contains a reference to the respective object itself and is therefore also referred to as the self-reference. Within a class, you can use the self-reference me to access the individual class components:

· To access an attribute attr of your class: me->attr

· To call a method meth of your class: CALL METHOD me->meth

When you work with attributes of your own class in methods, you do not need to specify a reference variable. The self-reference me is implicitly set by the system. Self-references allow an object to give other objects a reference to it. You can also access attributes in methods from within an object even if they are obscured by local attributes of the method.

-- Reema.

Former Member
0 Kudos

thank u reema...

former_member189058
Active Contributor
0 Kudos

Award and Close the thread if that answer satisfies you