SAP / SAP/code-pal-for-abap

Prefer NEW to CREATE OBJECT for classes with non-class-based exceptions

Open
#609 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello,
Is the suggestion "Prefer NEW to CREATE OBJECT" for classes with non-class-based exceptions ok? As far as I know with NEW no classic exceptions can be handled.
Regards,
Günter

Example:
data alv type ref to cl_gui_alv_grid.
create object alv
exporting i_parent = container
exceptions error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

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

No file, test, or rule entry point is named in the issue. Start by locating the check that emits “Prefer NEW to CREATE OBJECT” and examine how it handles classic exceptions; done means the rule’s behavior for this case is resolved and reflected in the relevant check or test.

Written by the indexing model from the issue text.

Assessment

Domain
devtools, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.