SAP / SAP/code-pal-for-abap

Array First Position

Open
#336 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new check
Dominant language
ABAP
Stars
435
Forks
77
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides an ABAP example but names no file, test, or entry point. Start by finding where existing code-quality checks are defined, then determine how the check should identify table access at position [0] and add coverage for the shown case.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.