1. Public attributes
2. Private attributes
3. Instance attributes
4. Static attributes
5. Public methods
6. Private methods
7. Constructor method
8. Static constructor
9. Protected components
10. Polymorphism
Public attributes
Public attributes are defined in the PUBLIC section and can be viewed and
changed from outside the class. There is direct access to public attributes. As
a general rule, as few public attributes should be defined as possible.
PUBLIC SECTION.
DATA: Counter type i.
Private attributes
Private attributes are defined in the PRIVATE section. The can only be viewes
and changed from within the class. There is no direct access from outside the
class.
PRIVATE SECTION.
DATA: name(25) TYPE c,
planetype LIKE saplane-planetyp,
Instance attributes
There exist one instance attribute for each instance of the class, thus they
exist seperately for each object. Instance attributes are declared with the
DATA keyword.
Static attributes
Static attributes exist only once for each class. The data are the same for all
instances of the class, and can be used e.g. for instance counters. Static
attributes are defined with the keyword CLASS-DATA.
PRIVATE SECTION.
PUBLIC SECTION.
Private methods
Can only be called from inside the class. They are placed in the PRIVATE
section of the class.
Constructor method
Implicitly, each class has an instance constructor method with the reserved
name constructor and a static constructor method with the reserved name
class_constructor.
Static constructor
Protected components
Standard tables
This is the most appropriate type if you are going to address the individual
table entries using the index. Index access is the quickest possible access.
You should fill a standard table by appending lines (ABAP APPEND
statement), and read, modify and delete entries by specifying the index
(INDEX option with the relevant ABAP command). The access time for a
standard table increases in a linear relationship with the number of table
entries. If you need key access, standard tables are particularly useful if you
can fill and process the table in separate steps. For example, you could fill the
table by appending entries, and then sort it. If you use the binary search
option with key access, the response time is logarithmically proportional to the
number of table entries.
Sorted tables
This is the most appropriate type if you need a table which is sorted as you fill
it. You fill sorted tables using the INSERT statement. Entries are inserted
according to the sort sequence defined through the table key. Any illegal
entries are recognized as soon as you try to add them to the table. The
response time for key access is logarithmically proportional to the number of
table entries, since the system always uses a binary search. Sorted tables are
particularly useful for partially sequential processing in a LOOP if you specify
the beginning of the table key in the WHERE condition.
Hashed tables
This is the most appropriate type for any table where the main operation is
key access. You cannot access a hashed table using its index. The response
time for key access remains constant, regardless of the number of table
entries. Like database tables, hashed tables always have a unique key.
Hashed tables are useful if you want to construct and use an internal table
which resembles a database table or for processing large amounts of data.
Standard tables have a linear index. You can access them using either the
index or the key. If you use the key, the response time is in linear relationship
to the number of table entries. The key of a standard table is always non-
unique, and you may not include any specification for the uniqueness in the
table definition.
Sorted tables are always saved correctly sorted by key. They also have a
linear key, and, like standard tables, you can access them using either the
table index or the key. When you use the key, the response time is in
logarithmic relationship to the number of table entries, since the system uses
a binary search. The key of a sorted table can be either unique, or non-
unique, and you must specify either UNIQUE or NON-UNIQUE in the table
definition. Standard tables and sorted tables both belong to the generic group
index tables.
This table type is particularly suitable if you want the table to be sorted while
you are still adding entries to it. You fill the table using the (INSERT)
statement, according to the sort sequence defined in the table key. Table
entries that do not fit are recognised before they are inserted. The response
time for access using the key is in logarithmic relation to the number of
table entries, since the system automatically uses a binary search. Sorted
tables are appropriate for partially sequential processing in a LOOP, as long
as the WHERE condition contains the beginning of the table key.
Hashes tables have no internal linear index. You can only access hashed
tables by specifying the key. The response time is constant, regardless of the
number of table entries, since the search uses a hash algorithm. The key of a
hashed table must be unique, and you must specify UNIQUE in the table
definition.
This table type is particularly suitable if you want mainly to use key access for
table entries. You cannot access hashed tables using the index. When you
use key access, the response time remains constant, regardless of the
number of table entries. As with database tables, the key of a hashed table is
always unique. Hashed tables are therefore a useful way of constructing and
using internal tables that are similar to database tables.
STANDARD TABLE
1. Liner Index.
2. Time is directly proportional to table enteries.
3. Operations-APPEND,READ,MODIFY,DELETE.
4. READ is used only in Standard enteries.
SORTED TABLE
1. Binary Search.
2. Time logmathrically proportional to table enteries.
3. Operations-INSERT.
4. It is used in LOOP with WHERE clause.
HASHED TABLE
1. UNIQUE key.
2. RESPONSE time is independent from table entries i.e CONSTANT.
3. It is useful to construct a table,resembles a database table.
4. It is processing large data.