Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

How prevent syntax warn 'Include name does not begin with the prefix of the current class pool'?

Active Contributor


So I have this warning by the compiler:

Include name "Z_wwwww_ABAP2XLSX_DEF" does not begin with the prefix (ZCL_wwwww_CREATE_EXCEL) of the current class pool.

I understand why it happens, I agree that 99% of time it's bad to have an include.

This is a question already asked twice in 2017, but the only answer I saw was that "there's no need to have an INCLUDE and consequently no solution if the INCLUDE is kept".

BUT for the remaining 1% there's no answer as far as I can see:

  1. you must use a third-party or SAP solution which provides an INCLUDE for local classes, and they ask you to include the INCLUDE.
  2. you want your distributable software to include the many classes of abap2xlsx as local classes in two includes, one for definition, one for implementation (both being a total of 30.000 lines), because you don't want the client to install abap2xlsx themselves, and you want a specific stable version of abap2xlsx.

I am currently in the second case.

I know how to avoid the include, but I would like to keep it, because I want to have these 2 parts as objects with clear mention of COPYRIGHT (also indicated at the top of each INCLUDE).

So, my question is very simple: do you know how to suppress this warning?

(or any other idea)

Thank you for reading me!


EDIT October 14th: for information, a "class pool" describes the Main Program of a "global class" (often prefixed CL_, ZCL_ or /.../CL_), whose name contains CP after the 30 characters of the global class name and = instead of spaces if needed, e.g. CL_AAAAA======================CP, the first ABAP statement is CLASS-POOL. The ABAP documentation of CLASS-POOL is interesting because it explains where the different sections CCDEF (class-relevant local types), CU (class definition and public section), CO (protected section), CI (private section), CCMAC (macros), CCIMP (local types), CCAU (test classes), CMaaa (method implementations), of a global class are positioned. For information, the CMaaa part is included via the internal ABAP statement INCLUDE METHODS, which in turn includes the CMaaa ABAP source code units (more information here).


0 Kudos

Never hear about CLASS-POOLS! 🙂

I just know that MODULE POOLS are evil.

Active Contributor

Subscribing to the question, we may have a similar issue

Active Contributor
0 Kudos

c12b61ded10b4e18beae75c3b6218d2c In case you have not yet looked at "class pools", I have appended some information to my question, just now.

0 Kudos

In the minisap system NPL, this warning message is returned by ABAP instruction "syntax-check for program" (method CHECK_SOURCE of class CL_SEU_ADT_CHECKABLE_HELPER) :

I didn't find any BADI where customer can influence the result.

Active Contributor
0 Kudos

tmp___24446185 Thanks for checking the origin of the message.

"Can you confirm that SAP doesn't recommend clients to install abap2xlsx ?"

I don't understand your question. Why SAP would be interested by abap2xlsx, and how is it related to my question? abap2xlsx was just one example among others, I could have chosen any other ABAP "free repackageable" code.

Active Contributor

Sorry, I still don't get it (at all). Probably I wasn't clear, but I don't know what wasn't clear. The "client" is for a "SAP client who wants to use some software based on abap2xlsx". The client can do whatever they want, they don't need to ask SAP.