Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  program editing →  Dynamic Program Editing →  Source Code →  GENERATE SUBROUTINE POOL 

GENERATE SUBROUTINE POOL - error_handling

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


... [MESSAGE mess] 
    [INCLUDE incl]
    [LINE lin]
    [WORD wrd]
    [OFFSET off]
    [MESSAGE-ID mid]
    [SHORTDUMP-ID sid] ... .

Extras

1. ... MESSAGE mess

2. ... INCLUDE incl

3. ... LINE lin

4. ... WORD wrd
5. ... OFFSET off

6. ... MESSAGE-ID mid
7. ... SHORTDUMP-ID sid

Effect

These additions can be used to analyze syntax and generation errors of the statement GENERATE SUBROUTINE POOL. Syntax errors can either arise in the source code specified in itab, or in the Include programs integrated using the statement INCLUDE. Generation errors can occur if the program contains errors in declaration statements that are not recognized in the static syntax check (among other causes).

Addition 1

... MESSAGE mess

Effect

If the subroutine pool contains one or more syntax errors, the text of the error message for the first syntax error is assigned to the variable mess. mess must be a character-type data object.

If a generation error occurs (see the addition SHORTDUMP-ID), mess is also populated with the corresponding error message. If the subroutine pool can be generated, the content of mess remains unchanged.

Addition 2

... INCLUDE incl

Effect

If one or more Include programs are included in the subroutine pool and one of these contains the first syntax error of the subroutine pool, the name of this Include program is assigned to the variable incl. incl must be a character-type data object. If the first syntax error in the source code occurs in itab, incl is assigned the internal name that would have been returned if generation in prog had been successful. This name always begins with "%_".

If a generation error occurs (see the addition SHORTDUMP-ID), incl is also populated with the name of the corresponding Include program. If the subroutine pool can be generated, the content of incl is not changed.

Addition 3

... LINE lin

Effect

If the subroutine pool contains one or more syntax errors, the line number of the first syntax error, with reference to the program in which it occurs (either the source code in itab or an integrated Include program), is assigned to the variable lin. For lin, the data type i is expected.

If a generation error occurs (see the addition SHORTDUMP-ID), lin is also populated with the corresponding line number. If the subroutine pool can be generated, the content of lin is not changed.

Addition 4

... WORD wrd

Effect

If the subroutine pool contains one or more syntax errors, the first token with errors is assigned to the variable wrd. wrd must be a character-type data object.

If a generation error occurs (see the addition SHORTDUMP-ID), wrd is also populated with the corresponding token. If the subroutine pool cannot be generated, the content of wrd is not changed.

Addition 5

... OFFSET off

Effect

If the subroutine pool contains one or more syntax errors, the offset of the first token with errors, with reference to the line in the source code, is assigned to the variable off. For off, the data type i is expected.

If a generation error occurs (see the addition SHORTDUMP-ID), off is also populated with the corresponding offset. If the subroutine pool can be generated, the content of off is not changed.

Addition 6

... MESSAGE-ID mid

Effect

If the subroutine pool contains one or more syntax errors, the key under which the first error message is stored in the database table TRMSG is assigned to the variable mid.

If a generation error occurs (see the addition SHORTDUMP-ID), mid is also populated with the corresponding key. If the subroutine pool can be generated, the content of mid is not changed.

The key of the database table TRMSG consists of the components SPRAS of length 1, KEYWORD of length 20, and MSGNUMBER of length 4. The component MSGNUMBER is used to receive a three-character ID. The fourth character can either contain a blank character or a letter. For error messages with several parts that occupy more than one line in the database table 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 the ABAP Dictionary. This type is made up of the components SPRAS of length 1, KEYWORD of length 20, and MSGNUMBER of length 3. In non-Unicode programs , an appropriate structure or a flat character-type data object can be specified.


Note

The return value in mid only contains the three-character ID of a syntax error message. For example, in order to use SELECT to select all parts of an error message from the table TRMSG, the key component MSGNUMBER must be generically specified in the WHERE condition, e.g. withLIKE when using the wildcard character "%".

Addition 7

... SHORTDUMP-ID sid

Effect

If the subroutine pool does not contains any statically recognizable syntax errors but an exception occurs during the generation, the ID of the runtime error that is assigned to the exception, is assigned to the variable sid. sid must be a character-type data object. If the subroutine pool can be generated, the content of sid is not changed.


Notes

  • : An exception during generation interrupts the generation, but does not lead to the termination of the program. The runtime error is handled internally, but it still causes a database rollback and the short dump is saved.
  • The IDs of runtime errors are contained in the key column ERRID of the database table SNAPT, in which texts are assigned to them.