Ansicht
Dokumentation

ABENCOMPONENT_CHAINING_SELECTOR - COMPONENT CHAINING SELECTOR

ABENCOMPONENT_CHAINING_SELECTOR - COMPONENT CHAINING SELECTOR

General Material Data   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Chainings

If a deeply nested subcomponent is used at an operand position, the operand must be denoted as a chaining of all components leading to this subcomponent. This chaining contains a suitable component selector between each component. The following rules apply to such chained names:

  • Taken together, the names to the left of each structure component selector must address a structured data type or a structure.
  • Taken together, the names to the left of each object component selector must address a reference variable.
  • The class component selector can occur in a name exactly once as the first selector.
  • The interface component selector can only occur more than once in a name if other component selectors are listed between the individual interface component selectors.

Note

In addition to the chaining of names, the following chainings are possible:

Chainings can be combined in any way as long as the corresponding rules are respected.

Example

Declaration of a nested structured data type struc2 in struc1 and a structure struc3 in an interface i1.

The component comp of struc3 is a data reference variable of the static type struc1. The i1 interface is the component interface of i2 and the latter is implemented in c1. In c2, a static attribute is declared as the object reference of the static type c1. The expression in the last line can be at an operand position that expects a data object, and identifies the component comp of the structure struc2 in a chaining that starts at class c2. A prerequisite for use of the expression is that both reference variables, oref and dref, point to the respective instances.

INTERFACE i1.
  TYPES: BEGIN OF struc1,
           ...
           BEGIN OF struc2,
             ...,
             comp TYPE ...,
             ...,
           END OF struc2,
           ...
         END OF struc1.
  DATA: BEGIN OF struc3,
          ...
          dref TYPE REF TO struc1,
          ...
        END OF struc3.
ENDINTERFACE.

INTERFACE i2.
  INTERFACES i1.
ENDINTERFACE.

CLASS c1 DEFINITION.
  PUBLIC SECTION.
    INTERFACES i2.
ENDCLASS.

CLASS c2 DEFINITION.
  PUBLIC SECTION.
    CLASS-DATA oref TYPE REF TO c1.
ENDCLASS.

...

... c2=>oref->i1~struc3-dref->struc2-comp ...






BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.

Length: 4052 Date: 20240426 Time: 164852     sap01-206 ( 50 ms )