OOPS ABAP : Global INTERFACES With Example
Interfaces:
- They are the independent structures which can be used to extend the scope of the classes.
- The interfaces do not have their own implementation sections, all methods are abstract classes.
- The interfaces must be specified under Public section of the class.
- The symbol "~ (tilt)" is used to refer the attributes of the interfaces.
Steps to create Global Interfaces:
- Execute the t-code "SE24".
- Enter the global class name.
- click on create button.
- Select a radio button interface to create the gobal interfaces.
- Click on yes button and enter short desc.
- Enter method details
- Enter Parmeters.
- Save,check and activate.
Calling the methods of interface in sub class:
- Goto se24 and enter class name and click create.
- select radio button 'class' and press enter.
- Click on 'Interface' tab and enter interface class name and activate.
- Click on methods tab.
- Click on source code button and write the below code and activate.
Execute and check.
Comments
Post a Comment