/
Testing Code Ferret

Testing Code Ferret

Overview

  • Code Ferret provides rapid, Google-like searching of custom ABAP source code in any SAP system.
  • Code Ferret treats any term that includes underscore characters as if the underscore characters were spaces. For example, Code Ferret treats ZORGANIC_ROCK_SALT as three words: ZORGANIC, ROCK and SALT.

Steps

  1. If you have not already done so, log into the Rev-Trac Insights Test Drive System.
  2. If the Rev-Trac Insights dashboard (list of Insights apps) is not already displayed, display it by clicking the Rev-Trac Insights logo at the top left of the screen.
  3. Select Code Ferret on the Insights dashboard.
  4. In the systems dropdown, select the system you want to search. For the examples below, this system should always be DEV.
  5. Type your search phrase in the text field.
  6. Click on Go, Ferret. Go!

Result:

Code Ferret displays a list of hits.

Click on any hit to view its full context. The object is displayed.

The following usage scenarios suggest some of the ways Code Ferret can help your developers and code reviewers.

Scenario 1

You want to check if developers have been defining constants in an include (a coding convention you want to encourage), or if they have been placing them within the body of their code (coding behavior you want to discourage). Your code uses constants with names that begin gc_fkart.

To perform your check, enter the search term constants gc_fkart* in Code Ferret.

Result:

Code Ferret displays all code hits that include both:

  • the term constants, and
  • a term beginning gc_fkart

You can see from the results of your search that all the constants whose names begin gc_fkart have been defined in an include, which is the coding behaviour you want to encourage.

Scenario 2

You want to check if developers are using the new syntax for defining internal tables, rather than the old "occurs 0" syntax. You know that the code your developers are working on contains the term salt.

To perform your check, enter the search term salt occurs in Code Ferret.

Result:

Code Ferret displays all code hits that include both:

  • the term salt
  • the term occurs

You can see that both ZORGANIC_ROCK_SALT and ZROCK_SALT contain old style internal table definitions that do not conform to your coding standard.

To learn who is responsible for each of these programs, click on any hit for that program. You can see that CDRAKE is responsible for the active version of ZORGANIC_ROCK_SALT. GOOI is responsible for ZROCK_SALT.

Scenario 3

You want to check if developers are following your coding convention of prefixing all parameters with P_. You know that the code your developers are working on contains the term salt.

To perform your check, enter the search term salt parameter* in Code Ferret.

Result:

Code Ferret displays all code hits that include both:

  • the term salt
  • the term parameter (with any ending)

You can see that in both ZORGANIC_ROCK_SALT and ZROCK_SALT parameters have been defined in a manner that does not conform to your coding standard.

Scenario 4

You want to review all SELECT statements written by your new developer GOOI to check that they do not contain any blunders.

To perform your check, enter the search term author:gooi endselect.

Result:

Code Ferret lists all the code written by user GOOI that includes the term endselect. There is just a single hit.

To review this developer's SELECT statement, click on this hit. (If you are a developer, you will recognise that this SELECT statement does, indeed, contain a blunder.)

Scenario 5

You want to list all salt-related code carried by transports from DEVK900010 to DEVK900019. You know that all salt-related code contains the term salt.

To perform your check, enter the search term transport:DEVK90001* salt.

Result:

Code Ferret lists all hits for the term salt in code carried by transports in the range DEVK900010 to DEVK900019. Code Ferret displays the transport number associated with each hit.

Other things to try:

  • Check for yourself what difference it makes if you select the Ignore comments checkbox before you click on Go, Ferret. Go!
  • Look up the documentation for Code Ferret in Rev-Trac Insights apps. Can you work out how to display all function modules that include the word salt?

Related content