READ REPORT prog INTO itab.
1. ... STATE state 2. ... MAXIMUM WIDTH INTO w
Reads the program prog from the database into the internal table itab. The line length of table itab should be at least 72 characters.
TYPES: BEGIN OF T_TYPE,
LINE(72),
END OF T_TYPE.
DATA: PROGRAM LIKE SY-REPID VALUE 'PROGNAME',
T
TYPE STANDARD TABLE OF T_TYPE WITH
NON-UNIQUE DEFAULT KEY INITIAL SIZE 500.
READ REPORT PROGRAM INTO T.
IF SY-SUBRC <> 0.
...
ENDIF.
... STATE state
This addition is intended for internal use. SAP reserves the right to make changes, which may be incompatible, at any time.
Programs can be saved in the library in their "active" or "inactive" form. This addition determines
which state of the program 'prog' should be read. state
may have the values
A for active, or I
for inactive. Inactive programs are only visible to the user currently working with them. All other users work with the active version of the program.
In the ABAP Workbench, you can define a list of objects being edited by each user. These programs are saved in their inactive form until they are activated. If you omit the STATE addition, the system automatically reads the inactive form of these programs, and the active form of all other programs.
Since this set of programs is only ever available at short notice within the ABAP Workbench, you can
always be sure that other programs using the READ REPORT
statement without the STATE addtion will always read "active" reports.
... MAXIMUM WIDTH INTO w
After the program has been read successfully from the library, w is filled with the length of the longest line of the source text, in characters.
Non-Catchable Exceptions
INSERT REPORT, DELETE
REPORT, SYNTAX-CHECK,
GENERATE REPORT
Reading and Changing Programs