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

about classes

Former Member
0 Likes
587

hi

can anybody send me all existing short statements against their equivalents that long used in abap objects ?

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
529

Instance methods long:

call method ref->method_name

exporting

importing

etc.

Instance methods short:

ref->method_name

exporting

importing

etc.

Instance methods are called with

CALL METHOD ref->method_name .... When

calling an instance method from within another instance method, you can

omit the instance name ref. The method is automatically executed for the

current object.

Class methods long:

call method class_name=>method_name

exporting

importing

etc .

Class methods short:

class_name=>method_name

exporting

importing

etc .

Static methods (also referred to as class methods) are called using

CALL METHOD classname=>method_name ....

Like static attributes, static methods are addressed with their class name, since

they do not need instances.

As with instance methods, when you are calling a static method from within

the class, you can omit the classname. Otherwise, the same rules apply

here as for calling an instance method.

Functional methods:

Methods that have a RETURNING parameter are described as functional

methods. This means that they can have neither an EXPORTING nor a

CHANGING parameter. The RETURNING parameter must always be passed

using the VALUE addition, that is, by value as a local copy.

Long form:

methods get_result

importing im_par1 = val_ex1

im_parn = val_exn

returning value(result).

Short form

result = ref->funct_method_name( im_par1 = val_ex1

im_parn = val_exn ).

Example:

  • long syntax for functional call:

  • CALL METHOD lcl_airplane=>get_n_o_airplanes

  • RECEIVING

  • re_count = count.

  • a little bit shorter:

  • lcl_airplane=>get_n_o_airplanes( RECEIVING re_count = count ).

  • the shortest syntax for functional call:

count = lcl_airplane=>get_n_o_airplanes( ).

Widening cast:

If you want to assign a superclass reference to a subclass reference, you must

use the widening cast assignment operator

MOVE ... ?TO ... or its short form

?=

Aliases (Alias names are suitable for short-form

syntax when accessing components from different interfaces):

Example of an alias in the interface:

ALIASES a_1 FOR lif_1~method_1.

The interface method lif_1~method_1 can then be addressed with the

shorter form ref->a_1

I think this is just about it, as far as I know.

2 REPLIES 2
Read only

Former Member
0 Likes
529

ABAP has also implemented the OOP technology.

it uses classes, methods and interfaces instead of functiongroups and function modules.

As part of SAPu2019s long-standing commitment to object technology, Release 4.0

of R/3 will contain object-oriented enhancements to the ABAP programming

language. SAPu2019s object strategy is based on SAP Business Objects and now

covers modeling, programming, interfacing, and workflow. By using principles

like encapsulation, inheritance, and polymorphism, the object-oriented

extensions of ABAP will support real object-oriented development. This will

result in improvements in the areas of reusability, maintenance, and quality of

code. SAP offers an evolutionary approach toward objects which leverages

SAPu2019s own and its customersu2019 investments in existing business processes,

functionality and data.

follow this link ABAP OBJECTS with good examples.......

http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm

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

http://www.allsaplinks.com/

http://www.sap-img.com/

http://www.sapgenie.com/

http://help.sap.com

http://www.sapgenie.com/abap/OO/

http://www.sapgenie.com/abap/OO/index.htm

http://www.sapgenie.com/abap/controls/index.htm

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

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

http://www.sapgenie.com/abap/OO/index.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

http://www.sapgenie.com/abap/OO/

these links

http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm

For funtion module to class

http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm

for classes

http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm

for methods

http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm

for inheritance

http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm

for interfaces

http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm

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

these are the links

Check this for basic concepts of OOPS

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

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

Tabstrip

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

Editable ALV

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

Tree

http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm

General Tutorial for OOPS

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

http://www.sapdevelopment.co.uk/reporting/alvhome.htm

http://www.sap-img.com/abap/what-is-alv-programming.htm

http://www.sap-img.com/abap-function.htm

http://www.geocities.com/mpioud/Abap_programs.html

http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm

http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf

http://www.sap-img.com/abap-function.htm

Classical ALV:

http://www.geocities.com/mpioud/Abap_programs.html

OOPS ALV:

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

Also Chk this standard Programs.

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

Read only

Sm1tje
Active Contributor
0 Likes
530

Instance methods long:

call method ref->method_name

exporting

importing

etc.

Instance methods short:

ref->method_name

exporting

importing

etc.

Instance methods are called with

CALL METHOD ref->method_name .... When

calling an instance method from within another instance method, you can

omit the instance name ref. The method is automatically executed for the

current object.

Class methods long:

call method class_name=>method_name

exporting

importing

etc .

Class methods short:

class_name=>method_name

exporting

importing

etc .

Static methods (also referred to as class methods) are called using

CALL METHOD classname=>method_name ....

Like static attributes, static methods are addressed with their class name, since

they do not need instances.

As with instance methods, when you are calling a static method from within

the class, you can omit the classname. Otherwise, the same rules apply

here as for calling an instance method.

Functional methods:

Methods that have a RETURNING parameter are described as functional

methods. This means that they can have neither an EXPORTING nor a

CHANGING parameter. The RETURNING parameter must always be passed

using the VALUE addition, that is, by value as a local copy.

Long form:

methods get_result

importing im_par1 = val_ex1

im_parn = val_exn

returning value(result).

Short form

result = ref->funct_method_name( im_par1 = val_ex1

im_parn = val_exn ).

Example:

  • long syntax for functional call:

  • CALL METHOD lcl_airplane=>get_n_o_airplanes

  • RECEIVING

  • re_count = count.

  • a little bit shorter:

  • lcl_airplane=>get_n_o_airplanes( RECEIVING re_count = count ).

  • the shortest syntax for functional call:

count = lcl_airplane=>get_n_o_airplanes( ).

Widening cast:

If you want to assign a superclass reference to a subclass reference, you must

use the widening cast assignment operator

MOVE ... ?TO ... or its short form

?=

Aliases (Alias names are suitable for short-form

syntax when accessing components from different interfaces):

Example of an alias in the interface:

ALIASES a_1 FOR lif_1~method_1.

The interface method lif_1~method_1 can then be addressed with the

shorter form ref->a_1

I think this is just about it, as far as I know.