‎2007 Feb 25 5:56 AM
What is the right method to call a method,
Is CALL METHOD <class> => <interface-method>
(or) CALL METHOD <class> => <interface~method>
‎2007 Feb 26 9:43 AM
Hi,
Assume C1 is class, M1 is method.
fist declare a refrence variable, then create object to the class.
Data:obj1 type ref to C1.
create object obj1.
now call the method in this way:
call method obj1->m1.
if it is static method then also you can call using the object as above or you can directly call static method with the class name without creating object to the class
call method c1=>m1.
=> is clas reference variable
->object reference variable
to call an interface method use tilde (~)
call method obj1->I1~M2.
I1 is the interface name and M2 is the method of the interface
I hope you got some idea now.
Regards,
Sowjanya
‎2007 Feb 25 8:05 AM
Hi,
The right way to call a method is as follows .
assume there a class ABC with a method declare and object is lo_abc.
if the method is not static then it is called as
call method lo_abc->declare().
if the method is statis then
call method abc->declare .
Please reward if useful.
‎2007 Feb 25 4:06 PM
Hello,
You can use the pattern button on ABAP editor (se80),click on radio button ABAP objects in the PATTERNS pop-up,give the object instance and the method you need and click continue.The method will automatically be inserted in your code with all the importing and exporting parameters.
Regards,
Beejal
**Reward if this helps
‎2007 Feb 26 9:43 AM
Hi,
Assume C1 is class, M1 is method.
fist declare a refrence variable, then create object to the class.
Data:obj1 type ref to C1.
create object obj1.
now call the method in this way:
call method obj1->m1.
if it is static method then also you can call using the object as above or you can directly call static method with the class name without creating object to the class
call method c1=>m1.
=> is clas reference variable
->object reference variable
to call an interface method use tilde (~)
call method obj1->I1~M2.
I1 is the interface name and M2 is the method of the interface
I hope you got some idea now.
Regards,
Sowjanya
‎2007 Feb 26 10:07 AM
Check the following link
http://help.sap.com/saphelp_nw2004s/helpdata/en/08/d27c03b81011d194f60000e8353423/frameset.htm
Hope this helps.
Regards,
Kinshuk