ABAP Keyword Documentation → ABAP − Reference → ABAP Syntax → ABAP Statements → Operands → Names for Individual Operands
Interface Component Selector
A component comp
of an interface is accessed using the following name:
intf~comp
In this case, the character ~
is the interface component selector. The name
intf
of an interface must be on the left of the interface component selector. The name comp
of the component must be on the right of the interface component selector.
The name intf~comp
identifies the components of interfaces in classes or component interfaces in composite interfaces.
Other versions:
7.31 | 7.40 | 7.54
Programming Guideline
Address interface components using interface reference variables
Note
An interface contains each component exactly once, regardless of how it is composed of component interfaces.
All the interface components are at the same hierarchical level. The name of an interface component
is uniquely defined using intf~comp
. intf
is always
the interface in which the component is declared. A direct chaining of interface names intf1~...~intfn~comp
is not possible.
Example
Declares interfaces and accesses their components.
TYPES t1 TYPE string.
ENDINTERFACE.
INTERFACE i2.
INTERFACES i1.
METHODS m2 IMPORTING p1 TYPE i1~t1.
ENDINTERFACE.
CLASS c1 DEFINITION.
PUBLIC SECTION.
INTERFACES i2.
ENDCLASS.
...
DATA oref TYPE REF TO c1.
oref->i2~m2( ... ).
...
CLASS c1 IMPLEMENTATION.
METHOD i2~m2.
...
ENDMETHOD.
ENDCLASS.