2008 Sep 23 7:47 AM
Hi.
Can we create a Object for the Interface. How it is possible?
Give me an example. if possible.
Thank you.
Hi,
No need to create an object for interface and will get an error if try creating it.
Directly specify the interface name and then the method name..
or else.
Data
w_ref type ref to <interface name>. " No need to instantiate the object
w_ref~<interface method>.
Hope this would help you.
Good luck
Narin
2008 Sep 23 9:17 AM
Hi,
No need to create an object for interface and will get an error if try creating it.
Directly specify the interface name and then the method name..
or else.
Data
w_ref type ref to <interface name>. " No need to instantiate the object
w_ref~<interface method>.
Hope this would help you.
Good luck
Narin
2008 Sep 23 9:39 AM
Hello Krishna
For sure you can create interface instance provided that there is an implementing class around. Example:
DATA: go_msglist TYPE REF TO if_reca_message_list.
go_msglist = cf_reca_message_list=>create( ).For a more elaborate example you may have a look at [Message Handling - Finding the Needle in the Haystack |https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
Final remark: The previous posting is a bit odd because interface methods never have any implementation.
Regards
Uwe
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |