Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extended program check warining in ECC6

Former Member
0 Likes
820

Hi SDN's ,

i am getting a warning 'Do not use fields , field symbols (ITAB) globally'   ...i want to clear this warning with out using the Pseudo comments  like #EC NEEDED   if i use these pseudo comments it will show warning in hidden check........

i declare my ITAB as like....

types: begin of ty_final,

             ----------------

            ----------------

          ------------------

         end of ty_final.

data: itab type table of ty_final.  ( Warning)

how can i clear this warning with out using pseudo comments .......any one help ....

Thanks & Regards,

Suba.

5 REPLIES 5
Read only

matt
Active Contributor
0 Likes
780

You will get this message whenever you use globally defined internal tables or field symbols. Generally, you should have as little globally defined data as possible - only the essentials. To be rid of the message entirely, you need to encapsulate all operations involving the internal table (and ITAB is a really bad name for an internal table - choose something meaningful). You could for example, hand all the processing involving the internal table to a function module, or a global or locally defined class.

My executable programs usually only have a few globally defined references to classes. Everything else is handled within the class.

Read only

Former Member
0 Likes
780

Hi Matthew,

Thank you  for your valuable suggestion..,but in my program i am not using the OOPs (Ex:classes ) i used the general abap code ...i need some variables globaaly so i declared those in starting of the program...in ecc5 those are not shown warnings but when i check in ecc6 these are showing as warnings ........any other way to clear these earnings....

Thanks & Regards,

Suba.

Read only

matt
Active Contributor
0 Likes
780

No. If in ECC6 you declare an internal table or a field symbol outside of form (or local class) in an executable report, then you will get this warning, and must override it with the #EC comment - and explaining why it's being overridden.

The only alternative, if you don't want to use classes, is to put your functionality in function modules in a function group.

matt

Read only

Former Member
0 Likes
780

Hi Suba,

If you have declare the itab in TOP include or inside the modules you will get such kind of warnings.

Try to declare the ITAB inside form endform so that you can avoid such kind of warnings.

Regards,
Shyja

Read only

Former Member
0 Likes
780

Hey,

Analyze first if you really need to define your table ITAB globally? If it is used only inside one form routine, then declare the structure their only, don't define it globally (for example in TOP include).

In case you are using it at couple of places and need to define it globally, then you can approach as per Metthew suggestion. Hope it helps!