Ansicht
Dokumentation

ABENITAB_TABLE_LINE - ITAB TABLE LINE

ABENITAB_TABLE_LINE - ITAB TABLE LINE

PERFORM Short Reference   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

Pseudo Component TABLE_LINE for Internal Tables

In internal tables, you can generally address the entire table row in a key specification by using the pseudo component TABLE_LINE. This is particularly useful for tables whose line type does not have a structure.
You can, for example, define a
sorted table of integers as follows and process it in a loop with a WHERE condition:

DATA: wa   TYPE i,
      itab TYPE SORTED TABLE OF i WITH UNIQUE KEY TABLE_LINE.
...
LOOP AT itab INTO wa WHERE KEY table_line > 5.
  ...
ENDLOOP.

As TABLE_LINE is similar to a row component, the underlying row structure should not contain a component of the same name.

The old form TABLE LINE (without the underscore) is obsolete. SAP was unable to provide continued support since this form does not allow you to use references in tables to access attributes of the object referenced.

In ABAP Objects, that is, classes and class pools, a stricter syntax check is performed.

In the following example, ITAB is a table of object references. The associated class has an attribute NAME. You can access this attribute by specifying TABLE_LINE->NAME in a LOOP statement.

CLASS my_class DEFINITION.
  PUBLIC SECTION.
  DATA: name TYPE string.
  ...
ENDCLASS.

DATA: wa   TYPE REF TO my_class,
      itab TYPE TABLE OF REF TO my_class.

CREATE OBJECT wa. wa->name = 'Hugo'.  INSERT wa INTO TABLE itab.
CREATE OBJECT wa. wa->name = 'Nora'.  INSERT wa INTO TABLE itab.
CREATE OBJECT wa. wa->name = 'Jimmy'. INSERT wa INTO TABLE itab.
CREATE OBJECT wa. wa->name = 'Nora'.  INSERT wa INTO TABLE itab.

LOOP AT itab INTO wa WHERE table_line->name = 'Nora'.
  ...
ENDLOOP.






ABAP Short Reference   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 2458 Date: 20240420 Time: 014938     sap01-206 ( 62 ms )