Posts

Showing posts with the label OOPS

Step by Step Tutorial on Creating class in SAP ABAP Class Builder(SE24)

Image
Step by Step Tutorial on Creating a class in SAP ABAP Class Builder(SE24) This Tutorial will explain to you, How to create a Class in the SAP ABAP and Class Methods and Class Attributes and defining source code in the Class Builder (SE24). Here learn About Class in Object-Oriented Programming . Go to SAP Easy Access Screen where enter the SE24(Class Builder) Transaction Code. Select the Radio button class and Click on the Continue Button. Select Public Instantiation and select the usual ABAP class radio button.  Save it as a Local Object. Click Methods Tab and define methods. Click on Attributes Tab and crate variables, types. Click on Save, Check and Activate. To implement methods, select method and click on code button where define source code. To view the source code, click the Source code based button. class ZDEMO_CLASS definition   public   final   create public . public section. *"* public components...

All about Classes in ABAP Object Oriented Programming

All about Classes in ABAP Object Oriented Programming Class describes real world Object that may be car ,home and Animal .In ABAP Object Oriented (OO)Programming ,Class concept is first and Fore most Topic ,so through this post ,we will learn class in ABAP and Types of class and How to create classes and Methods in SAP ABAP. Class consists the Properties and Attributes. Properties are Methods or Functions or Procedures. Attributes are Variables . One class can have Any number of Objects that is Object is like a class but object can never be a Class. Example :Car is a class ,Here class contains some common Properties for its related Objects.                 Object may be different companies like Ford Maruthi etc. Objects are instances of a class ,so for one class ,we can create many objects  Class Definition in SAP ABAP Class: we can build an Object properties using class. The attributes of objects are defin...

SAP ABAP OOPs Concepts Interview Questions Part Four

SAP ABAP OOPs Concepts Interview Questions Part Four In the previous Lessons ,i have shared Import OOPs interview Questions and answers and in this part i have shared some more important OOPs concepts questions and answers and additional sample questions for freshers and experienced consultants. When we are using the overriding in Object oriented programming? Sometimes,we need to extend the functionality of the inherited method ,then overriding is used. What is narrow casting and when we are using it? Narrow casting is assigning the instance of subclass back to instance of the super class that we are using it when we are giving the more importance of child object than the super class object. What is widening cast and when we are using it? Widening cast is assigning instance of the super class to subclass and it is used when we require to access the specific functionality of the subclass from the super class. What are the constructors in OOPs? Constr...

ABAP OOPs Interview Questions Part Three

ABAP OOPs Interview Questions Part Three Dear friends ,in the previous lessons we have learnt ABAP OOPs Inteview questions and Part one and Part two OOPS interview questions and Now we learn more Part three OOPs interview questions which are useful for freshers and senior ABAP and Webdynpro Consultants. Brief about Object Oriented Programming In SAP ABAP? The object-oriented approach, however, focuses on objects that represent abstract or concrete things of the real world. These objects are first defined by their character and their properties which are represented by their internal structure and their attributes (data). The behavior of these objects is described by methods (functionality). Objects Objects are instances of classes. They contain data and provides services. The data forms the attributes of the object. Classes Classes describe objects. From a technical point of view, objects are run time instances of a class. In theory, you can create any number of object...

ABAP OOPs Interview Questions Part Two

ABAP OOPs Interview Questions Part Two in SAP ABAP  Friends ,yesterday we have learnt some of the Very import OOPs interview questions and more OOPs interview questions part one and also here i shared with different type of interview questions which are useful for real time and freshers ABAP consultants. What are access specifiers in OO ABAP  ? PUBLIC->For all classes PRIVATE ->Only its won classes PROTECTED ->parent and child classes  What is the Difference between Class and Object ? A Class is actually a blueprint or a template to create an Object. Whereas an Object is a an actual instance of a Class. For example Car a class, while Maruthi is a real Object which is an Object of Car Class. How polymorphism can be implemented ? Using below techniques ,we can implement polymorphism: Method Overriding Method Overloading Operator Overloading What is Method Overriding ? Method overriding allows a subclass to override a specific implement...

SAP ABAP OOPs Interview Questions Part one

SAP ABAP OOPs Interview Questions Part one What are the main features of Object-oriented programming? Encapsulation Plomorphysm Inheritance Abstraction What is the class definition? A class is an abstract definition of a real-world object. What is an Object? An object is a real-world Object that contains properties and data. How many types of classes in oops? Public class Private Class Final Class Singleton Class Abstract class Friend class Persistent class What is the difference between class and function group? We can't create many instances of the function group but we create a number of instances for a class within an ABAP program. What are the components of the classes? Methods and attributes are components of the classes What are the differences between local and global classes? Locals is defined within the ABAP program but Global class is defined in the class builder SE24, available for all SAP applicatio...

Abstract Class and Interface in SAP ABAP

Abstract Class and Interface in SAP ABAP When the SAP world increasing ,It have to compete with other software packages .In that case ,Object oriented Programming is the most important language to increase the reuse ability of ABAP functions.Abstract classes and interfaces are also part of OO ABAP concepts .So every ABAP consultant Must be know clear basics of OOPs Concepts.Today ,we will discuss ,what is Abstract class and interfaces and difference between them. What is an Abstract Class? Abstract Class is also like a class but it has special features and it can’t be instantiated itself .It means we can't execute abstract class itself but we can execute it from the inherited classes that is we can use components(methods) of Abstract class in the inherited classes . Abstract class should at least contain one abstract method. Abstract methods are methods without any implementation – only a declaration. We can certainly define the variables referencing to Abstract class and ...

Object Oriented Programming in SAP ABAP

Object Oriented Programming in SAP ABAP As SAP ABAP Developer, you should have advanced skills in Object Oriented Programming which is used in mainly in Webdynpro ABAP and BADI also developed with object oriented Method .in the advanced versions of SAP System ,there is more requirements on OO Programming in ABAP. The main ABAP objects components and functions are : 1) Classes 2) Object handling 3) Declaring and calling methods 4) Inheritance  4) Interfaces 5) Triggering and handling events 6)Class and interface-fools Now ,we will discuss all above functionalities one by one What are ABAP Objects and Object oriented programming in sap The object-oriented concept mainly depends on the objects that represent abstract  things of the real world. These objects are first defined by their attributes and their properties which are defined by their internal structure and their attributes .  The behavior of these objects is described by methods (...

SAP ABAP Object oriented programming Interview Questions and Answers

SAP ABAP Object oriented programming Interview Questions and Answers These Object-oriented programming Interview Questions and Answers are useful for Freshers and Experienced ABAP Consultants. what are Exception Classes in Object-Oriented Programming? Definition: Exceptions are the errors that occur during the execution of the program that interrupts the normal flow of control. Types of Exceptions: All exception classes are inherited from global class CX_ROOT and the classes that are directly inherited are CX_STATIC_CHECK: It is checked by both the compiler and runtime system. If any exception of this category found and not handled locally inside the procedure, it has been declared in the RAISING clause of the procedure’s interface CX_DYNAMIC_CHECK: It is checked only at runtime system. when the excetions tries to leave a procedure that it has been declared in RAISING class. Generally all system exceptions like CX_SY_ZERO_DIVIDE will come under these ex...