Skip to Content
avatar image
-1
Former Member

Do not declare global fields in ATC check

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 15, 2017 at 12:49 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2017 at 12:43 PM

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

    Add comment
    10|10000 characters needed characters exceeded