SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Release-Specific Changes → Changes in Release 4.6A →
ABAP Objects - Further Developments in Release 4.6A
In Release 4.6A the following components are added to the core ABAP Objects functions:
1. Creating objects with explicitly specified class
3. Internal tables as collections
4. Functional methods in expressions
6. Change process for global interfaces
Creating Objects with Explicitly Specified Class
The statement
CREATE OBJECT has two new variants that make it possible to specify the
name of the class where the instance is created, both statically and dynamically. Previously, a reference
variable with reference to the class had to be created before an object could be created. In the new
variants of the statement CREATE OBJECT, any reference variables can be used that are compatible with the specified class.
Non-Public Instantiation
The new additions CREATE PROTECTED
and CREATE PRIVATE of the statement
CLASS class DEFINITION can be used to ensure that only the class itself or its subclasses
can create instances of the class class. This makes instance management non-ambiguous.
Internal Tables as Collections
If the row type of internal tables contains reference
variables as components comp, the attributes attr
of the object to which the reference of a row points can be used as key values for reading, sorting, and changing table rows. This is possible in the following statements:
If a table contains non-structured rows of the type of a reference variable, the attributes of the object
to which a row points can be addressed using table_line->attr.
Functional Methods in Expressions
Functional method calls are supported for the following statements and expressions:
Instance Destroyer
The instance destroyer can be used for releasing internal and external resources. External resources,
for example the printer of a called class, must be released by the application involved, whereas internal
resources are released automatically when the mode is closed. Currently a C function must be called for this purpose using SYSTEM-CALL.
Change Process for Global Interfaces
If a method is missing in the implementation, the syntax check produces a warning message instead of an error message. If the method is called at runtime, it is canceled.
If an implemented method is not used, a warning message is produced instead of an error message. The code of the method is ignored.
Compiler Enhancements
The statement CLASS class DEFINITION LOAD is no longer required with the following statements:
From within a global superclass, a subclass can be referenced provided that the superclass does not address components of the subclass.
Internal Optimizations