‎2009 Mar 17 9:58 AM
Hi All,
I want to use a method of a class which will be IF_ABC_XYZ~ <amethod> ( ). how can i use this method in my program , I have the instance of the class which have the above mentioned method?
Thanks & Regards
Pavan
‎2009 Mar 17 10:12 AM
Hi,
If you have the instance of the class then you need to use
CALL METHOD instance->if_interface~method_name (
EXPORTING
IMPORTING ).
Regards,
Sesh
‎2009 Mar 17 10:12 AM
Hi,
If you have the instance of the class then you need to use
CALL METHOD instance->if_interface~method_name (
EXPORTING
IMPORTING ).
Regards,
Sesh
‎2009 Mar 17 10:18 AM
thanks
here the case is like this
data :
lv_type TYPE REF TO IF_some xyz.
now by using a static class method i am able to get the return type equal to lv_type i.e
CALL METHOD cl_someclassname=> amethod ( )
IMPORTING
type = lv_type.
now when i debug and see lv_type is having a class name inside it. I want to use a method of this class.
How can I call the method which Iam able to see in the lv_type when i debug.
‎2009 Mar 17 10:50 AM
Hello
You need to cast your interface object to the corresponding class object:
data :
lv_type TYPE REF TO IF_some xyz,
lo_class TYPE REF TO cl_xyz_class. " implements interface IF_SOME_XYZ
now by using a static class method i am able to get the return type equal to lv_type i.e
CALL METHOD cl_someclassname=> amethod ( )
IMPORTING
type = lv_type.
lo_class ?= lv_type.
CALL METHOD lo_class->name_of_method.Regards
Uwe
‎2009 Mar 17 11:36 AM
Thanks I already resolved the issue, as you said in the exmaple, I also approched the same way , Thanks