Yes, we can declare events in interface in Object Oriented ABAP
It just like a selfreference, by this we can call methods that are with in same class with out creating object.
Instance method is available separately in each object (instance), static method is global and no instance is required for static method.
We need to follow below steps when working with events in Object Oriented ABAP:
No it is not mandatory to implement all normal interface methods but it is mandatory to implement all Abstract methods.
Call method ref>method_name .
We can create many instances of the same class with in a program, but we cannot create many instances of function group.
No, you can not raise events in interface, Because there is no Implementation for the methods. We can create events in interfaces .
CONSTRUCTOR's are special type of methods, constructor method is executed automatically whenever a object is created or instantiated.
Class is user defined data type which contains methods, events, attributes, interfaces etc.
Single-ton class is a class which allows to instantiate once only .
With tcode SE24.
Data: ref type ref to .
Create object ref.
Polymorphism is a concept by which the same method names will behave differently in different classes i.e each method will have it's own implementation in different classes but with the same name.
No, we can not instantiate interface using create object keyword.
Global classes and interfaces are defined in the Class Builder (Transaction SE24) in the ABAP Workbench.All of the ABAP programs in an R/3 System can access the global classes
Interface is class which contains methods without implementations.
Friend class is a class it can access private components of it’s friends class.
Singleton class is a class which allows to instantiate(Create Object) only once .
Yes, class can be created without any constructor. Default constructor will be created when we define a class without constructor.
Instead of specifying full name of interface methods, we can assign it a name which can directly trigger.
Abstract methods is a method which doesn't contain any implementation.
Some of the main advantages of Object Oriented ALV
Public attributes can be accessed by class, subclasses and other classes where as Private attributes can be accessed by class itself only.
class <cl_name> definition.
Public section.
Methods: m1 importing p1 type <c>
Exporting p2 type <i>
Changing p3 type <n>
Returning p4 type <i>
Exceptions <e1>.
Protected section.
Private section.
Endclass.
Class <c1_name> implementation.
Method m1.
Endmethod.
Endclass
No we can not make interface methods as abstract or final in Object Oriented ABAP
Event is a mechanism by which method of one class can raise method of another class, without the hazard of instantiating that class.
Yes, by using interface concept in SAP ABAP, we can polymorphism
Local classes are defined in an ABAP program (Transaction SE38) and can only be used in the program in which they are defined.
Abstract class is a class which contains at least one abstract method( Method without implementation), Abstract class contains methods with implementation and without implementation and we cannot create instance for the abstract class .
Yes, by using interface concept in SAP ABAp, we can achieve multiple inheritance
Before going to static classes, you should understand static components.
It is the keyword which indicates the class definition is delayed or postponed or Defined at some place in program.
Syntax : CLASSÂ Â DEFINITION DEFERED.
Alias is an alias name for the interface method implemented in the class .
In general we can not create object for a private class, but we can access static method of a private class so call that method using its class name and import that object.
For example take one static method with an exporting parameter inside private class and write object creation code in that static method and export that object.