SAP - Syntax-CHECK ERROR HANDLING ABAP Statements

Get Example source ABAP code based on a different SAP table
  



SYNTAX-CHECK - error_handling

Short Reference

ABAP Code Snippet
[OFFSET off]
[MESSAGE-ID mid] ... .

ABAP Addition
ABAP Code Snippet
2 ... OFFSET off
3 ... MESSAGE-ID mid

What does it do? These additions can be used for analyzing the syntax errors identified using the statement SYNTAX-CHECK.
ABAP Code Snippet

ABAP Addition

ABAP Code Snippet programs are included in the source code contained in itab, and one of these programs contains the first syntax error of the checked program, the name of this include program is assigned to the variable incl. incl must be a character-like data object.
• OFFSET SYNTAX-CHECK FOR itab

ABAP Addition

What does it do? If the source code in itab contains one or more syntax errors, the offset of the first token with errors in relation to the line in the source text is assigned to the variable off. off expects the data type i.
• MESSAGE-ID SYNTAX-CHECK FOR itab

ABAP Addition

What does it do? If the source code in itab contains one or more syntax errors, the key under which the first error message in the database table TRMSG is stored is assigned to the variable mid.

The key of the database table TRMSG is made up of the components SPRAS of length 1, KEYWORD of length 20, and MSGNUMBER of length 4. The component MSGNUMBER is used for a three-character ID. The fourth position can contain a blank character or a letter. For error messages with multiple parts that occupy more than one line in TRMSG, all parts have the same three-character ID, while the fourth character indicates a part of the message.

In Unicode programs, mid must have the data type TRMSG_KEY from ABAP Dictionary, constructed from the components SPRAS with length 1, KEYWORD with length 20, and MSGNUMBER with length 3. In non-Unicode systems, an appropriate structure or a flat character-like data object can be specified.

Return to menu