When you start an executable program, the standard selection screen normally appears, containing the selection criteria and parameters of both the logical database connected to the program and of the program itself (see Direct Execution - Reports ). When you start an executable program using SUBMIT, there are various additions that you can use to fill the input fields on the selection screen:
SUBMIT... [VIA SELECTION-SCREEN] [USING SELECTION-SET var] [WITH sel criterion] [WITH FREE SELECTIONS freesel] [WITH SELECTION-TABLE rspar].
These additions have the following effects:
The selection screen of the called executable program appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values. By default, the system does not display a selection screen after SUBMIT.
This addition tells the system to start the called program with the variant var.
Use this addition to fill individual elements sel of the selection screen (selection tables and parameters) with the help of the language elements criterion.
For more information on these additions, refer to the keyword documentation.
Except for WITH SELECTION-TABLE, you can use any of the above options several times and in any combination within a SUBMITstatement. In particular, you can use the WITH sel addition several times for one single criterion sel. The only combination possible for the WITH SELECTION-TABLE addition is USING SELECTION-SET.
If the input fields on the selection screen are linked to SPA/GPA parameters, you can also use this technique to pass values to the selection screen (see Passing Data Between Programs ).
The following executable program creates a selection screen containing the parameter paramet and the selection criterion selecto:
REPORT demo_program_submit_rep1.
DATA number TYPE i.PARAMETERS paramet(14) TYPE c.SELECT-OPTIONS selecto FOR number.
The program DEMOdemo_program_submit_rep1 is called by the following program using various parameters:
REPORT demo_program_submit_sel_screen NO STANDARD PAGE HEADING.
DATA: int TYPE i, rspar TYPE TABLE OF rsparams, wa_rspar LIKE LINE OF rspar.
RANGES seltab FOR int.
WRITE: 'Select a Selection!', / '--------------------'.SKIP.
FORMAT HOTSPOT COLOR 5 INVERSE ON.WRITE: 'Selection 1', / 'Selection 2'.
AT LINE-SELECTION. CASE sy-lilli. WHEN 4. seltab-sign = 'I'. seltab-option = 'BT'. seltab-low = 1. seltab-high = 5. APPEND seltab. SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN WITH paramet eq 'Selection 1' WITH selecto IN seltab WITH selecto ne 3 AND RETURN. WHEN 5. wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'. wa_rspar-sign = 'E'. wa_rspar-option = 'BT'. wa_rspar-low = 14. wa_rspar-high = 17. APPEND wa_rspar TO rspar. wa_rspar-selname = 'PARAMET'. wa_rspar-kind = 'P'. wa_rspar-low = 'Selection 2'. APPEND wa_rspar TO rspar. wa_rspar-selname = 'SELECTO'. wa_rspar-kind = 'S'. wa_rspar-sign = 'I'. wa_rspar-option = 'GT'. wa_rspar-low = 10. APPEND wa_rspar TO rspar. SUBMIT demo_program_submit_rep1 VIA SELECTION-SCREEN WITH SELECTION-TABLE rspar AND RETURN. ENDCASE.
After you start the program, a basic list appears and clicking the hotspots displays the selection screen of rep1 filled with different values.
For both calls of demo_program_submit_rep1, the system transfers values that lead to two-line selection tables selecto. The second line appears in the respective dialog box Multiple Selection for Selecto. Without the VIA SELECTION-SCREEN option of the SUBMIT statement, paramet and selecto would be filled accordingly in demo_program_submit_rep1, but they would not be displayed.