Scan ABAP Code

This workflow extracts the custom Programs, Functions and Includes from the specified SAP system, and scans their ABAP code to find source lines that match one or more Regular Expressions. The Regular Expressions set in the workflow are designed to match lines of ABAP source code that may cause runtime errors in SAP 4.7 or later releases.

The results are used to generate a CSV report which has the following columns:

Column Description
PATTERN The Regular Expression pattern that matched against the source code.
LINE The source code line that matched the Regular Expression.
OBJECT The custom Program, Function or Include.
TYPE The type of the object.

Values in the PATTERN column are assigned by matching the following Regular Expressions against the ABAP source code (note that comments in the source code are ignored):

Regular Expression Pattern Notes
\bASSIGN:?\b.*OFFSET ASSIGN & OFFSET The following syntax error has been introduced in 4.7 releases and above: ‘You cannot use ASSIGN f+OFFSET. Always use an explicit length (or ‘*’). An explicit length was not required in earlier ABAP releases.
\bBREAK\s BREAK BREAK statements should be reviewed in released code, as these are primarily used for development and testing.
\bBREAK-POINT\b BREAK-POINT BREAK-POINT statements should be reviewed in released code, as these are primarily used for development and testing.
\bGET RUN TIME\b GET RUN TIME In ABAP releases prior to 4.7, the GET RUNTIME statement accepted a numeric variable as a parameter. The GET RUNTIME statement now requires an integer variable as a parameter, and will abort at runtime if the variable is not an integer data type.
\bNO DATABASE SELECTION\b NO DATABASE SELECTION SELECT-OPTIONS for non-database fields in 4.7 releases and above raise the syntax error ‘The addition ‘NO DATABASE SELECTION’ can only be used with reference to Dictionary fields.
\bCALL DIALOG\b CALL DIALOG For indirect uses, invoking a dialog passing a structure to a parameter defined as unstructured character results in a CONNE_IMPORT_WRONG_OBJECT_TYPE abort. This can be resolved this by moving the contents of the structure to an unstructured character variable and passing that to the dialog in place of the structure.
\bE071K\b.*OBJFUNC E017K & OBJFUNC SAP’s transport maintenance function modules now require a blank value in the OBJFUNC field of the E071K internal table. If a specific value is provided (as was required in earlier ABAP releases), the function completes successfully but does not add objects to the transport.
\bCALL FUNCTION\b.*'BAPI CALL FUNCTION & BAPI This pattern matches BAPI function calls in the ABAP source code. You should check that each BAPI is available in the target SAP release, and that the its parameters have not changed.
\bCALL TRANSACTION\b CALL TRANSACTION This pattern matches transaction calls in the ABAP source code. You should check that each called transaction is available in the target SAP release.
\bBDC\b BDC This pattern matches BDC calls in the ABAP source code. These should be checked in the target SAP release to identify any screen flow changes.

CALL statements are included because in later releases of SAP the passed parameters and the formal parameters must be defined to be the same. If you pass a parameter that is not defined in the function, an ABEND will occur at runtime.

Creating RFC Destinations

Before you begin, you will need to create an RFC Destination for the SAP system you wish to analyze.

Preparing the Workflow

To prepare the Scan ABAP Code workflow, drag its workflow template from the Templates folder into your own workspace, then modify the workflow as follows:

To specify the system to analyze:

  1. Select the SAP System parameter and choose ‘Edit RFC Destination’ from its context menu to display the RFC Destination dialog.

  2. Select the RFC Destination for the system to analyze, then click ‘Save’.

To provide your own set of custom objects:

  1. Select the Object List parameter and choose ‘Edit Table’ from its context menu to display the Table Editor dialog.

  2. Enter objects using the Table Editor, or paste in a selection of objects copied from an Excel spreadsheet, then click ‘Save’.

  3. Select the Start Loop Collect action and view its details in the Property Editor.

  4. Link the action’s ‘Source’ property to the Filtered Custom Objects 2 dataset.

To modify the Regular Expressions:

  1. Select the Regular expressions parameter and choose ‘Edit Table’ from its context menu to display the Table Editor dialog.

  2. Modify the Regular Expressions as required, then click ‘Save’.

Save the workflow using the 'Save' toolbar button.

Running the Workflow

To run the Scan ABAP Code workflow, click the 'Run' toolbar button, choose ‘Run Now’ from the diagram’s context menu, or press F5. The currently running workflow action is marked with an animated display. When the workflow execution has completed, select the Report URL dataset and choose ‘View Details’ from the context menu to access the generated report.