Posts

Showing posts from February, 2022

Class Visibility

Image
  Introduction:    We will cover the following basic concepts: Simple example class, specially designed to understand the basics of Class Visibility. How visibility of the class components like attributes and methods work. How can a developer utilize the visibility property to his advantage ?.   Use of 'Me' variable Demonstration of visibility in an executable eclipse program. Why use Visibility?   Lets Start : 1. Let us create a class in HANA Eclipse with the following structure. We will define the below components in the class definition. PUBLIC SECTION : This means the class components like Attributes and Methods defined in this section are visible outside the  Class, in Sub-Classes, in an Executable Program. We will create Attribute:  CV_PUBLIC_ATTR with default value 'PUBLIC SECTION'. We will create Method: CM_PUBLIC_METHOD,CM_PUBLIC_MAIN_METHOD. PROTECTED SECTION : This ...

HANA Eclipse Class

Image
 Introduction:    We will cover the following basic concepts: How to create a Class in HANA Studio ( HANA Eclipse ). Basic components of the Class in the HANA Studio. How to create a simple program in the HANA Studio. Old VS New ABAP Syntaxes to call the Method of the Created Class.   Lets Start : 1. Let us Create an Eclipse Class. Login to HANA Eclipse Studio and open the ABAP Perspective. File->New->Other.. Select 'ABAP Class'. We can see the CLASS DEFINITION Section and CLASS IMPLEMENTATION Section generated as shown below. We are going to Define a method in the Public Section of Class Definition. And implement the Method in the Class implementation section as well.        2. Let us learn the Generated Default Components of the class. Line 1 : CLASS CLASS_NAME DEFINITION : Here we define the components of the class.  For Example Attributes, Methods Etc. Line 2 : PUBLIC : This means the Class is a Global Class. Line 3 : FINAL : Thi...

Working with Interfaces

Image
    Introduction : We will cover the following basic concepts:  Basic differences between Classes and Interfaces. Creating Global Interface & Class in SE24. Call Interface Methods in the SE38 program. Basic differences between Interface Methods and Normal Methods . Bonus Point. Lets Start : So what is this 'Interface'? Let us understand it by comparing it with Class as both are created in SE24 with the same screen layout. Interface VS Class       2. Create an Interface in SE24. Let us create an Interface with the name 'ZGLOBAL_INTERFACE'. Click on Create button. Select the 'Interface' radio button. Click on ok. Enter description as shown below. Click on save Create Method Definition as shown below. Note here that the implementation part does not exist. Also, note that there is no Private and Protected Section in the Interface and yes that is interesting. Save and Activate the Interface. Now let us create 2 Global Classes and Implement the Created Inter...

Static Method VS Instance Method

Image
  Introduction : We will cover the following basic concepts:  Creating a Global Class in SE24. Understand the basics of Methods. Understand the basics of 'Types of Methods'. Define and Implement a Static Method & an Instance Method. Call a Static and an Instance Method in the SE38 program. Bonus Point. Lets Start : Create a Global Class: ZGLOBAL_CLASS in Se24. Choose the following options to create a Class. Choose 'Class' Radio Button.    Choose 'Usual ABAP Class' and 'Final' Check Box.       2. Now let us understand the basics of Methods. Methods are just like Function Modules.  Check out the below comparison that will help you to get a basic understanding of Methods.         3. Now let us understand the basics of  'Types of Methods' with a below simple comparison.             4. Now let us define and implement a Static Method & an Instance Method. Create METHOD_INSTANCE ...