Professional Documents
Culture Documents
ALV-ABAP Custom PDF
ALV-ABAP Custom PDF
ALV-ABAP Custom PDF
by calling methods
DATA: v1 TYPE I,
PROGRAM xy.
DATA o1 TYPE REF TO c1.
--- attribute can occur anywhere a normal variable can occur
CREATE OBJECT o1.
x = o1->v1 + sin( o1-> v1 ).
CALL FUNCTION 'abc' EXPORTING p1 = o1->v1 .
PROGRAM xy.
--- start nested transaction
CALL METHOD TACtrl=>CreateNew.
CALL METHOD TACtrl=>Current->Commit.
Visibility of Class
Public section
Protected section
Private section
Constructors
Constructors are special methods that cannot be
called using CALL METHOD instead they are
called automatically by the system
Executed only once per instance(object)
We have to define them explicitly in the class
They have a predefined name
Only has importing parameters and Exceptions
Two types of Constructors
Static Constructor
Instance Constructor
Instance Constructor
Class XYZ definition
METHODS:
* Using the constructor to initialize parameters
constructor IMPORTING xxx type yyy,.
Endclass.
Class xyz implementation.
Method Constructor.
Endmethod.
Endclass
START-OF-SELECTION.
CREATE OBJECT airplane1 exporting im_name = 'Hansemand'
im_planetype = 'Boing 747'.
Static Constructor
Class-methods: class_constructor
Only accessed once per program
Automatically called before the class is first
accessed
Creation of 1st object
1st access to static method
1st access to static attribute
Cannot have parameters or Exceptions
Inheritance
Inheritance allows you to derive a new class from
an existing class
Class ABC definition INHERITING FROM XYZ
XYZ is the super class and ABC is called as sub
class derived from super class
Only the public and protected components of the
super class are visible in the subclass
You can declare the private components in the
subclass that have the same name of private
components in super class. Each class works on
its own private components
Single Inheritance
A rc h iv e M g r
IArchive
P la n
C u s to m e r M a te ria l
Interface
Interfaces are independent structures that you can
implement in a class to extend the scope of that
class
Interfaces, along with inheritance, provide
polymorphism.
A class with an interface should implement all the
methods of that interface
Values of interface attributes are assigned at the
time of inclusion in a class except
Nested interfaces is also possible
Interfaces
Events
Events occur at a particular point in time, e.g. change in
state of an object
METHOD CancelClicked.
"--- DoubleClick not visible
ENDMETHOD.
ENDCLASS.