SAP INTERFACE COMPONENT SELECTOR SAP Info












ARTICLE ( Version: 0004)

• ~ ABAP_SELECTOR ( Version: 0004)

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.

ABAP_PGL 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.

ARTICLE ( Version: 0005)

• ~ ABAP_SELECTOR ( Version: 0005)

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.

ABAP_PGL 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.
Message text extract from SAP system. Copyright SAP SE.


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!