Creating your own Code Inspector checks
In this recipe, we will see how we can create our own company specific checks and categories and display them with the standard check categories. For simplicity's sake, we will create a check by the name My Check
under a new category My Check category. When this check will run, it will search for the token T512T
in the program and will display the number of occurrences and the corresponding line numbers.
How to do it...
Follow these steps:
Call the SAP transaction
SE24
. Enter the class nameCL_CI_CATEGORY_TEMPLATE
in the class field and click the Copy button. The screenshot appears as follows:Open the new class in the Change mode and the
CONSTRUCTOR
method in the Edit mode. Add the code given in the following screenshot:Next, we will create a copy of the
CL_CI_TEST_SCAN_TEMPLATE
class having the nameZST9_CL_CI_CHECK
. In theCONSTRUCTOR
method, add the code given in the following screenshot:Add the code in the
run
method of theCheck
class, which is given...