‎2007 Apr 02 6:17 AM
hi SDN'rs,
What is the use of Interface in a Business Object .
Thanks
‎2007 Apr 02 6:22 AM
Hi ganesh,
chk this:
http://help.sap.com/saphelp_46c/helpdata/en/a5/3ec8534ac011d1894e0000e829fbbd/content.htm
keerthi
‎2007 Apr 02 6:23 AM
hi ganesh
hopen this helps
Interfaces are independent structures that you can implement in a class to extend the scope of that class.a universal point of contact.They provide one of the pillars of polymorphism, since they allow a single method within an interface to behave differently in different classes.
Can be declared globally or locally within a program.
Locally declared in the global portion of a program using:-
INTERFACE <intf>.
...
ENDINTERFACE
The definition contains the declaration for all components (attributes, methods, events) of the interface. They automatically belong to the public section of the class in which the interface is implemented.
Interfaces do not have an implementation part, since their methods are implemented in the class that implements the interface.
Interfaces do not have instances.
To implement an interface in a class, use the statement
INTERFACES <intf>.
in the declaration part of the class.
A component <icomp> of an interface <intf> can be addressed as though it were a member of the class under the name <intf~icomp>.
Interface References
Addressing Objects Using Interface References
Using the class reference variable <cref>:
To access an attribute <attr>: <cref>-><intf~attr>
To call a method <meth>: CALL METHOD <cref>-<intf~meth>
Using the interface reference variable <iref>:
To access an attribute <attr>: < iref>-><attr>
To call a method <meth>: CALL METHOD <iref>-><meth>
Addressing a constant <const>: < intf>=><const> (Cannot use class name).
Addressing a static attribute
<attr>: < class>=><intf~attr>
Calling a static method <meth>: CALL METHOD <class>=><intf~meth>
(Cannot use Interface method ).
<<simple program.>>
report ysubdel .
interface i1.
data : num type i .
methods : meth1.
endinterface.
class c1 definition.
public section.
methods : meth1.
interfaces : i1.
endclass.
class c1 implementation.
method : meth1.
write:/5 'I am meth1 in c1'.
endmethod.
method i1~meth1.
write:/5 'I am meth1 from i1'.
endmethod.
endclass.
start-of-selection.
data : oref type ref to c1. create object oref.
write:/5 oref->i1~num.
call method oref->meth1.
call method oref->i1~meth1.
u acan also refeer the following link
<a href="http://www.sapgenie.com/interfaces/index.htm">http://www.sapgenie.com/interfaces/index.htm</a>
regards
navjot
reward accordingly
Message was edited by:
navjot sharma
‎2007 Apr 02 6:40 AM
Hi,
BAPIs are Standarized interface for accessing the business data of the SAP System from another
SAP System / External System.
Regards,
Hakim
‎2007 Apr 02 6:53 AM
Hi Ganesh Ram,
BOR:
it is now the central access point for external applications to access SAP business object types, SAP interface types and their BAPIs.
The BOR has two essential functions:
It defines and describes SAP business objects and SAP interface types and their BAPIs.
If you are developing an application program, you retrieve details of the SAP business object types or SAP interface types, their key fields and their BAPI methods from the BOR. The BOR contains all the information you need to integrate the correct object type definitions and BAPI calls into your application program.
It creates instances of SAP business objects.
The runtime environment of the BOR receives requests to create runtime objects from client applications and creates the appropriate object instances
Please visit this link also,
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5e11c24a1611d1894c0000e829fbbd/frameset.htm
Regards,
Ramganesan K.