Skip to content

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 name

intf~comp

In this case, the character ~ is the interface component selector. The name intf of an interface must be to the left of the interface component selector. The name comp of the component must be to the right of the object 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

Declaration of interfaces and access to their components.

INTERFACE i1.
  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.