Skip to Content

How to suppress 'Include name does not begin with the prefix of the current class pool'?

Hi,

from Code Inspector I received the hint to not use the same include in multiple methods, so I have moved the include now to "Class-Relevant Local Definitions".

While this works, I get now a warning 'Include name "..." does not begin with the prefix (...) of the current class pool'. (class is in our namespace prefix, include is prefix of a sap product which is a prerequisite of the class).

Can I suppress this warning somehow?

This is on NetWeaver 7.40.

Thanks,

Wolfgang

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Oct 13, 2017 at 08:29 AM

    Includes are an obsolete construct. If you want to do things properly, use a local class. If the code is to be shared across multiple classes then create a global class. This is a much more flexible approach and allows for better encapsulation than you can achieve with includes.

    Add comment
    10|10000 characters needed characters exceeded

    • Horst Keller Matthew Billingham

      "Terminology quibble".

      'xactly.

      When we say "source code modularization" we mean "source code organization" rather than "modularization of functionality"

      I set myself a marker to remove "source code modularization" from the documentation ...

  • Oct 14, 2017 at 12:31 PM

    Why are you using the include? Can you move it into a class/method construct? Is there a reason why it works better in the include? Your actual question suppress the message. Add the following to the end of your include CCDEF. See if that helps with the message. Another possibility is to create a type-pool and add your include there.

    Best of luck!

    Michelle

    Add comment
    10|10000 characters needed characters exceeded

    • So you are using the include because you are using the same definitions. Are you using them all? If the include changes - will your code still work?

      I guess my definitions tend to be within the modules but I don't use includes. I don't use them, because I don't use all the fields over again.

      I would guess you would probably get the warning, but if it works for you then I wouldn't worry about it.

  • Feb 13 at 02:46 PM

    I am using an existing include from a SAP AddOn, where all constants used in the API of the AddOn are defined.

    Add comment
    10|10000 characters needed characters exceeded