When you call an ABAP program, you can modify its lists, send them to a spool file instead of the screen, or store them in ABAP memory.
Modifying the List Structure
You can modify the list structure of a called program by using the following additions in the SUBMIT statement:
SUBMIT... [LINE-SIZE <width>] [LINE-COUNT <length>].
If the called program contains no such options in the REPORT statement, the system formats the lists of the called program according to the options in the SUBMIT statement. If, on the other hand, the REPORT statement in the called program does specify a list structure, the additions in the SUBMIT statement are ignored. For further information about these additions, refer to
Defining Your Own List Structure.
REPORT STARTER NO STANDARD PAGE HEADING.
DATA: NAME(8) VALUE 'SAPMZTS1',
WID TYPE I VALUE 80,
LEN TYPE I VALUE 0.
SET PF-STATUS 'SELECT'.
WRITE: 'Select a report and its list format:',
/ '-------------------------------------'.
SKIP.
WRITE: 'Report ', NAME INPUT ON,
/ 'Line size ', WID INPUT ON,
/ 'Page length', LEN INPUT ON.
AT USER-COMMAND.
CASE SY-UCOMM.
WHEN 'SELE'.
READ LINE: 4 FIELD VALUE NAME,
5 FIELD VALUE WID,
6 FIELD VALUE LEN.
SUBMIT (NAME) LINE-SIZE WID LINE-COUNT LEN AND RETURN.
ENDCASE.
You can use this program to start programs with user-defined list formatting. On the basic list, the user can enter a report name and the desired list width and length by overwriting the default values:
In the AT USER-COMMAND event, the system reads the values and starts the specified executable program using SUBMIT. If the REPORT statement in the called program has no LINE-SIZE or LINE-COUNT specification of its own, its lists are displayed using the values WID and LEN. At the end of the called program, you can change the input values on the basic list and start a new program.
Printing Lists
You can send a list from a called program directly to the spool system instead of displaying it on the screen. To do this, use the TO SAP-SPOOL addition in the SUBMIT statement:
SUBMIT... TO SAP-SPOOL <print-parameters>.
For details of the parameters that you can use here, refer to
Printing Lists.Saving Lists
Instead of displaying a list on the screen, you can store it in ABAP memory using the EXPORTING LIST TO MEMORY addition in the SUBMIT statement:
SUBMIT... AND RETURN
EXPORTING LIST TO MEMORY.
This statement stores the list in ABAP memory, allowing the calling program to access it once the called program has finished. You must use the AND RETURN addition in this case. You cannot use the additions EXPORTING LIST TO MEMORY and TO SAP-SPOOL together.
The function group SLST provides function modules for accessing the saved list, including for example: