sapdev logo background
sapdev logo sapdev logo
Comments

SAP ITAB COMPONENTS documentation, setup help and example usage



Return to SAP documentation index


ARTICLE

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

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, the structure component selector -

  • can be used to access the sub_comp components of the substructure.
  • If the component has a reference type, the object component selector - can be used 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 be specified in name to read attributes, but only those attributes can be addressed that can be identified statically.

  • name is not case-sensitive. If name only contains blanks, this specified component is ignored when the statement is executed. 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 can only be specified more than once if it has a reference type. Further components, however, can be specified alongside

  • table_line . This is necessary, for example, if the row type of the internal table is an object reference and the value of the reference and the value of an attribute of the object are to be specified 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 adjacent components

  • A Customizing include must not be specified as a component if it is empty.
    Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




  • ITAB_CLASS_ATTRIBUTES_AS_KEY
    ITAB_DATA_TYPE




    comments powered by Disqus