04-27-2007 10:55 AM
Hi to all,
can anyone give the information regarding oops in abap,
like how it is used and the scope of it in abap.
points will be rewarded,
rushi.
Message was edited by:
Rushi T
04-27-2007 10:56 AM
Hi Rushi,
Check this info.
Object Orientation
A programming technique in which solutions reflect real world objects
What are objects?
An object is an instantiation of a class. E.g. If Animal is a class, A cat can be an object of that class.
With respect to code, Object refers to a set of services (methods/attributes) and can contain data
what are classes?
A class defines the properties of an object. A class can be instantiated as many number of times
Advantages of Object Orientated approach
Easier to understand when the system is complex
Easy to make changes
Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
Polymorphism - Identically named methods behave differently in different classes
Inheritance - You can use an existing class to define a new class
Polymorphism and inheritance lead to code reuse
Classes in abap
Classes in ABAP are either local or global
Global classes are declared in class builder (SE24 )
Local classes are declared within programs
Components of a class
Attributes : Internal data fields of class
Attributes can be either instance attributes specific to each instance of the class ( object ) or static attributes which are common to all instances
Methods :
Subroutines / procedures in a class that define the behavior of the object. Methods can also be instance methods or static methods
Encapsulation in ABAP
Encapsulation is obtained through the restriction in visibility of attributes / methods attained through the definition of Public, Private and Protected section of a class
Public Section
All of the components declared in the public section are accessible to all users of the class, and to the methods of the class and any classes that inherit from it. The public components of the class form the interface between the class and its users.
Protected Section
All of the components declared in the protected section are accessible to all methods of the class and of classes that inherit from it.
Private Section
Components that you declare in the private section are only visible in the methods of the same class.
Inheritance in ABAP
Inheritance allows you to derive a class based on an already existing class.
CLASS <subclass> DEFINITION INHERITING FROM <superclass>.
..
ENDCLASS.
CLASS <subclass> IMPLEMENTATION.
ENDCLASS.
All attributes / methods of super class become the property of the subclass too. Only public and protected attributes / methods are visible in the subclass
Polymorphism in ABAP
when methods with same name perform differently under different circumstances we call it polymorphism.
Methods redefined in a subclass is an example for Polymorphism
Interfaces
Interfaces are used to define the model of a class.
They also like classes can be either local or global.
Global interfaces are defined through SE24 and local interfaces are defined in program.
Please check this online document (starting page 1291).
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Also check this links as well.
http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.futureobjects.de/content/intro_oo_e.html
http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards
04-27-2007 10:56 AM
04-27-2007 10:56 AM
Hi Rushi,
Check this info.
Object Orientation
A programming technique in which solutions reflect real world objects
What are objects?
An object is an instantiation of a class. E.g. If Animal is a class, A cat can be an object of that class.
With respect to code, Object refers to a set of services (methods/attributes) and can contain data
what are classes?
A class defines the properties of an object. A class can be instantiated as many number of times
Advantages of Object Orientated approach
Easier to understand when the system is complex
Easy to make changes
Encapsulation - Can restrict the visibility of the data ( Restrict the access to the data )
Polymorphism - Identically named methods behave differently in different classes
Inheritance - You can use an existing class to define a new class
Polymorphism and inheritance lead to code reuse
Classes in abap
Classes in ABAP are either local or global
Global classes are declared in class builder (SE24 )
Local classes are declared within programs
Components of a class
Attributes : Internal data fields of class
Attributes can be either instance attributes specific to each instance of the class ( object ) or static attributes which are common to all instances
Methods :
Subroutines / procedures in a class that define the behavior of the object. Methods can also be instance methods or static methods
Encapsulation in ABAP
Encapsulation is obtained through the restriction in visibility of attributes / methods attained through the definition of Public, Private and Protected section of a class
Public Section
All of the components declared in the public section are accessible to all users of the class, and to the methods of the class and any classes that inherit from it. The public components of the class form the interface between the class and its users.
Protected Section
All of the components declared in the protected section are accessible to all methods of the class and of classes that inherit from it.
Private Section
Components that you declare in the private section are only visible in the methods of the same class.
Inheritance in ABAP
Inheritance allows you to derive a class based on an already existing class.
CLASS <subclass> DEFINITION INHERITING FROM <superclass>.
..
ENDCLASS.
CLASS <subclass> IMPLEMENTATION.
ENDCLASS.
All attributes / methods of super class become the property of the subclass too. Only public and protected attributes / methods are visible in the subclass
Polymorphism in ABAP
when methods with same name perform differently under different circumstances we call it polymorphism.
Methods redefined in a subclass is an example for Polymorphism
Interfaces
Interfaces are used to define the model of a class.
They also like classes can be either local or global.
Global interfaces are defined through SE24 and local interfaces are defined in program.
Please check this online document (starting page 1291).
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
Also check this links as well.
http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.futureobjects.de/content/intro_oo_e.html
http://www.sap-img.com/abap/business-add-in-you-need-to-understand-abap-oo-interface-concept.htm
/people/ravikumar.allampallam/blog/2005/02/11/abap-oo-in-action
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards
04-27-2007 10:57 AM
hi,
chk this.
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
some helful links.
Go through the below links,
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
Regards
Reshma