‎2007 Jun 18 8:18 AM
Where can I see the implementation of methods, declared in Interfaces?
<b>For ex:</b> There is one interface <b>if_ixml_element</b> and <b>get_value()</b> is its method. Now where can I see the implementation of get_value() method, as methods are not implemented in interfaces, please provide some information.
Thanks
‎2007 Jun 18 8:41 AM
hi,
We can see the implementation of interface method in
the <b>IMPLEMENTATION CLASS of INTERFACE</b>.
analyse this program, you clearly find where the methods of interface are implemented.
INTERFACE I_COUNTER.
METHODS: SET_COUNTER IMPORTING VALUE(SET_VALUE) TYPE I,
INCREMENT_COUNTER,
GET_COUNTER EXPORTING VALUE(GET_VALUE) TYPE I.
ENDINTERFACE.
CLASS C_COUNTER1 DEFINITION.
PUBLIC SECTION.
INTERFACES I_COUNTER.
PRIVATE SECTION.
DATA COUNT TYPE I.
ENDCLASS.
CLASS C_COUNTER1 IMPLEMENTATION.
<b> METHOD I_COUNTER~SET_COUNTER.
COUNT = SET_VALUE.
ENDMETHOD.</b>
METHOD I_COUNTER~INCREMENT_COUNTER.
ADD 1 TO COUNT.
ENDMETHOD.
<b>METHOD I_COUNTER~GET_COUNTER.
GET_VALUE = COUNT.
ENDMETHOD.</b>
ENDCLASS.
regards,
Ashokreddy.
Message was edited by:
Ashok Reddy
‎2007 Jun 18 8:22 AM
Hi,
look here:
Methods of Class CL_GUI_ALV_GRID
See this link
http://help.sap.com/saphelp_erp2004/helpdata/en/0a/b5533cd30911d2b467006094192fe3/content.htm
Also see this
http://help.sap.com/saphelp_erp2004/helpdata/en/0a/b5531ed30911d2b467006094192fe3/content.htm
Refresh grid display
Use the grid method REFRESH_TABLE_DISPLAY
Example:
CALL METHOD go_grid->refresh_table_display.
Regards
‎2007 Jun 18 8:28 AM
Thanks,
But you are telling about methods of class. I am concerned with methods of interfaces
‎2007 Jun 18 8:39 AM
Hello Vinayak
The classes and interfaces for XML handling are somewhat special.
Have a look at the sample report <b>T_PARSING_FILE</b> (package <b>SIXML</b>):
* create the ixml main factory
ixml = cl_ixml=>create( ).Here is the coding of the CREATE method (in include <b>BCCIIXML_LCLD</b>):
method create.
if not the_iXML is initial.
rval = the_iXML.
else.
data: begin of classes,
...
ref_14 type ref to cl_ixml_element, " class of our interest
iid_15 type i value 140,
...
ENDMETHOD.Double-click on CL_IXML_ELEMENT leads to the class definition (same include):
*--------------------------------------------------------
* cl_ixml_element definition
*--------------------------------------------------------
class cl_ixml_element definition
inheriting from cl_ixml_node.
public section.
interfaces:
if_ixml_element. " the class implements the interface IF_IXML_ELEMENT
methods:
destructor not at end of mode.
endclass.You will find the class implementation in include <b>BCCIIXML_LCLI</b>:
*--------------------------------------------------------
* cl_ixml_element implementation
*--------------------------------------------------------
class cl_ixml_element implementation.
method destructor.
system-call c-destructor 'xm_CDestr_Unknown' using m_pointee.
endmethod.
method if_ixml_element~get_attribute
by kernel module abkm_iXMLElement_GetAttribute.
endmethod.
method if_ixml_element~get_attribute_ns
by kernel module abkm_iXMLElement_GetAttributeNS.
endmethod.
method if_ixml_element~set_attribute
by kernel module abkm_iXMLElement_SetAttribute.
endmethod.
method if_ixml_element~set_attribute_ns
by kernel module abkm_iXMLElement_SetAttributeNS.
endmethod.
...Thus, it appears that the implementation of these classes are integrated into the SAP-kernel.
Regards
Uwe
‎2007 Jun 18 8:41 AM
hi,
We can see the implementation of interface method in
the <b>IMPLEMENTATION CLASS of INTERFACE</b>.
analyse this program, you clearly find where the methods of interface are implemented.
INTERFACE I_COUNTER.
METHODS: SET_COUNTER IMPORTING VALUE(SET_VALUE) TYPE I,
INCREMENT_COUNTER,
GET_COUNTER EXPORTING VALUE(GET_VALUE) TYPE I.
ENDINTERFACE.
CLASS C_COUNTER1 DEFINITION.
PUBLIC SECTION.
INTERFACES I_COUNTER.
PRIVATE SECTION.
DATA COUNT TYPE I.
ENDCLASS.
CLASS C_COUNTER1 IMPLEMENTATION.
<b> METHOD I_COUNTER~SET_COUNTER.
COUNT = SET_VALUE.
ENDMETHOD.</b>
METHOD I_COUNTER~INCREMENT_COUNTER.
ADD 1 TO COUNT.
ENDMETHOD.
<b>METHOD I_COUNTER~GET_COUNTER.
GET_VALUE = COUNT.
ENDMETHOD.</b>
ENDCLASS.
regards,
Ashokreddy.
Message was edited by:
Ashok Reddy
‎2007 Jun 22 12:42 PM
Hi Vinayak,
Implementation of methods of interfaces can be found in classes that implement the interface.
So using "where used list" you can find the classes that implement the interface and then find which class implements the required method.
Award points if found useful.
Regards
Indrajit