Skip to Content
author's profile photo
Former Member

Problem while using the SUBMIT statement to execute a report

Hi all,

I tried to call an external program from my program and i wanted to pass certain information to it.

The program i'm trying to call is "rdsmopreducedata" and i need to check "System in all solution" and enter "OTO" then execute it.

The method i used was to define a table of rsparams, append my parameters then submit the program after passing that table to it .

exp

DATA :rspar TYPE TABLE OF rsparams,
wa_rspar LIKE LINE OF rspar.

wa_rspar-selname = 'ANZ_COMM'.

wa_rspar-low = '1'.
wa_rspar-KIND = 'S'.
wa_rspar-SIGN = 'I'.
wa_rspar-OPTION = 'EQ'.

SUBMIT rdsmopreducedata
WITH SELECTION-TABLE rspar

The first problme i have is that for certain cells, the information i passed is missing (OTO for example).

The other problem is that the program displays the "rdsmopreducedata" 's screen although i didn't mention it.

?

?Any help?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Posted on Apr 11, 2013 at 08:04 AM
    -1

    Try to use in below way :

    ***************************************************

    SUBMIT PPIO_ENTRY USING SELECTION-SET 'PROD_ORD'
    EXPORTING LIST TO MEMORY
    AND RETURN.

    **********************************************************

    Code used to execute a report SUBMIT Zreport. 
    *Code used to populate 'select-options' & execute report DATA: seltab type table of rsparams, seltab_wa like line of seltab.  seltab_wa-selname = 'PNPPERNR'. seltab_wa-sign    = 'I'. seltab_wa-option  = 'EQ'.  * load each personnel number accessed from the structure into * parameters to be used in the report loop at pnppernr. seltab_wa-low = pnppernr-low. append seltab_wa to seltab. endloop. SUBMIT zreport with selection-table seltab via selection-screen. 
    *Code used to populate 'parameters' & execute report 
     SUBMIT zreport with p_param1 = 'value' with p_param2 = 'value'. 
     *Submit report and return to current program afterwards 
     SUBMIT zreport AND RETURN.  *Submit report via its own selection screen 
     SUBMIT zreport VIA SELECTION-SCREEN.  *Submit report using selection screen variant 
     SUBMIT zreport USING SELECTION-SET 'VARIANT1'.

    **********************************************************

    Filling the Selection Screen of a Called Program

    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:

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

    • VIA SELECTION-SCREEN

    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.

    • USING SELECTION-SET <var>

    This addition tells the system to start the called program with the variant var.

    • WITH sel criterion

    Use this addition to fill individual elements sel of the selection screen (selection tables and parameters) with the help of the language elements criterion.

    • WITH FREE SELECTION freesel
      User dialog for dynamic selections. To use this option, the called program must be connected to a logical database that supports dynamic selections.
    • WITH SELECTION-TABLE rspar
      Dynamic transfer of different values. An internal table rspar with the Dictionary structure RSPARAMS is created. This table can be filled dynamically in the calling program with all the required values for the selection screen of the called program.

    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.

    **********************************************************

    Sample ABAP Program for Submitting report with selection table

    REPORT submit_with_selection_table.

    TABLES QMSM.

    * Work area for internal table IQMSM

    DATA: BEGIN OF WQMSM,

    QMNUM LIKE QMSM-QMNUM,

    MNGRP LIKE QMSM-MNGRP,

    MNCOD LIKE QMSM-MNCOD,

    ZZSTAT LIKE QMSM-ZZSTAT,

    END OF WQMSM.

    * WORK Area for internal table iseltab.

    DATA: WSELTAB LIKE RSPARAMS.

    *----------------------------------------------------------------------*

    * Internal tables

    *----------------------------------------------------------------------*

    * selection table to pass to RIQMEL30

    DATA: ISELTAB LIKE TABLE OF WSELTAB.

    * Table of notification numbers selected - will be passed to riqmel30

    DATA: IQMSM LIKE TABLE OF WQMSM.

    *----------------------------------------------------------------------*

    START-OF-SELECTION.

    *----------------------------------------------------------------------*

    REFRESH IQMSM.

    SELECT QMNUM MNGRP MNCOD ZZSTAT

    FROM QMSM INTO CORRESPONDING FIELDS OF TABLE IQMSM

    WHERE MNGRP = 'ACTION'

    AND MNCOD = 'CALL'

    and ( zzqmart = 'ZE' or zzqmart = 'ZI' )

    AND ZZSTAT = ' '.

    * create selection table entries for field QMART

    WSELTAB-SELNAME = 'QMART'.

    WSELTAB-KIND = 'S'.

    WSELTAB-SIGN = 'I'.

    WSELTAB-OPTION = 'EQ'.

    WSELTAB-LOW = 'ZE'.

    APPEND WSELTAB TO ISELTAB.

    WSELTAB-LOW = 'ZI'.

    APPEND WSELTAB TO ISELTAB.

    * Create selection table entries for QMNUM

    CLEAR WSELTAB.

    WSELTAB-SELNAME = 'QMNUM'.

    WSELTAB-KIND = 'S'.

    WSELTAB-SIGN = 'I'.

    WSELTAB-OPTION = 'EQ'.

    LOOP AT IQMSM INTO WQMSM.

    WSELTAB-LOW = WQMSM-QMNUM.

    APPEND WSELTAB TO ISELTAB.

    ENDLOOP

    *

    * SUBMIT program with parameters passed in table ISELTAB

    * Other parameters passed explicitly

    SUBMIT RIQMEL30 WITH SELECTION-TABLE ISELTAB

    WITH MNGRP = 'ACTION'

    WITH MNCOD = 'CALL'

    WITH DATUV = '00000000'

    WITH DATUB = '99991231'

    WITH STAI1 = 'TSRL'.

    **********************************************************

    Thanks

    Tarak

    Add comment
    10|10000 characters needed characters exceeded