SUBMIT - list_options

Short Reference

Syntax

... [LINE-SIZE width]
    [LINE-COUNT page_lines]
    { [EXPORTING LIST TO MEMORY]
    | [TO SAP-SPOOL spool_options] } ... .

Extras:

1. ... LINE-SIZE width

2. ... LINE-COUNT page_lines

3. ... EXPORTING LIST TO MEMORY

4. ... TO SAP-SPOOL spool_options

Effect:

These additions affect the basic list in the program accessed. While LINE-SIZE and LINE-COUNT influence the formatting, the other two additions determine the output type of the list.

EXPORTING LIST TO MEMORY saves the list to the ABAP Memory and TO SAP-SPOOL sends it as a print list to the SAP spool system. If you do not specify these additions, the basic list is displayed as a screen list.

Note:

The additions only take effect the first time the program accessed is executed. If a selection screen is displayed in the program accessed, the runtime environment accesses the program again after completion, without taking account of the list_options additions. This is particularly important to the addition TO SAP-SPOOL, because the basic list is displayed as a screen list and not as a print list when the program is accessed again. For this reason, it is advisable not to use the addition VIA SELECTION-SCREEN when using list_options.

Addition 1

... LINE-SIZE width

Addition 2

... LINE-COUNT page_lines

Effect

These additions define the line width and page length of the basic list. They have the same effect as the additions of the same name in the program initiating statement for the program accessed. If the program accessed has the same additions in the program initiating statement, these overwrite the values specified for SUBMIT.

Addition 3

... EXPORTING LIST TO MEMORY

Effect

This addition stores the basic list for the program accessed in the ABAP Memory. It can only be used together with the addition AND RETURN.

The list is stored in the ABAP Memory as an internal table of the row type ABAPLIST, ABAPLIST being a structured data type in the ABAP Dictionary.

The calling program can access the list stored once program access is completed, using function modules belonging to the function group SLST.

Note

The addition can only work provided the function key Enter is not linked to a function code in the GUI status last defined for the program accessed.

Example

Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT report EXPORTING LIST TO MEMORY
              AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = list_tab
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.

IF sy-subrc = 0.
  CALL FUNCTION 'WRITE_LIST'
    TABLES
      listobject = list_tab.
ENDIF.

Addition 4

... TO SAP-SPOOL spool_options

Effect

This addition causes a new print list level to be opened in the internal session of the program called and assures that the first output statement for the basic list creates a new spool request. All list outputs of the program called are transferred as print lists, page by page, to the SAP spool system. Using the spool_options additions, the print parameters and archiving parameters of the spool request are specified.

Note

It is not possible to switch from the print list to a screen list in the program called. The statement NEW-PAGE PRINT OFF does not work on print list levels created using SUBMIT TO SAP-SPOOL.

Example

Accessing an executable program and creating a spool request.

DATA: print_parameters TYPE pri_params,
      archi_parameters TYPE arc_params,
      valid_flag(1) TYPE c.

CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
    archive_mode           = '3'
  IMPORTING
    out_parameters         = print_parameters
    out_archive_parameters = archi_parameters
    valid                  = valid_flag
  EXCEPTIONS
    invalid_print_params   = 2
    OTHERS                 = 4.

IF valid_flag = 'X' AND sy-subrc = 0.
  SUBMIT submitable TO SAP-SPOOL
                    SPOOL PARAMETERS print_parameters
                    ARCHIVE PARAMETERS archi_parameters
                    WITHOUT SPOOL DYNPRO.
ENDIF.