Show TOC

Modifying Lists in Called ProgramsLocate this document in the navigation structure

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 REPORTstatement, the system formats the lists of the called program according to the options in the SUBMIT statement. If, on the other hand, the REPORTstatement in the called program does specify a list structure, the additions in the SUBMIT statement are ignored. For more information about these additions, see Defining Your Own List Structure .

Tip

REPORT demo_programm_submit_line NO STANDARD PAGEHEADING.

DATA: name TYPE sy-title VALUE 'DEMO_PROGRAM_READ_TABLES_1',              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 ANDRETURN.  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 required list width and length by overwriting the default values:

At 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 of its own specified, 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, see Printing Lists .

Saving Lists

You can save a list from a called program to the ABAP memory instead of displaying it on the screen. To do this, use the EXPORTING LIST TO MEMORY addition in the SUBMIT statement:

SUBMIT... ANDRETURN           EXPORTING LIST TO MEMORY.

This statement saves the list to ABAP memory, allowing the calling program to access it once the called program has finished. You must use the ANDRETURN addition in this case. You cannot use the additionsEXPORTING LIST TO MEMORYand TO SAP-SPOOL together.

The function group SLST provides function modules for accessing the saved list, including for example:

  • LIST_FROM_MEMORY
  • WRITE_LIST
  • DISPLAY_LIST