Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Internal Tables →  Processing Statements for Internal Tables 

Internal Tables - comp1 comp2 ...

Individual components of internal table rows are addressed in a range of statements for processing internal tables. If not stated otherwise, the following syntax applies to the labels comp1 comp2...:

Other versions: 7.31 | 7.40 | 7.54

Syntax


... { comp_name[-sub_comp][{+off(len)}|{->attr}] } | { (name) } ...

Effect

The following alternatives are available for specifying components:

  • Directly specifying the name comp_name of a component.
  • If the data type of the components is character-like and flat, an offset/length +off(len) can be appended to the name of the component (as in subfield access) to access subareas of the component. Only directly specified numbers or constants can be specified for off and len.
  • If the component is structured, you can use the structure component selector - to access the sub_comp components of the substructure.
  • If the component has a reference type, you can use the object component selector -> to access all visible attributes attr of the referenced object. In this case, a table component can be listed more than once.
  • Specifying a parenthesized character-like data object name, which contains the name of the component (uppercase) when the statement is executed.
  • The name of the component in name can contain an offset/length. The object component selector can also be specified for accessing attributes, however only those attributes can be addressed that are also known statically.
  • name is not case-sensitive. If name only contains blank spaces, this component specification is ignored in the execution of the statement. If name contains a non-existent component, a non-handleable exception is raised.
  • Specifying the pseudo component table_line to address the whole table row as a component.


Notes

  • A component cannot be specified more than once. However, you can specify further components alongside table_line. You need to do this, for example, if the row type of the internal table is an object reference and you want to specify the value of the reference and the value of an attribute of the object at the same time.

  • If the table has a non-structured row type, the pseudo comment table_line can be addressed as the only component.

  • The components specified must not be elementary.

  • If the data type allows it (character-like and flat), an offset/length can also include neighboring componentss