Entering content frame

Affecting Lists in Called Programs Locate the document in its SAP Library 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 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.

Example

REPORT demo_programm_submit_line NO STANDARD PAGE HEADING.

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 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:

This graphic is explained in the accompanying text

In the AT USER-COMMANDevent, 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-COUNTspecification 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

You can store a list from a called program in 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... 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 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

 

 

Leaving content frame