Copyright 2024 - BV TallVision IT

Ensuring the health of an Abap development - is backed by serious tooling. The code inspector is a tool that is available from the Abap editor and it takes a serious look at your coding. I have done several projects where all coding was to be delivered code-inspector-error-free. And the use of compiler directives was not allowed. 

Pragma's and compiler directives

Compiler directives are bits of comment-like coding like #EC DOM_EQUAL which is an instruction for the code inspector to ignore the error specified. So how serious are code inspector errors ? This is how it should be seen: code inspector errors are somewhere between syntax errors and semantic errors. It is a serious effort to automatically detect problems in coding - which should be noted by the developer. So will code inspector errors lead to actual errors ? No, they won't in many cases. But they could - when unnoticed. It's a small effort for the developer to check the code inspector. Whether it is part of the project requirements - or not.

The code inspector / Extended program check doesn't check

You're trying the code inspector or "Extended program check" - which shows a single error:

Program SAPMZPOS cannot be tested according to system settings
A possible cause for this is that an SAP program is being checked in a customer system
Note, the following rule applies after a change in the source code:
System setting is not taken into account for a week for testing
Cannot be hidden using a pragma or pseudo-comment

What happened here is that the system assumes your source code is "foreign" - that is, it's SRCSYSTEM as specified on table TADIR is not the same as the system you are in. This may not be a correct assumption, but it disables the code inspector and Extended program check anyway.

The solution is quite simple: even though the source can not be checked, a copy of the source code can be checked. In my example a huge module pool SAPMZPOS was copied to SAPMZPOS_TMP leaving all includes in tact. The Extended program check was then done on SAPMZPOS_TMP which was happy to reveal the check results.

Just to clarify: this is what the TADIR table looked like, where my system was called SPD:



After some time - I found a rather easy way to fix this issue: simply change the main program in your (new) system and save. The TADIR value for SRCSYSTEM will be reset to your current system, and the code inspector will work again..