Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP Oops

prabhu_s2
Active Contributor
0 Likes
826

Hi

I want to build my skill set in oops in abap. i'm aware of the concepts in oops but the problem comes when to match or realise the functionality...for instance the use of sections like private, protected and public, encapsulation etc. Unable to relate them programatically on how to these concepts would help in real time. kindly help in making me realise the importance of these concepts.

thx

Prabhu

6 REPLIES 6
Read only

Former Member
0 Likes
728

Hi,

we have three types of access specifiers.

these are used for security purpose.

private

public

protected

private can be used with in the class.

it is like a local declaration.

suppose syntax.

private:call method a.

it will work in this class only, another class doesnt access this method.

public:

by using this access specifier we can access this method any where .

it works like global declaration.

syntax.

class c1

public: call method a.

end class c1.

class c2.

call method a.

private:call method b.

end class c2.

here private is declared in class c2.

it will permits to this class only.

in c1 method it will call any where.

protected means it can access only with in the subclass.

those which related old class and the new class.

we can declare method in class c1 as protected. it will call in class c2.

regards,

satish.

reward if it helpful.

Read only

Kanagaraja_L
Active Contributor
0 Likes
728

Hi Prabhu,

Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world.

Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency of object-oriented programming depends directly on how object-oriented language techniques are implemented in the system kernel.

object is a section of source code that contains data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object.

In object-oriented programming, objects usually have the following properties:

Encapsulation

Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself.

Polymorphism

Identical (identically-named) methods behave differently in different classes. Object-oriented programming contains constructions called interfaces. They enable you to address methods with the same name in different objects. Although the form of address is always the same, the implementation of the method is specific to a particular class.

Inheritance

You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones.

Check this for basic concepts of OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c4...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20...

For Materials:

1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291

2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt

3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf

4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf

5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt

6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf

7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt

😎 http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8

1) http://www.erpgenie.com/sap/abap/OO/index.htm

2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

General Tutorial for OOPS

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

Kanagaraja L

Read only

0 Likes
728

Objects restrict the visibility of their resources (attributes and methods) to other users

can u pls explain this?

Read only

Former Member
0 Likes
728

Hi Prabhu,

The below programs are posted by me in this link. [SAPTECHNICAL|http://saptechnical.com/Tutorials/OOPS/MainPage.htm]

  • Working with interfaces

  • Working with events in a global class

  • Using ABAP Classes in Workflow

  • Enhancing a Standard Class

  • Working on Polymorphism

  • Working with import, export and change parameters of a class

  • Inserting data into the database table using Classes (

  • Working with Constructor

  • Working with inheritance

  • Working with the keyword SUPER in object oriented programming

  • Global Class Functionality - Step-by-step with screenshots

  • Demo program illustrating Interfaces

  • Demo program illustrating Inheritance

  • Demo program illustrating Simple class and Super class

  • Object oriented programming (OOP) explained with an example

Thank you,

Let me know if you need any help..

Award points if help full...

Vikram.C