Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI - doubt

Former Member
0 Likes
510

hi SDN'rs,

What is the use of Interface in a Business Object .

Thanks

4 REPLIES 4
Read only

Former Member
Read only

Former Member
0 Likes
486

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

Read only

abdul_hakim
Active Contributor
0 Likes
486

Hi,

BAPIs are Standarized interface for accessing the business data of the SAP System from another

SAP System / External System.

Regards,

Hakim

Read only

former_member189631
Active Contributor
0 Likes
486

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.