21.03.2013 Views

Object Oriented ABAP

Object Oriented ABAP

Object Oriented ABAP

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Binding in <strong>ABAP</strong> <strong>Object</strong> <strong>Oriented</strong> Programming<br />

Some basic terminologies<br />

1.1 <strong>ABAP</strong> <strong>Object</strong>s<br />

<strong>ABAP</strong> objects is the term given to object oriented programming done in <strong>ABAP</strong>. This<br />

programming model unites data and functions. OO <strong>ABAP</strong> is built on existing <strong>ABAP</strong> language.<br />

<strong>ABAP</strong> objects are run in same environment as the normal <strong>ABAP</strong> programs. OO <strong>ABAP</strong> is part<br />

of <strong>ABAP</strong> since R/3 release 4.0<br />

1.2 Class<br />

Class is a prototype that defines data and the behaviour common to all the objects of<br />

certain kind. Here methods provide the behaviour. We can say classes describe objects.<br />

Classes can be declared either globally or locally. Global classes can be declared using<br />

transaction SE24. Local classes are declared in an <strong>ABAP</strong> program (reports etc).<br />

1.3 <strong>Object</strong>s<br />

It signifies the real world. Technically we can say objects are instances of a class. We can<br />

create any number of objects from a class template. All the objects created have unique<br />

identity and each contain different set of attributes. <strong>Object</strong>s we create in a program exist<br />

only till the program exists.<br />

1.4 Encapsulation<br />

Through encapsulation we restrict the visibility of attributes and methods in the object.<br />

There are three levels of visibility in OO <strong>ABAP</strong>.<br />

Public<br />

Protected<br />

Private<br />

1.5 Polymorphism<br />

The name of method is same but they behave differently in different classes. It means<br />

implementation of method (i.e. body of the method) is different in different classes. It can<br />

be achieved in two different ways in OO <strong>ABAP</strong>.<br />

Interfaces<br />

Overriding methods or redefining methods in each class after inheritance

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!