Skip to Content
-1

Do not declare global fields in ATC check

Nov 15, 2017 at 11:21 AM

58

avatar image
Former Member

Hi All,

In my custom program, I have written the below code.

CLASS: lcl_rep_error DEFINITION DEFERRED.
DATA : lo_object TYPE REF TO lcl_rep_error.

In ATC checks, it is showing me "Do not declare global fields" . What exemption do we need to apply here. How to overcome this warning. Please suggest.

Thanks,

HT

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
Nov 15, 2017 at 12:49 PM
3

Same as https://answers.sap.com/answers/350551/view.html

And as Mike said. Or do you think that

CLASS: lcl_rep_error DEFINITION DEFERRED.

opens a class context?

Last but not least: For the (rare) cases, where global data are needed, you can use the pragma ##NEEDED.

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Nov 15, 2017 at 12:43 PM
2

Prefixing a variable with l doesn't make it local, lo_object is still global. Good program structure should avoid globals.

Share
10 |10000 characters needed characters left characters exceeded