‎2006 Oct 31 9:56 AM
Hi
Iam new to ABAP Objects,
Can anyone tell me what is this mean
me->amount = me->amount + amount.
what me-> resembles??
Thanks in advance.
‎2006 Oct 31 10:09 AM
It reffers to a variable(attribute) 'amount' of current class, it can be used within method belonging to that class.
Message was edited by: Tomasz Kozerski
‎2006 Oct 31 10:09 AM
It reffers to a variable(attribute) 'amount' of current class, it can be used within method belonging to that class.
Message was edited by: Tomasz Kozerski
‎2006 Oct 31 11:26 AM
HI,
Me is nothing but the current object at the run-time.
by me->amount you are saying that for the current object under execution take the amount that is passed to the method as an import parameter and add it to the objects attribute amount.
me->amount = me->amount(This is classes attribute) + amount(This is an import parameter).
Me(Current object for which processing is happening).
If you are aware of JAVA then it is nothing but the 'this' keyword of java.
Regards,
Sesh
‎2006 Oct 31 11:47 AM
Hi,
the question could also be when should you use it?
Seshatalpasai Madala already included the answer. Imagine you have a class which has the <u>attribute</u> amount. The class also has a method which has a <u>parameter</u> called amount. Now, when you implemented the method you need a way to tell the compiler which amount variable you want to reference. The solution is the <b>me</b> keyword.
You often see this in setter methods. Example
method set_amount.
me->amount = amount.
endmethod
cheers
Thomas