Professional Documents
Culture Documents
OOABAP Overview
OOABAP Overview
OOABAP
OBJECTIVE
This presentation aims at providing the target audience with the
following:
OO concepts
Overview of OOABAP
OO - CONCEPTS
Object
Class
Attributes
Encapsulation
Polymorphism
Inheritance
OOABAP - Attributes
Public
Private
Attributes
Instance
Static
OOABAP- Methods
Public
Private
Methods
Constructor
Static Constructor
CLASSES
SUB CLASSES
Declaration
INTERFACES
Implemented :
In addition to & Independently of classes
Operations defined in the interface are implemented as methods of the
class, which must be present in class implementation part.
Interface attributes, events, constants and types are automatically
available to the class carrying out the implementation.
Interface components are addressed in the class by
<interface name> ~ <component name>
Definition:
Declaration (No visibility sections)
Components (Attributes, methods, constants, types) defined similar to
classes
Defined in public section of class definition
INTERFACES
This example is similar to the previous example, however an interface
is implemented with the method add_employee. Note that the interface
is only implemented in the super class ( The INTERFACE statement),
but also used in the subclasses.
The interface in the example only contains a method, but an interface
can also contain attributes, constants, types and alias names.
The output from example 3 is similar to the output in example 2.
All changes in the program compared to example 2 are marked with
red.
EVENTS
Events can only have EXPORTING parameters
When an event is triggered, only those events handlers that have registered
themselves using SET HANDLER by this point of runtime are executed.
You can register an event using ACTIVATION 'X' and deregister it by using
ACTIVATION 'SPACE
EVENTS
This is similar to the previous examples. All changes are marked with red.
There have been no changes to the subclasses, only to the super class and
the report, so the code for the subclasses is not shown.