Searching for ABAP statement patterns and tokens within code

In addition to the quality, performance checks, you may use the Search Function node provided to formulate your own criteria in order to search for tokens and ABAP statement patterns within the program(s) in question. In this recipe, we will see how this may be done.

How to do it...

Follow these steps:

  1. In the variant specification, expand the Search Function node. This checks appear as shown in the following screenshot:
    How to do it...
  2. Click the How to do it... icon to enter values for the Search of ABAP Tokens function.
  3. Then, enter the search string in the Search Strig dialog box that appears.
    How to do it...
  4. Enter one token in the field. For search of multiple tokens within the code, select the How to do it... icon.
    How to do it...
  5. For searching for ABAP statement patterns, click the How to do it... icon for the check.
  6. Then enter the single value in the field provided as shown in the following screenshot:
    How to do it...
  7. Finally run the inspection.

How it works...

The search for token function will search all the programs for the token FROM and T512T and will highlight when found in the results. Suppose the word FROM occurs twice and T512T appears once in the display, then total three messages will be displayed, that is, one for each found token.

For the pattern search, the programs are scanned for all SELECT statements that read data from tables having names beginning from PA00 followed by two characters such as PA0023, PA0008, and so on, followed by CLIENT SPECIFIED. The asterisk (*) after SELECT does not mean the code for fetching all fields of the database table but is a search function operator that means any set of tokens after the token SELECT such as *, PERNR INTO WA_PERNR, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.202.61