Skip to content

Array First Position #336

@lucasborin

Description

@lucasborin

ABAP array starts at position [ 1 ], as opposed to java which starts at [ 0 ].

ABAP compiles the code if you try to access the array at position [ 0 ].
However, it raises the CX_SY_ITAB_LINE_NOT_FOUND when executing the code.

For instance:

DATA array TYPE TABLE OF string.

APPEND 'this' TO array.
APPEND 'is' TO array.
APPEND 'a' TO array.
APPEND 'test' TO array.

cl_demo_output=>display( array ).

cl_demo_output=>display( array[ 0 ] ).

It would be good to have a check that identifies these access to position [ 0 ] during the development phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions