2017 Nov 15 11:21 AM
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
2017 Nov 15 12:43 PM
Prefixing a variable with l doesn't make it local, lo_object is still global. Good program structure should avoid globals.
2017 Nov 15 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.