SYNTAX-CHECK FOR itab

Note

This statement is for internal use only.

Incompatible changes or further developments may occur at any time without warning or notice.


Basic form

SYNTAX-CHECK FOR itab ...MESSAGE f ...LINE g ...WORD h.

Parts marked with " ..." are interchangeable

Extras:

1. ... PROGRAM f1

2. ... INCLUDE f2

3. ... OFFSET  f3

4. ... TRACE-TABLE itab1

5. ... DIRECTORY ENTRY f4

6. ... REPLACING f5

7. ... FRAME ENTRY f6

8. ... MESSAGE-ID f7

9. ... ID id TABLE itab2

10.... SHORTDUMP-ID f8

11.... FILTER f9

Effect

Syntax check for programs

The program code is taken from the internal table itab. itab must have the table type STANDARD. If a syntax error is detected during the check, the fields f, g and h are filled as follows:

- f contains the error message text - g contains the program line where the error occurred - h contains the incorrect word in the program

Example

f and h are declared as text fields and g as an integer.

DATA: f(240),
      g TYPE I,
      h(72).

The Return Code is set as follows:

SY-SUBRC = 0:
The program contains no syntax errors.
SY-SUBRC = 4:
The program contains syntax errors.
SY-SUBRC = 6:
The program was not completely checked (only when the addition ID 'ERR') is used.
SY-SUBRC = 8:
Other errors have occurred.

Addition 1

... PROGRAM f1

Effect

Specifies a program name

If the addition DIRECTORY ENTRY is missing, the program name is used to determine the program attributes required for the check, e.g.:

- include or program - the logical database

The field f1 is meant to contain the field attributes of SY-REPID.

Addition 2

... INCLUDE f2

Effect

If there is a syntax error, this field contains the name of the include program where the error occurred.

The field f2 is meant to contain the field attributes of SY-REPID.

Addition 3

... OFFSET f3

Effect

If there is a syntax error, this field contains the position of the incorrect word in the incorrect line.

The field f3 should be declared as an integer.

Addition 4

... TRACE-TABLE itab1

Effect

Trace output is stored in this table. To switch trace output on or off during program checks, you use the SYNTAX-TRACE ON and SYNTAX-TRACE OFF statements.

Addition 5

... DIRECTORY ENTRY f4

Effect

The program attributes required for the check are taken from the field f4 which must correspond to the structure of the table TRDIR.

Addition 6

... REPLACING f5

The field f5 is meant to contain the field attributes of SY-REPID.

Effect

The program code placed in the internal table is an include, not the main program. Therefore, it is the main program specified under PROGRAM which is to be checked. If this program contains an include named f5, the contents of the internal table should be taken into account instead.
You should use this addition only with PROGRAM.

Addition 7

... FRAME ENTRY f6

Effect

The main program attributes required for the check (e.g. logical database, program type) are taken from the field f6. f6 should have the structure of the table TRDIR.

Addition 8

... MESSAGE-ID f7

Effect

If a syntax error occurs, the field f7 contains the relevant message key which has a structure similar to the table TRMSG.

Addition 9

... ID id TABLE itab2

Effect

Returns syntax check information. id contains the type of information written to the internal table itab2.
For correction proposals ( ID 'CORR'), the type group SLIN must be included, for other information the type group SYNT. Both these type groups contain the necessary type specifications.
Please do not use this addition. It is intended only for internal use!
id outputs the following information from the program code:

ID 'MSG ' ...
warning messages
ID 'CORR' ...
correction proposals
ID 'ERR'  ...
error messages
ID 'SYMB' ...
technical symbol table dump
ID 'DATA' ...
data objects from the program
ID 'DPAR' ...
data object parameters
ID 'TYPE' ...
type objects from the program
ID 'FOTY' ...
type objects used by subroutines
ID 'FUTY' ...
type objects used by function modules
ID 'TYCH' ...
components of type objects
ID 'CROS' ...
referenced data objects
ID 'STR ' ...
identifiers
ID 'FORM' ...
subroutines
ID 'FPAR' ...
subroutine parameters (FORM)
ID 'PERF' ...
subroutine calls
ID 'APAR' ...
subroutine parametesr (PERFORM)
ID 'FUNC' ...
function modules
ID 'FFPA' ...
function module parameters
ID 'CALL' ...
function module calls
ID 'FAPA' ...
function module parameters (CALL FUNCTION)
ID 'HYPH' ...
data objects with a hyphen in the name
ID 'INCL' ...
includes in the program

Addition 10

... SHORTDUMP-ID f8

Effect

If a short dump occurs, the key of that short dump is returned in the field f8. This key consists of at most 30 characters.

Addition 11

... FILTER f9

Effect

Includes only those ABAP statements in the check specified using the filter specification f9. The specification must have the type SYNT_FILTER from the type group SYNT. Possible values are:

SYNT_FILTER_INTERFACE
Statements included in the interface of a program
SYNT_FILTER_MCALL
Statements required for method calls