Understanding ABAP Object
page 9 of 12
by Arindam Ghosh
Average Rating: 
Views (Total / Last 10 Days): 54121/ 97


The methods are internal procedures that define the behavior of an object in a class. They can access all the attributes of a class. This allows them to change the data content of an object. They also have a "parameter interface," whose role is to help the users by supplying them with values when calling them and receiving values back from them. The private attributes of a class can only be changed by methods in the same class. The definition and parameter interface of a method is similar to that of function modules. Using the following processing block, you define a method <meth> in the definition part of a class and implement it in the implementation part:

METHOD <meth>

In the same way as in other ABAP procedures (subroutines and function modules), you can declare local data types and objects in methods. You call the following methods by using the CALL METHOD statement.

Instance Method

You can declare instance methods by using the METHODS statement. They play a very important role as they can access all of the attributes of a class and can trigger all of the events of the class.

Static Methods

You can declare static methods by using the CLASS-METHODS statement. They are important and can only access static attributes and trigger static events.

Special Methods

Apart from normal methods, there are two special methods which you call using CALL METHOD. These are called CONSTRUCTOR and CLASS _CONSTRUCTOR. They are automatically called when you create an object (Constructor) or when you first access the components of a class (CLASS _CONSTRUCTOR).

View Entire Article

User Comments

Title: understanding ABAP Objects..   
Name: Anony
Date: 2008-10-06 8:28:45 AM
Its worth reading and after this we need some lessons with examples to work it out and see abap objects in action...
Keep up the good work.

Title: Understanding ABAP Object   
Name: Reena
Date: 2008-07-15 12:41:28 PM
Hi Arindam Ghosh,

I have read the entire article. Its indeed very useful and self explanatory.
Thank you providing the information so elaborately.
If given an example, it would have been even more appreciable...

Thanks and REgards

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-06-18 5:58:49 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search