SAP GENERATE REPORT ABAP Statements

Get Example source ABAP code based on a different SAP table
  


Standard SAP Help for GENERATE_REPORT

GENERATE REPORT
ABAP Code Snippet
• CL_ABAP_GEN_LIMITS ABAP_CLASS
• GENERATE REPORT ABAP_STATEMENT_INT


ABAP Syntax GENERATE REPORT prog [error_handling].


ABAP Addition
1 ... MESSAGE f1
ABAP Code Snippet
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

What does it do? 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 the 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.

Latest 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.

ABAP_SUBRC_GENERAL ABAP_SUBRC_EQ_0 Program was generated successfully ABAP_SUBRC_NE_0 Program could not be generated ABAP_SUBRC_EQ_4 A syntax error occurred ABAP_SUBRC_EQ_8 A generation error occurred ABAP_SUBRC_EQ_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.
• MESSAGE GENERATE REPORT (internal)

ABAP Addition

What does it do? When a syntax error occurs, the error message is stored in this field.
ABAP Code Snippet

ABAP Addition

What does it do? When a syntax error occurs, the name of the ABAP Code Snippet occurred is stored in this field.
• LINE GENERATE REPORT (internal)

ABAP Addition

What does it do? When a syntax error occurs, the number of the line in which the error occurred is stored in this field.
• WORD GENERATE REPORT (internal)

ABAP Addition

What does it do? When a syntax error occurs, the incorrect word is stored in this field.
• OFFSET GENERATE REPORT (internal)

ABAP Addition

What does it do? When a syntax error occurs, the position of the word with the error in the line with the error is stored in this field.
• TRACE-FILE GENERATE REPORT (internal)

ABAP Addition

What does it do? Trace output is stored in this file. This addition automatically activates trace mode.
• DIRECTORY ENTRY GENERATE REPORT (internal)

ABAP Addition

What does it do? The program attributes required for checking are read from field f7. This field must match the structure of table TRDIR.
• WITHOUT SELECTION-SCREEN GENERATE REPORT (internal)

ABAP Addition

What does it do? The selection screen is not generated.
• MESSAGE-ID GENERATE REPORT (internal)

ABAP Addition

What does it do? If a syntax error occurs, the key of the corresponding error message is returned in field f8. This key has the same layout as the key of table TRMSG.
• SHORTDUMP-ID GENERATE REPORT (internal)

ABAP Addition

What does it do? 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.
• WITH PRECOMPILED HEADERS GENERATE REPORT (internal)

ABAP Addition

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



Latest notes:If you use this addition, you must ensure 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.
• WITH TEST CODE GENERATE REPORT (internal)

ABAP Addition

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

Return to menu