Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  program editing →  Dynamic Program Editing →  ABAP Source Code →  Internal Statements for Source Code Processing 

GENERATE REPORT

Other versions: 7.31 | 7.40 | 7.54

This statement is for internal use only. It must not be used in application programs.

Syntax


GENERATE REPORT prog [error_handling]. 

Extras

1. ... MESSAGE f1

2. ... INCLUDE f2
3. ... LINE f3

4. ... WORD f4

5. ... OFFSET f5
6. ... TRACE-FILE f6
7. ... DIRECTORY ENTRY f7

8. ... WITHOUT SELECTION-SCREEN

9. ... MESSAGE-ID f8

10.... SHORTDUMP-ID f9

11.... WITH PRECOMPILED HEADERS

12.... WITH TEST CODE

Effect

The program specified in the prog field is generated in the current work process. If the program is an executable program (that is, a type 1 program), the selection screen is also generated automatically.

For the syntax check, the switch configuration of Switch Framework is used in its current status at the time the statement is executed.

Inline declarations can be specified for the same operands, as is the case with the statement GENERATE SUBROUTINE POOL.


Notes

  • If the profile parameter abap/pxa has the value "develop", a database commit is triggered after generation.
  • The static method GET_VALUES of the system class CL_ABAP_GEN_LIMITS gets the generation limits of an ABAP program. In ABAP Workbench, these can be determined by choosing Program → Check → Generation Limits. The generation limits of an ABAP program are technical maximum values which must not be exceeded for a successful generation. The values affected include:

  • Number of variables

  • Size of the jump

  • etc.

SY-SUBRC = 0:
Program was generated successfully
SY-SUBRC <> 0:
Program could not be generated
SY-SUBRC = 4:
A syntax error occurred
SY-SUBRC = 8:
A generation error occurred
SY-SUBRC = 16:
Error while generating the selection screen

If a runtime error occurs during generation (sy-subrc has the value 8 or 16), a database rollback is executed in the usual manner.

Addition 1

... MESSAGE f1

Effect

When a syntax error occurs, the error message is stored in this field.

Addition 2

... INCLUDE f2

Effect

When a syntax error occurs, the name of the include program in which the error occurred is stored in this field.

Addition 3

... LINE f3

Effect

When a syntax error occurs, the number of the line in which the error occurred is stored in this field.

Addition 4

... WORD f4

Effect

When a syntax error occurs, the incorrect word is stored in this field.

Addition 5

... OFFSET f5

Effect

When a syntax error occurs, the position of the incorrect word in the incorrect line is stored in this field.

Addition 6

... TRACE-FILE f6

Effect

Trace output is stored in this file. This addition automatically activates trace mode.

Addition 7

... DIRECTORY ENTRY f7

Effect

The program attributes required for checking are read from field f7. This field must match the structure of table TRDIR.

Addition 8

... WITHOUT SELECTION-SCREEN

Effect

The selection screen is not generated.

Addition 9

... MESSAGE-ID f8

Effect

If a syntax error occurs, the key of the corresponding error message is returned in field f8. This key has the same structure as the key of table TRMSG.

Addition 10

... SHORTDUMP-ID f9

Effect

If a short dump occurs, the key of the corresponding short dump is returned in the f9 field. This key has a maximum length of 30 characters.

Addition 11

... WITH PRECOMPILED HEADERS

This addition allows precompiled headers to be regenerated when generating the ABAP program prog. Precompiled headers are used to increase the translation speed of ABAP Compiler by buffering the declaration data of global classes, interfaces, and type groups in formatted form for ABAP Compiler.


Note

If this addition is used, it must be ensured that the application performs a COMMIT WORK or ROLLBACK WORK within a short period of time. This ensures that the database locks that are set when the precompiled headers are regenerated, are held for a short time only and therefore do not block generation of other ABAP programs.

Addition 12

... WITH TEST CODE

With this addition, the test classes of the program are generated independently of the profile parameter abap/test_generation.