SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Declarations → Declaration Statements → Classes and Interfaces → Components in Classes and Interfaces → Implementing and including interfaces → INTERFACES →
INTERFACES - ABSTRACT, FINAL, DATA VALUES
Syntax
INTERFACES intf
[PARTIALLY IMPLEMENTED]
{ {[ABSTRACT METHODS meth1 meth2 ... ]
[FINAL METHODS meth1 meth2 ... ]}
| [ALL METHODS {ABSTRACT|FINAL}] }
[DATA VALUES attr1 = val1 attr2 = val2 ...].
Extras:
1. ... ABSTRACT METHODS meth1 meth2 ...
2. ... FINAL METHODS meth1 meth2 ...
3. ... ALL METHODS {ABSTRACT|FINAL}
4. ... DATA VALUES attr1 = val1 attr2 = val2 ...
Effect
In the public visibility area, the statement INTERFACES implements the interface intf in the class. Additions can also be defined to determine the properties of interface components in the class.
All local or global interfaces visible at this position can be specified for intf. The components of the interfaces become public components of the class after the implementation. An interface component called comp has the name intf~comp in the class, where intf is the name of the interface and the character ~ is the interface component selector. A class must implement all methods of the interface in its implementation part unless they are declared as abstract. One exception are test classes in which a partial implementation using the addition PARTIALLY IMPLEMENTED is allowed.
Notes
... ABSTRACT METHODS meth1 meth2 ...
... FINAL METHODS meth1 meth2 ...
Effect
Using the additions ABSTRACT METHODS and FINAL METHODS,
the individual instance methods meth of the interface are made either abstract
or final in the class to be implemented. The same rules apply as for the additions ABSTRACT
and FINAL of the
METHODS statement. In particular, the whole class must be abstract if an interface method
is made abstract and no interface methods can be executed at the same time after ABSTRACT METHODS and FINAL METHODS.
... ALL METHODS {ABSTRACT|FINAL}
Effect
Instead of making individual interface methods in the class abstract or final it is possible, using
the addition ALL METHODS {ABSTRACT|FINAL}, to make all interface methods either abstract or final.
... DATA VALUES attr1 = val1 attr2 = val2 ...
Effect
Using the addition DATA VALUES, initial values can be assigned to individual attributes attr. For instance attributes, this addition fulfills the same functions as the addition VALUE of the statement DATA for attributes in its own class. Constants declared in the interface by the statement CONSTANTS cannot be specified after the addition DATA VALUES. Furthermore, it is not currently possible to specify alias names.
Note
To specify values for the interface attributes of the
component interfaces
of a compound interface, the component interface must currently be directly bound again using the INTERFACES statement.