Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.

Slides:



Advertisements
Similar presentations
CE881: Mobile and Social Application Programming Simon M. Lucas Menus and Dialogs.
Advertisements

Advanced ABAP Objects Programming Horst Keller / Stefan Bresch Business Programming Languages, SAP AG.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Technical Support: (989) GIS and Mapping Procedures in ArcMap 9.x Creating an ArcMap Project Editing an ArcMap Project Printing an ArcMap Project.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Introduction to Data Structures, Spring 2007 Slide- 1 California State University, Fresno Introduction to Data Structure Object Oriented Programming Concepts.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
Inventory Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic or Figure.
Microsoft Access 2007 Microsoft Access 2007 Introduction to Database Programs.
Access Tutorial 10 Automating Tasks with Macros
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Object Based Programming. Summary Slide  Instantiating An Object  Encapsulation  Inheritance  Polymorphism –Overriding Methods –Overloading vs. Overriding.
0 UMN 2011 ERP Terapan ABAP Introduction Session # 8.
NextGen Trustee Department Disbursements This class will cover the various methods of handling department disbursements. Whether entering them manually.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
220 FINAL TEST REVIEW SESSION Omar Abdelwahab. INHERITANCE AND POLYMORPHISM Suppose you have a class FunClass with public methods show, tell, and smile.
BASE CLASSES AND INHERITANCE CHAPTER 4. Engineer Class.
An Object-Oriented Approach to Programming Logic and Design
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Chapter 8: Writing Graphical User Interfaces
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
General Systems Information ALEPH v20.01 Library Staff Training © South Dakota Library Network, 2013 ©Ex Libris (USA), 2011 Modified for SDLN Version
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Lecture Set 11 Creating and Using Classes Part B – Class Features – Constructors, Methods, Fields, Properties, Shared Data.
University of Sunderland COM 220 Lecture Six Slide 1 Building Interactive Forms Applications using Oracle.
Introduction to ABAP Selection Screens. Slide 2 Screens (Types) There are three types of screens Selection screens get parameter input for reports List.
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Concurrent Programming and Threads Threads Blocking a User Interface.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
1 CSC/ECE 517 Fall 2010 Lec. 3 Overview of Eclipse Lectures Lecture 2 “Lecture 0” Lecture 3 1.Overview 2.Installing and Running 3.Building and Running.
Interactive Programs Java API. Terminology Event—an action or occurrence, not part of a program, detected by the program. Events can be Event—an action.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Introduction to Java Chapter 7 - Classes & Object-oriented Programming1 Chapter 7 Classes and Object-Oriented Programming.
Microsoft Visual Basic 2012 CHAPTER ELEVEN Multiple Classes and Inheritance.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Chapter 5 Introduction to Defining Classes
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Intermediate Documents (IDOCs) What is an IDoc What is an IDoc An IDoc is simply a data container that is used to exchange information between any two.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Java Programming: Guided Learning with Early Objects Chapter 9 Inheritance and Polymorphism.
Inheritance and Polymorphism
Multiple Classes and Inheritance
Chapter 5 Classes.
Using Procedures and Exception Handling
12 Product Configurator
Java Programming Language
Advanced Java Programming
CSE 1030: Implementing GUI Mark Shtern.
Extending Classes Through Inheritance
Presentation transcript:

Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad

How to work with Class Builder (SE24) Goto transaction SE24.

Give a name and press create. A pop up window appears asking for selecting class or interface. Select class and press continue button,

Now another pop up comes asking for short description, instantiation ( like Public, Private, Abstract and Protected ) and type of the class (normal ABAP Class, Persistent Class or Exception class). Select the appropriate class type. If you don’t want to create any subclass of this class, then check the checkbox named “Final”.

Now you will get the class builder screen. There are a lot of options like Methods, Attributes, Events, friends, Interfaces,Constructor,Class Constructor etc.

Defining attributes Goto attributes tab. Specify the attribute name, level ( Instance or Static), visibility, associated type, description, initial value etc. Usually attributes are defined in the private section of the class so that only methods of the class can manipulate them.

Defining methods Click on methods tab. Give a method name, level (Instance or Static), visibility (Public, protected or private ) and description.

If you are using parameters to import or export data from main program, click on parameters button and specify the appropriate parameters. Constructor is a special method which is automatically called whenever an instance of the class is created. It can be added to the set of methods by clicking on the Constructor button.

Class Constructor is the static version of Constructor and can be included in the methods list by clicking “Class Constructor” in the toolbar.

Implementing the methods Double click on any method name and you will get an editor to perform the coding. Provide the coding within METHOD….ENDMETHOD.

Creating interfaces Goto transaction SE24. Give name and click on create and select interface radio button and give a short description. As in the class, you can define methods, attributes, events, interfaces within interface. After activating the interface, you can link the methods in the class by giving the interface name in the Interfaces tab.

On saving, automatically all the methods in the interface will be added to the Methods tab in the class. Provide the coding for the methods as explained previously.

Defining Events In the events tab, give the event description like name, level (Instance or Static), Visibility (public, protected, private) and short description. Events can be handled by methods either in the same class or in a different class.

Handling events in the same class Define a method in the Methods tab and activate the class now. Click on the detailed view icon. Check the “Event handler for “ checkbox and fill the class and the required event. Now a link icon appears in “Method type” column like this.

If in the event definition, any parameters are defined, they will have to be copied to the parameter interface of the event handler method. So go to the Parameter interface of the method by clicking on Parameter button. Copy the parameters of the event by clicking on the following icon.

Linking of Event and the method can be made complete by using the statement SET HANDLER. User defined events are raised by using the statement RAISE EVENT. In the above example, while processing HANDLE_DOUBLE_CLICK, we raise the event my_event and it will be handled by the method handle_user_def.

Handling events of standard class Suppose you want to handle double click event in ALV grid, you can create a custom class and create a method to handle the event. Click on the detailed view icon. Check the “Event handler for “ checkbox and fill the class and the required event.

Now a link icon appears in “Method type” column like this. Now you can provide the implementation of the event handler method by double clicking the method name.

Defining Friend classes If a class wants to access the protected and private components of another class, then the former can be made a “friend” of the latter. Goto Friends tab in Class Builder and specify the friend class. Let us create a private attribute for the class so that it can be accessed by friend function.

Now create a friend class which has a method to access the private attribute of the previous class. Now you can provide the implementation of the method showing the way in which the private attribute is accessed.

How to create sub classes (Inheritance) In properties of the class, specify the super class. On saving the subclass, the public and protected components of the super class will automatically be added to the corresponding list.

Redefining superclass methods Place the cursor on the method to be redefined and click on the Redefine Icon You can redefine the default superclass implementation in the editor like this. In the above code, CALL METHOD super->handle_double_click is used to execute the super class implementation, before performing subclass implementation.

In the main program, the subclass objects are instantiated and redefined methods can be called. When the above program is executed, initially control goes to subclass’s redefined method handle_double_click. Then the superclass implementation is done and control comes back to perform subclass implementation.

Creating persistent classes Global classes, as such are persistent, but their instances need not be. Usually the data, after program execution, is lost. If the data is to be stored permanently ( persistently), they need to be stored in a database. Persistent object concept was introduced with this idea in mind. To create persistent objects, Go to SE24 and select persistent class. The class name should start with ZCL_( for eg: ZCL_AMIT_PERST)

Now automatically, various components are generated in Methods ( like handle_exception, get, init, set, invalidate), events, friends tab.

In addition, a class agent starting with ZCA_ ( ZCA_AMIT_PERST) and a base class ( ZCB_AMIT_PERST), which is the super class of agent class, are also generated. This agent class not only manages the instances of persistent classes, but also performs the actual database accesses. The base class (ZCB_AMIT_PERST) can also be viewed in the friends tab of the created class. Now you can map the database to the created class by clicking on the ‘Persistence’ button in the toolbar. A pop up appears asking for database table/structure

Now you will get all the table fields in the bottom-most section. Now you can double click on any of the table fields. You can edit the field properties and now when you click on ‘up arrow’ close to the description to update it in the persistent class.

When you click Save and click on ‘Back’ button, new GET_ ( for read-only fields ) and SET_ ( for other fields ) are generated in the Methods tab. Now activate the class and the agent class.

Now in the main program, you need to define a reference variable of the agent class, filling it with reference from the static attribute AGENT. Now create the new instance of persistence class using the method of base class CREATE_PERSISTENT. If an object already exists, you can raise the exception CX_OS_OBJECT_EXISTING by using try catch statements. Fields which are not read-only can be set by using SET_ statements. Now the updates can be made permanent by using COMMIT WORK statement. After creation of persistent objects, they can be loaded into main program using the method GET_PERSISTENT passing the key values in the parameter interface. Data from specific fields can be obtained by the statement GET_.

Inheriting Standard SAP Classes Standard classes can be extended by creating their subclasses.

Thank You