Skip to Content

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

Oct 13, 2017 at 08:02 AM


avatar image


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.



10 |10000 characters needed characters left characters exceeded


Hope the above discussion also will provide you more info.


* Please Login or Register to Answer, Follow or Comment.

3 Answers

Mike Pokraka 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.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Ah... I missed the bit that the include is from SAP, so my answer above is only partly relevant.

Things to try might be encapsulating the include functionality in a local class, but I suspect that may not work. Is the stuff in the include not something you could copy or call directly?


Hmm, includes are not obsolete but of course a supported technology for source code modularization. What we don't want is reuse of includes in several programs. And in given include setups as function groups and class pools we want you to use the predefined names.


Thanks, you are right, I didn't word that very well. "Use of includes for code re-use is an obsolete construct" would have been more accurate.

Many many moons ago we used includes as a reusable code repository, which is considered bad practice since the advent of ABAP Objects (or even before that). This is exactly what the OP was doing - although the reason makes sense given he wants to reuse a SAP-delivered piece of functionality.


Terminology quibble. I would say that includes are for program source code organisation. I don't think they contribute to modularisation per se - for that we have methods (or Function Modules, if you must). You don't modularise a program by adding includes...

Matthew Billingham

"Terminology quibble".


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 ...

Michelle Crapo 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!


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Mike and Michele,

thanks for your hints.

I am using an existing include of a SAP AddOn which defines the constants used in the APIs of the AddOn (there I can't edit the include itself). Of cource I could define my own global class, but this defeats the purpose to use the constant definitions of the AddOn and not duplicate them on our side...

Using the include in the "Class-Relevant Local Definitions" gave more trouble including syntax errors, so I am now back to using the include in the methods...




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.

Wolfgang Röckelein 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.

10 |10000 characters needed characters left characters exceeded