Working with Interfaces

By Vikram Chellappa, Mouri Tech Solutions

In ABAP interfaces are implemented in addition to, and independently of classes. An interface only has a declaration part, and do not have visibility sections. Components (Attributes, methods, constants, types) can be defined the same way as in classes.

  • Interfaces are listed in the definition part of the class, and must always be in the    PUBLIC SECTION.

  • Operations defined in the interface are implemented as methods of the class. All methods of the interface must be present in the implementation part of the class.

  • Attributes, events, constants and types defined in the interface are automatically available to the class carrying out the implementation.

  • Interface components are addressed in the class by <interface name>~<component name>

Go to SE24 provide interface name.

Interface name start with ZIF_

Press create button.

Provide description.

Save it.

Save it.

Provide the method name.

Provide the parameters for this method.

The screen is like this.

Then save it, check it, activate it.

We cannot implement the method of this interface.

Provide the name in the class.

Create it.

Save it.

Go to interface tab.

Provide the interface name.

Save it.

Then go to the methods tab.

Then we can see the interface method name in the class method.

Then double click on the method then write the logic here.

Then save it, check it, activate it.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image