SAP / SAP/code-pal-for-abap

New check - modification of importing parameter via field-symbol

Open
#32 1 comment 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

  methods EXECUTE
    importing
      !IR_OPERAND1 type ref to DATA
      !IR_OPERAND2 type ref to DATA
      !IR_RESULT type ref to DATA.

METHOD execute.      
   CHECK ir_operand1 IS BOUND AND
   ir_operand2 IS BOUND AND
   ir_result   IS BOUND.

    ASSIGN ir_operand1->* TO FIELD-SYMBOL(<operand1>).
    ASSIGN ir_operand2->* TO FIELD-SYMBOL(<operand2>).
    ASSIGN ir_result->*   TO FIELD-SYMBOL(<result>).

    TRY.
      <result> = <operand1> - <operand2>.
    CATCH cx_root.
    ENDTRY.
ENDMETHOD.

I found this method which treats an importing parameter as if it were changing/returning.

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

Start by reviewing the repository's existing check entry points and comparable checks; the issue provides only the ABAP EXECUTE method example and no file or test path. Determine the intended diagnostic for modifying an importing parameter through field symbols, then add coverage for the shown case and verify the check reports it.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.