Top 40 Sap Object Oriented Abap Interview Questions
Q1. Can We Declare Events In Interface In Ooabap ?
Yes, we will declare activities in interface in Object Oriented ABAP
Q2. What Is Me Variable?
It much like a selfreference, by way of this we will name strategies which are with in equal class with out developing object.
Q3. What Is The Difference In An Instance Method And A Static Method?
Instance approach is available one after the other in every item (instance), static method is worldwide and no instance is needed for static approach.
Q4. Can We Instantiate Abstract Class In Ooabap ?
We cannot create an object to the abstract elegance as an alternative create an object to the child elegance and speak to the strategies .
Abstract magnificence are specifically used for developing inheritance.
Q5. How To Declare And Raise Events In Ooabap ?
We need to follow underneath steps when operating with occasions in Object Oriented ABAP:
Define an occasion
Define a technique
Link event and method and convert the technique into occasion-handler approach
Create a triggering technique that allows you to raise the event
Use set handler and sign in occasion handler method to a particular example inside the program
Q6. Is It Mandatory To Implement All Methods Of Interface In The Class Which Includes Interface?
No it isn't always obligatory to put into effect all regular interface strategies however it's far mandatory to put into effect all Abstract methods.
Q7. How To Call A Method?
Call approach ref>method_name .
Q8. What Is The Difference Between Function Group And Classes?
We can create many instances of the same magnificence with in a software, but we can not create many instances of function organization.
Q9. What Are The Differences Local & Global Classes?
Local classes are described domestically with in a program and the opposite packages can’t get entry to the equal lessons at once.
But global instructions are not like that they are globally available from ABAP environment.
Global training are centrally defined in a repository. Transaction code for worldwide classes is SE24(magnificence builder).
Q10. Can We Raise Events In Interface?
No, you cannot enhance occasions in interface, Because there is no Implementation for the methods. We can create events in interfaces .
Q11. What Are The Types Of Constructor's In Ooabap ? Explain ?
CONSTRUCTOR's are special type of techniques, constructor technique is achieved automatically every time a item is created or instantiated.
Constructor: This approach is completed automatically whenever item is created, this is used to set default values with appreciate to instance/item. The name of the constructor method is CONSTRUCTOR.
Static Constructor: This technique is executed mechanically every time item is created, that is used to set default values globally regardless of times/gadgets.The name of the static constructor is CLASS_ CONSTRUCTOR.
Q12. What Is A Class In Ooabap?
Class is person defined facts kind which incorporates techniques, events, attributes, interfaces and many others.
Q13. What Is A Single-ton Class?
Single-ton elegance is a class which lets in to instantiate as soon as best .
Q14. How To Create A Global Class?
With tcode SE24.
Q15. How To A Create Object For The Class?
Data: ref type ref to .
Create item ref.
Q16. What Is A Polymorphism In Ooabap ?
Polymorphism is a concept by way of which the equal technique names will behave otherwise in one-of-a-kind training i.E each method could have it's own implementation in exceptional classes however with the identical name.
Q17. Can We Instantiate The Interface?
No, we can't instantiate interface the usage of create object key-word.
Q18. What Is A Global Class In Sap ?
Global classes and interfaces are defined inside the Class Builder (Transaction SE24) within the ABAP Workbench.All of the ABAP packages in an R/3 System can access the global classes
Q19. What Is An Interface In Ooabap?
Interface is magnificence which includes techniques without implementations.
Q20. What Is A Friend Class?
Friend elegance is a class it is able to get admission to personal components of it’s pals class.
Q21. What Is A Constructor Method In Ooabap ?
These are unique sort of strategies
constructor method is done automatically every time a item is created or instantiated
These methods are particularly used to set default values in a class
The call of the constructor technique is 'constructor'
These methods have most effective importing parameters
There are not any exporting parameters
Q22. How Many Types Of Classes Are There In Ooabap?
Public elegance
Private elegance
Final magnificence
Singleton elegance
Abstract elegance
Persistent magnificence
Friend class
Q23. What Is A Singleton Class In Ooabap ?
Singleton class is a category which allows to instantiate(Create Object) only once .
Q24. Can We Defined A Class Without A Constructor In Ooabap ?
Yes, magnificence can be created without any constructor. Default constructor will be created when we define a class with out constructor.
Q25. What Is Alias?
Instead of specifying full name of interface techniques, we can assign it a call that could without delay cause.
Q26. What Is Abstract Method In Ooabap ?
Abstract strategies is a way which does not contain any implementation.
Q27. What Are The Advantages Of Oo Alv ?
Some of the principle benefits of Object Oriented ALV
We don't have any of events available within the lessons while compared to ALV with feature modules which offers flexibility for the programmer to broaden ALV'S for numerous situations.
We can show more than one ALV grid information on a unmarried display.
The ALV grid statistics is displayed within the form of custom box with which we will control the scale of ALV grid Whereas we can not manipulate the dimensions of the ALV with feature Modules.
We also can place unique UI elements like checkbox, Radiobutton on the identical screen further ALV grid statistics.
Q28. What Is The Difference In Attributes Defined In The Public Versus Private Section Of A Class?
Public attributes may be accessed by using magnificence, subclasses and different lessons wherein as Private attributes can be accessed with the aid of class itself only.
Q29. How To Define A Class Locally?
Class <cl_name> definition.
Public segment.
Methods: m1 uploading p1 kind <c>
Exporting p2 kind <i>
Changing p3 kind <n>
Returning p4 type <i>
Exceptions <e1>.
Protected segment.
Private segment.
Endclass.
Class <c1_name> implementation.
Method m1.
Endmethod.
Endclass
Q30. Can We Make Methods Of Interface As Abstract And Final In Ooabap ?
No we can not make interface methods as abstract or very last in Object Oriented ABAP
Q31. What Is An Event In Ooabap ?
Event is a mechanism by means of which approach of one elegance can improve technique of another elegance, without the threat of instantiating that class.
Q32. Does Polymorphism Achieved Through Interfaces?
Yes, by way of using interface idea in SAP ABAP, we can polymorphism
Q33. What Is A Local Class In Sap ?
Local instructions are described in an ABAP application (Transaction SE38) and can most effective be used in the application in which they may be defined.
Q34. What Is The Difference Between Abstract Class And Interface?
Abstract class is a category which contains at least one summary approach( Method without implementation), Abstract magnificence consists of techniques with implementation and without implementation and we can't create example for the summary elegance .
Abstract elegance is mainly for inheritance .
Interface consists of techniques with out implementation .
Q35. Can We Achieve Multiple Inheritance Using Interfaces?
Yes, by means of the use of interface idea in SAP ABAp, we will acquire multiple inheritance
Q36. What Is The Difference Between Singleton And Static Class In Sap Abap ?
Before going to static training, you have to recognize static additives.
Static Components: Static additives (static attributes, static occasions and static techniques) exists globally, no want to create item/example of the class to get right of entry to them, we are able to access them by way of using static issue selector => .
Static Class: A magnificence that simplest incorporates static components and no instance additives is known as a static magnificence.
Singleton Class: It is a category which does not let you create more than one instances.
Q37. What Is An Abstract Class In Ooabap ?
It is a class which contains techniques with implementation as well as methods without implementation .
Abstract magnificence is a category which includes at the least one abstract approach.
Q38. What Is The Use Of 'defination Deferred' Keyword In Ooabap ?
It is the keyword which shows the class definition is delayed or postponed or Defined at some place in application.
Syntax : CLASSÂ Â DEFINITION DEFERED.
Q39. What Is Alias Name In Ooabap?
Alias is an alias name for the interface technique carried out within the class .
Q40. How To Create An Object For Private Class?
In general we cannot create item for a non-public class, but we will get admission to static technique of a non-public class so call that method the use of its elegance name and import that item.
For example take one static method with an exporting parameter inside non-public magnificence and write object creation code in that static method and export that object.

