SAP INSERT REPORT ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID INSERT-REPORT
• INSERT REPORT ABAP Statement
• FROM INSERT REPORT

INSERT REPORT
Short Reference

ABAP_SYNTAX
INSERT REPORT prog FROM itab
$[MAXIMUM WIDTH INTO wid$]
${ $[KEEPING DIRECTORY ENTRY$]
$| ${ $[PROGRAM TYPE pt$]
$[FIXED-POINT ARITHMETIC fp$]
$[VERSION vs$] $}
$| $[DIRECTORY ENTRY dir$] $}.

ABAP Addition
1 ... MAXIMUM WIDTH INTO wid
2 ... KEEPING DIRECTORY ENTRY
3 ... PROGRAM TYPE pt
4 ... FIXED-POINT ARITHMETIC fp
5 ... VERSION vs
6 ... DIRECTORY ENTRY dir

What does it do?
This statement passes the content of itab to the ABAP program specified in prog in the repository as source code. If a program with the specified name already exists, its source code is overwritten. Otherwise a new program with the name specified in prog and the source code from itab is created in the repository.
The additions for determining the program properties create the program properties in the system table TRDIR.
If none of the additions are specified, the following default values are set when a new program is created:
The original language is set to the system language stored in the profile parameter zcsa/system_language.
The creation date and the date of last change, along with the corresponding times, are set to the current value.
The program properties author and last changed by are set to the current user.
The program status is set to active by default. The program is compiled when it is first executed.
The program type is set to executable program.
The application is set to the value of the current program.
No logical database is linked with the program.
Fixed point arithmetic is activated.
The setting for the ABAP language version is taken from the current program.
If none of the additions are specified, the properties of an existing program are preserved if it is overwritten, with the following exceptions:
The date and time of the last change are set to the current value.
The property last changed by is set to the current user.
The version number is increased by one.
The ABAP language version is set as follows:
If the current program is from the ABAP language version ABAP_STANDARD , the overwritten program is always set to this language version.
The statement INSERT REPORT cannot currently be used in other ABAP language versions.
For itab, only a standard table without secondary table keys is allowed. A source code line in itab must be character-like and can have a maximum of 255 characters. Trailing blanks are ignored for line types with a fixed length. prog must be a character-like flat data object, which can contain no more than 30 characters, and whose content is not case-sensitive.
System Fields sy-subrcMeaning 0The program specified in prog was successfully created or overwritten. 4An error occurred when creating or overwriting the program specified in prog.