Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array First Position #336

Open
lucasborin opened this issue Mar 1, 2021 · 0 comments
Open

Array First Position #336

lucasborin opened this issue Mar 1, 2021 · 0 comments
Labels
new check New check

Comments

@lucasborin
Copy link
Member

lucasborin commented Mar 1, 2021

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.

@lucasborin lucasborin added the new check New check label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new check New check
Projects
None yet
Development

No branches or pull requests

1 participant