SYNTAX-CHECK FOR itab

SYNTAX-CHECK


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

Additions:

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 tabid TABLE itab2


The program code is taken from the
internal table itab. 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:

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.

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.

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.

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.

Effect

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

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.

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.

Effect

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

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 '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