Skip to Content

How to correct Message Code HEL 0510 ?

Nov 07, 2017 at 04:31 PM


avatar image

how can I correct this warning ?

Programa: YY_TEST Línea: 8 [Prio 3]
Do not declare fields and field symbols (GLB_TXT) globally.
Deactivatable using pragma ##NEEDED. Message Code HEL 0510

this is the ABAP code -->

REPORT yy_test.

DATA glb_txt TYPE string.

glb_txt = 'HELLO WORLD !'.

WRITE / glb_txt.

10 |10000 characters needed characters left characters exceeded

Does the warning appear in normal syntax check or in extended syntax check SLIN? What are the settings in the latter?


The warning appears in transaction code SLIN and SCII ( code inspector )

The setting in transaction code SLIN is only one option --> "Programming Guidelines"

* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Horst Keller
Nov 09, 2017 at 07:32 AM

The message is a warning from extended program check (SLIN) that occurrs only, if in SLIN the checks for Programming Guidelines are switched on.

Of course it is recommended to check this, but you don't have to.

In order to circumvent the message, you have to program according to the programming guidelines

Do not declare global variables

and avoid global data by implementing your code in (local) classes.

    CLASS-DATA var TYPE i.

  METHOD main.
    cl_demo_output=>display( var ).
  cls=>main( ).

Show 1 Share
10 |10000 characters needed characters left characters exceeded

thanks Horst Keller

Remi Kaimal B Nov 07, 2017 at 05:58 PM

1) You can move the Data declaration to be within the START-OF-SELECTION and the WRITE statement, within END-OF-SELECTION
2) Suppress the message by suffixing for your declaration :
DATA glb_txt TYPE string. ##NEEDED

Hope this helps.


Show 3 Share
10 |10000 characters needed characters left characters exceeded

"You can move the Data declaration to be within the START-OF-SELECTION"

This doesn't change anything, because START-OF-SELECTION does not have a local data area.


1). "Oops". for this specfic report, the declaration should move with a form routine

2) (Based on the approach you have given) :
Some project quality deliverables, recommend, the Extended check to be free of errors/warnings, with no changes in SLIN parameters. These QA document other wise known as "Code review checklist".
Here, ECCheck is run, downloaded and attached to the document

In such cases use of Pragmas "##" can not be avoided.

Good, that this a "Hello world" program, the warning can be avoided with Object Oriented approach.
In real time scenario, if its 2000 lines of procedural code, this approach is close to impossible. The change request on the development, will have the whole program re-written just to avoid a warning in ECCheck :-D

Take the case, the usage of a SELECT-OPTIONS parameters. These are inevitable global variables, that has to pass through ECCheck. (if there is no choice of keeping the warning)

The suggestive approach is to use Pragmas - "##", telling the system : "Hey !! there is nothing i can do about this warning, but to bypass it"


perhaps the key question is what is the alternative to avoid the use global variables in ECC Ehp 8 ?

Jelena Perfiljeva
Nov 07, 2017 at 05:58 PM

Which release are you on? There is no HEL message class in EHP6.

The message is quite self-explanatory though. In a nutshell, it doesn't like that you're declaring the variable at the top (=global) and then just using it everywhere. In case of a "hello world" program it's not really a problem IMHO (although some folks here might disagree :) ). But how to change this is up to you. I suspect it'll become apparent when you move on to learning about modularization.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

ECC Ehp 8

in previous releases the use of global variables was ok, but in this release it seem that this is not a best practice anymore ?


"There is no HEL message class in EHP6."

This message rather comes from TRMSG or so.


Thanks for clarification! I guess I should've actually asked about ABAP version.


I believe it has not been "best practice" for quite sometime (if ever). It was just something available and used rather widely. But you'll find many mentions on SCN that global variables need to be avoided and it's like the root cause of all evil.

But, as I noted, in particular case of such a small program I honestly don't see a problem with it. I'd just ignore the warning for now.

Searched in Google for "global variables ABAP" but didn't find what I expected. I'd refer to the ABAP documentation for your ABAP version for more information on the variable scope.