Executing SUBMIT statement in background

Hello Experts,
Is it possibe in executing SUBMIT statement in backgound? If yes can anyone provide example code?
Also in terms of performance tuning how does SUBMIT fares against CALL TRANSACTION? Which is much better in terms of performance.
Appreciate your answers. Thanks!

Hi
There's no difference for the performance:
if a transaction is assigned to a report (so no dialog program, module pool), it's better to use the SUBMIT if it needs to transfer the value on SELECTION-SCREEN. It can't do it by CALL TRANSACTION.
DATA: VA_JOBNAME LIKE TBTCO-JOBNAME,
           VN_JOBCOUNT LIKE TBTCO-JOBCOUNT.
* Open job
  CALL FUNCTION 'JOB_OPEN'
       EXPORTING
            JOBNAME          = VA_JOBNAME
       IMPORTING
            JOBCOUNT         = VN_JOBCOUNT
       EXCEPTIONS
            CANT_CREATE_JOB  = 1
            INVALID_JOB_DATA = 2
            JOBNAME_MISSING  = 3
            OTHERS           = 4.
  CASE SY-SUBRC.
    WHEN 0.
    WHEN OTHERS.
      MESSAGE E208(00) WITH 'Error.
  ENDCASE.
* Call report
  SUBMIT <REPORT>  USER SY-UNAME
                    VIA JOB VA_JOBNAME NUMBER VN_JOBCOUNT
                    WITH ..................................
                    AND RETURN.
* Close job
  CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
            JOBCOUNT             = VN_JOBCOUNT
            JOBNAME              = VA_JOBNAME
            STRTIMMED            = 'X'  " start immediatly
       EXCEPTIONS
            CANT_START_IMMEDIATE = 1
            INVALID_STARTDATE    = 2
            JOBNAME_MISSING      = 3
            JOB_CLOSE_FAILED     = 4
            JOB_NOSTEPS          = 5
            JOB_NOTEX            = 6
            LOCK_FAILED          = 7
            OTHERS               = 8.
Max

Similar Messages

  • CASE not found while executing CASE statement on Submit Form

    Hi to all APEX users and developers.
    I have several APEX applications and they are all working well, but recently I got one strange exception when I try to submit page:
    Session: Fetch session header information
    ...metadata, fetch page info
    ...Validate item page affinity.
    ...Validate hidden_protected items.
    Add error onto error stack
    ...Error data:
    ......message: Error processing request.
    ......additional_info: ORA-06592: CASE not found while executing CASE statement
    ......display_location: ON_ERROR_PAGE
    ......is_internal_error: true
    ......apex_error_code: APEX.UNHANDLED_ERROR
    ......ora_sqlcode: -6592
    ......ora_sqlerrm: ORA-06592: CASE not found while executing CASE statement
    .....error_backtrace: ORA-06512: at "APEX_040100.WWV_FLOW", line 9273
    ......component.type: APEX_APPLICATION_AUTH
    ......component.id: 41350431648668800
    ......component.name: MNRFR
    ...Show Error on Error Page
    ......Performing rollback
    Processes - point: AFTER_ERROR_HEADER
    Processes - point: BEFORE_ERROR_FOOTER
    End Page Processinga
    Page has more than 120 items (most of them are hidden), so my first thought is that page has problem with posting so many items, but APEX error message doesn't hel me at all. Any help would be very appreciated :)
    Almir

    Hi Almir,
    actually it is the 100 page item limit. See (http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/limits.htm)
    I also had a look into the source code and the code at the position where the error gets raised only supports 100 page items.
    Can you have a look into the generated HTML code and look if you have a page items which is mapped to p_t101 or a higher number ?
    I will file a bug to show a better error message.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Regarding SUBMIT statement - to process a program in background

    Hi All,
    I have issue of submitting a program in background and also i need to process the no of records come from program by splitting them by 1000(n).
    First of all i have program whose code is like following:
    <b>REPORT  z_update_material_master.</b>
    TYPES: BEGIN OF t_marc,
              matnr LIKE marc-matnr,   "Material Number
              werks LIKE marc-werks,   "Plant
              beskz LIKE marc-beskz,   "Procurement Type
              sobsl LIKE marc-sobsl,   "Special procurement type
              fhori LIKE marc-fhori,   "Scheduling Margin Key for Floats
              dzeit LIKE marc-dzeit,   "In-house production time
              plifz LIKE marc-plifz,   "Planned delivery time in days
              webaz LIKE marc-webaz,   "Goods rcpt processing time
              pwwrk LIKE t460a-wrk02,  "Production plant in planned order
              erhor LIKE t436a-erhor,  "Opening periodr
              zlt   TYPE p DECIMALS 3, "Total replenishment lead time
              ztlt  TYPE p DECIMALS 3, "Total replenishment lead time
              wzeit TYPE p DECIMALS 3, "Total replenishment lead time
              upd(1) TYPE c,            "UPDATE INDICATER
              ind    TYPE c,
         END OF t_marc.
    DATA: i_marc  TYPE SORTED TABLE OF t_marc INITIAL SIZE 0
                   WITH HEADER LINE
                   WITH NON-UNIQUE KEY matnr werks,
          i_marc_rpt LIKE i_marc OCCURS 0 WITH HEADER LINE.
    DATA: l_plantdata  LIKE bapi_marc,
          l_headdata   LIKE bapimathead,
          l_plantdatax LIKE bapi_marcx,
          l_tabix      LIKE sy-tabix.
    CONSTANTS: c_s TYPE c VALUE 'S',
               c_x TYPE c VALUE 'X'.
    DATA i_temp_bapi_return LIKE bapi_matreturn2
                            OCCURS 0 WITH HEADER LINE.
    DATA BEGIN OF i_temp_zppe0091_01 OCCURS 0.
            INCLUDE STRUCTURE zppe0091_01.
    DATA: END OF i_temp_zppe0091_01.
    DATA: l_tab_nam LIKE rstable-tabname VALUE 'ZPPE0091_01'.
    SELECT * FROM zppe0091_01
             INTO CORRESPONDING FIELDS OF TABLE i_temp_zppe0091_01.
    IF sy-subrc EQ 0.
      LOOP AT i_temp_zppe0091_01 WHERE upd = c_x.
        l_tabix = sy-tabix.
        l_headdata-material     = i_temp_zppe0091_01-matnr.
        l_plantdata-plant       = i_temp_zppe0091_01-werks.
        l_plantdata-replentime  = i_temp_zppe0091_01-wzeit.
        l_plantdatax-replentime = c_x.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata       = l_headdata
            plantdata      = l_plantdata
            plantdatax     = l_plantdatax
          TABLES
            returnmessages = i_temp_bapi_return.
        IF NOT i_temp_bapi_return[] IS INITIAL.
          READ TABLE i_temp_bapi_return WITH KEY type = c_s.
          IF sy-subrc EQ 0.
            i_marc_rpt-matnr = i_temp_zppe0091_01-matnr.
            i_marc_rpt-werks = i_temp_zppe0091_01-werks.
            APPEND i_marc_rpt. CLEAR i_marc_rpt.
          ELSE.
            i_temp_zppe0091_01-upd = space.
            MODIFY i_temp_zppe0091_01 INDEX l_tabix TRANSPORTING upd.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDIF.
    Now i want to call this program from another program that is already exists by using <b>SUBMIT</b>
    statement in background and i need to process this program by dividing records by <b>1000</b> into seperate session.
    how can i do it. Can any body tell me the solution with syntax.
    I might get lot of records from above program so i want to split them into diffrent sessions based on number of records(1000).
    can any body give me the solution.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Try implementing the following code. Use the code accordingly...
      MOVE 100 TO c_recs_b4_split.
      IF num_src_trans > c_recs_b4_split.
        target_break = num_src_trans / p_thread.
      ELSE.
        target_break = num_src_trans + 1.
      ENDIF.
      wa_subbch  = 1.
      last_index = 1.
    No batch split required if total recrods less than 100
      IF num_src_trans < c_recs_b4_split.
        CLEAR  : range_btch.
        REFRESH: range_btch.
        IF wa_subbch = p_thread.
          target_break = num_src_trans.
        ENDIF.
        MOVE 'S_SRCTRN' TO range_wa-selname.
        MOVE 'S'        TO range_wa-kind   .
        MOVE 'I'        TO range_wa-sign   .
        MOVE 'EQ'       TO range_wa-option .
        LOOP AT itab_src_trans INTO st_src_trans.
          MOVE st_src_trans-src_tran_id TO range_wa-low.
          APPEND range_wa TO range_btch.
        ENDLOOP.
    Step 3 Submit the batch.
        v_job_no = v_job_no + 1.
        PERFORM submit_tp_jobs.
      ELSE.
        DO.
    Step 1 Collect data for the target count
          CLEAR  : range_btch.
          REFRESH: range_btch.
         IF wa_subbch = p_thread.
           target_break = num_src_trans.
         ENDIF.
          MOVE 'S_SRCTRN' TO range_wa-selname.
          MOVE 'S'        TO range_wa-kind   .
          MOVE 'I'        TO range_wa-sign   .
          MOVE 'EQ'       TO range_wa-option .
          IF wa_subbch = p_thread.
            target_break = num_src_trans - v_cnt .
          ENDIF.
          LOOP AT itab_src_trans INTO st_src_trans FROM last_index.
            last_index = sy-tabix.
            batch_total = batch_total + 1.
            IF batch_total <= target_break.
              MOVE st_src_trans-src_tran_id TO range_wa-low.
              APPEND range_wa TO range_btch.
            ELSE.
              EXIT.
            ENDIF.
            v_cnt = v_cnt + 1.
          ENDLOOP.
          CLEAR batch_total.
    Step 2 Submit the batch.
          v_job_no = v_job_no + 1.
          PERFORM submit_tp_jobs.
          ADD 1 TO wa_subbch.
          IF wa_subbch > p_thread.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
    FORM submit_tp_jobs .
      DATA : l_jobcount LIKE tbtcjob-jobcount,
             l_jobrelease LIKE btch0000-char1,
             w_job_flag VALUE 'X',
             w_process_mode,
             w_user_print_params  LIKE pri_params.
      l_jobname = p_batch.
      CONCATENATE 'TP_'  l_jobname '_' v_job_no INTO l_jobname.
      CONDENSE l_jobname NO-GAPS.
      w_process_mode = ' '.
      IF NOT range_btch[] IS INITIAL.
        PERFORM create_post_ctrl.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname  = l_jobname
          IMPORTING
            jobcount = l_jobcount.
        SUBMIT zfi_pc_tran_proc
          AND RETURN
               WITH p_batch  = p_batch
               WITH p_jobid  = p_jobid
               WITH p_mode   = w_process_mode
               WITH p_subbch = wa_subbch
               WITH p_jobq   = p_jobid
               WITH p_cntlmt = p_cntlmt
               WITH p_tpiop  = p_iop
               WITH SELECTION-TABLE range_btch
               USER sy-uname
               VIA JOB l_jobname NUMBER l_jobcount
               TO SAP-SPOOL
               SPOOL PARAMETERS w_user_print_params
               WITHOUT SPOOL DYNPRO.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = l_jobcount
            jobname              = l_jobname
            strtimmed            = 'X'
          IMPORTING
            job_was_released     = l_jobrelease
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            invalid_target       = 8
            OTHERS               = 9.
      ENDIF.
    ENDFORM.                    " submit_tp_jobs
    Pl. add the points....

  • Create spool for background jobs which uses submit statement

    Hi Gurus,
                 I have a quick question regarding the backgroud jobs. When we run a program in the background , it should create a spool for us, but, the problem comes when I am running a program in the background, its not creating the spool. This program uses SUBMIT statement. This program collects the data and it will submit to the other program and then retuen. In this case, its not creating a spool. Its very important for us to look at the spool for this program. Does anybody cam across this kind of problem? I need ur inputs.
    Thanks in advance, <REMOVED BY MODERATOR>
    Regards,
    Srinivas.
    Edited by: Alvaro Tejada Galindo on Mar 18, 2008 4:31 PM

    hi check this link ...
    Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately.
    DATA: number TYPE tbtcjob-jobcount,
          name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
          print_parameters TYPE pri_params.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = name
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc = 0.
      SUBMIT submitable TO SAP-SPOOL
                        SPOOL PARAMETERS print_parameters
                        WITHOUT SPOOL DYNPRO
                        VIA JOB name NUMBER number
                        AND RETURN.
      IF sy-subrc = 0.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
            jobcount             = number
            jobname              = name
            strtimmed            = 'X'
          EXCEPTIONS
            cant_start_immediate = 1
            invalid_startdate    = 2
            jobname_missing      = 3
            job_close_failed     = 4
            job_nosteps          = 5
            job_notex            = 6
            lock_failed          = 7
            OTHERS               = 8.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDIF.
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=backgroundsubmit&adv=false&sortby=cm_rnd_rankvalue
    sy-subrc  Meaning
    0            Background task scheduled successfully.
    4            Scheduling cancelled by user on the selection screen.
    8            Error during scheduling, i.e. when accessing JOB_SUBMIT internally.
    12          Error in internal number assignment.
    regards,
    venkat.
    Edited by: venkat  appikonda on Mar 18, 2008 6:32 PM

  • Submit statement without executing AT SELECTION SCREEN event

    hi,
      In my report since the input data is very large iam spliiting the input data batch by batch. Iam executing the report for the first batch input data and retriving the results for it.
       Then to find the result for the enxt batch input data , iam using submit statement to execute the report again. While executing the report now it should directly start from the start-of-selection event only. It should not go for At selection screen or initialization events.
    Can anyone help me how to execute the report for second time from start-of-selection event.
    Regards,
    Phyrose.

    Is code written directly under START-OF-SELECTION or you are calling subroutine in START-OF-SELECTION?
    I would suggest you to call the subroutines written under START-OF-SELECTION.
    PERFORM form IN PROGRAM prog.

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • SUBMIT statement doesnt work

    hi
    I want to execute program RIMODGEN ( CFM1 transaction ) with some values filled in MA_MATNR
    But this program is not able to execute the program with SUBMIT statement and return & close the job, please tell me whats the problem with this....
    Points for all helpful answers
    * Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    * Insert process into job
    * CALL TRANSACTION
    SUBMIT cfm1  with MA_MATNR in MA_MATNR
                      WITH I_MODID  = 'TEST_RAJ'
                      WITH I_LOGSYS = 'D41030'
                      with I_APPL   = 'TEST_RAJ'
                      user sy-uname
                      via job jobname
                      number jobcount
                      and RETURN.
      if sy-subrc > 0.
          message e200(zz) with 'RIMODGEN call failed'. "error processing
      endif.
    * Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
         MESSAGE i200(zz) with 'Done !!'.    "error processing
         stop.
      endif.

    Rob and I were pointing out that you have the transaction name in the SUBMIT statement in your code that you posted above, so if you are not currently using the program name in your program, make sure that you are.  Also, you may want to use the extension  "     to sap-spool without spool dynpro"  of the SUBMIT statement, the ouput will then go to the spool.  Here is an example program where I am creating a background job .
    report zrich_0004 .
    data:   sdate type sy-datum,
            stime type sy-uzeit,
            l_valid,
            ls_params like pri_params,
            l_jobcount like tbtcjob-jobcount,
            l_jobname  like tbtcjob-jobname.
    start-of-selection.
    * Get Print Parameters
      call function 'GET_PRINT_PARAMETERS'
           exporting
                no_dialog      = 'X'
           importing
                valid          = l_valid
                out_parameters = ls_params.
    * Open Job
      l_jobname = 'ZRICH_0005'.
      call function 'JOB_OPEN'
           exporting
                jobname  = l_jobname
           importing
                jobcount = l_jobcount.
    * Submit report to job
      submit zrich_0005
           via job     l_jobname
               number  l_jobcount
           to sap-spool without spool dynpro
               spool parameters ls_params
                  and return.
    * Kick job off 30 seconds from now.
      sdate = sy-datum.
      stime = sy-uzeit + 30.
    * Schedule and close job.
      call function 'JOB_CLOSE'
           exporting
                jobcount  = l_jobcount
                jobname   = l_jobname
                sdlstrtdt = sdate
                sdlstrttm = stime
    *            strtimmed = 'X'
    Regards,
    Rich Heilman         .

  • Need information about SUBMIT statement

    Hi,
        I am submitting program1 in program2 by using SUBMIT keyword.My  requirement  is want to pass selection screen.
      parameters of program2 to program1 without using variant bcz that parameter   
      values are not constant.
    Thanks for ur information in advance..
    hari...

    hI
    <b>SUBMIT - selscreen_parameters</b>
    USING-SELECTION-SET supplies all the selection screen components by means of a Variante variant. If you specify USING-SELECTION-SETS OF PROGRAM , you can use a variant from a different program; if you specify WITH SELECTION-TABLE, values for several selection screen components are transferred as the content of an internal table rspar; WITH sel value supplies individual selection screen components sel with values value. The addition WITH FREE SELECTIONS allows you to transfer dynamic selections to the selection screen for a logical database.
    <b>... USING SELECTION-SET variant</b>
    If you specify this edition, the parameters and selection criteria for the selection screen are supplied with values from a variant. For variant, you must specify a character-like data object that contains the name of a variant for the program accessed when the statement is executed. If the variant does not exist, the system sends an error message. If the variant belongs to a different selection screen, it is ignored.
    You can create and manage variants for every program in which selection screens are defined, either in the ABAP Workbench or during execution of the program by choosing Goto - Variants on a selection screen.
    <b>... USING SELECTION-SETS OF PROGRAM prog</b>
    If you specify this addition, the variants of the program prog are used in the program accessed. For prog, you must specify a character-like data object that contains the name of a program when the statement is executed. The addition has the following effect:
    If a variant variant is specified with USING SELECTION-SET, the system searches for this variant in the program prog.
    If the selection screen is displayed with VIA SELECTION-SCREEN, all the functions that can be accessed by means of the menu path Goto - Variants affect the variants of the program prog. However, these functions are only active if prog is an executable program.
    The program prog should contain a selection screen that has the same parameters and selection criteria as the selection screen used in the program accessed.
    <b>... WITH SELECTION-TABLE rspar</b>
    If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
    SELNAME (length 8),
    KIND (length 1),
    SIGN (length 1),
    OPTION (length 2),
    LOW (length 45),
    HIGH (length 45).
    To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
    SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
    KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
    SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
    If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
    The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
    In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
    <b>... WITH sel1 value1 WITH sel2 value2 ...</b>
    This addition supplies values to individual parameters or selection criteria sel for the selection screen. For sel, you must specify the name of a parameter or selection criterion directly. Parameters are supplied with single values and selection criteria with selection tables that overwrite values already specified in the program accessed. The selection table to be transferred is compiled from all the WITH sel additions that address the same selection criterion sel. You can specify the following statements for value:
    {EQ|NE|CP|NP|GT|GE|LT|LE} dobj [SIGN sign]
    Transfer of a single value.
    The operators before dobj correspond to the values specified for column OPTION for selection tables. For dobj, you must specify a data object whose data type can be converted to the data type of the selection screen component sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.
    If sel is a selection criterion, the system appends a line in the selection table to be transferred, placing the operator in column OPTION, the content of dobj in column LOW, and the content of sign in column SIGN.
    If sel is a parameter, it is set to the value of dobj in the program accessed. The operator and the value of sign are not taken into account.
    [NOT] BETWEEN dobj1 AND dobj2 [SIGN sign]
    Transfer of an interval.
    In this case, sel must be a selection criterion. For dobj, you must specify data objects whose data type can be converted to that of the columns LOW and HIGH for the selection criterion sel. For sign, you can specify a character-like field that must contain 'I' or 'E'. The standard value is 'I'.
    A line is appended in the selection table to be transferred. If NOT is specified, the value 'NB' is placed in column OPTION; otherwise, the value entered is 'BT'. The content of the data objects dobj and sign is placed in the columns LOW, HIGH, and SIGN.
    IN rtab
    Transfer of a ranges table.
    In this case, sel must be a selection criterion. For rtab, you must specify an internal table that has the same structure as the selection table for selection criterion sel. You can create a table like this using the addition RANGE OF to the statements TYPES and DATA.
    The lines in table rtab are appended to the selection table to be transferred.
    You can also use = or INCL instead of the operator EQ.
    You can specify the addition WITH sel value more than once, and you can also specify the same selection screen component more than once.
    <b>Example</b> The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.
    <b>Program accessed</b>
    REPORT report1.
    DATA text(10) TYPE c.
    SELECTION-SCREEN BEGIN OF SCREEN 1100.
      SELECT-OPTIONS: selcrit1 FOR text,
                      selcrit2 FOR text.
    SELECTION-SCREEN END OF SCREEN 1100.
    <b>Calling program</b>
    REPORT report2.
    DATA: text(10)   TYPE c,
          rspar_tab  TYPE TABLE OF rsparams,
          rspar_line LIKE LINE OF rspar_tab,
          range_tab  LIKE RANGE OF text,
          range_line LIKE LINE OF range_tab.
    rspar_line-selname = 'SELCRIT1'.
    rspar_line-kind    = 'S'.
    rspar_line-sign    = 'I'.
    rspar_line-option  = 'EQ'.
    rspar_line-low     = 'ABAP'.
    APPEND rspar_line TO rspar_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'H'.
    APPEND range_line TO range_tab.
    range_line-sign   = 'E'.
    range_line-option = 'EQ'.
    range_line-low    = 'K'.
    APPEND range_line TO range_tab.
    SUBMIT report1 USING SELECTION-SCREEN '1100'
                   WITH SELECTION-TABLE rspar_tab
                   WITH selcrit2 BETWEEN 'H' AND 'K'
                   WITH selcrit2 IN range_tab
                   AND RETURN.
    <b>Result</b>
    After report1 has been accessed by report2, the selection tables for the selection criteria selcrit1 and selcrit2 in the program accessed contain the following entries:
      SIGN OPTION LOW HIGH
    selcrit1 I EQ ABAP 
    selcrit2 I BT H K
    selcrit2 E EQ H 
    selcrit2 E EQ K 
    <b>... WITH FREE SELECTIONS texpr</b>
    This addition supplies values to the dynamic selections for the selection screen for a logical database. The program accessed must be linked to a logical database that supports dynamic selections. texpr must be an internal table of the type RSDS_TEXPR from type group RSDS.
    In texpr, the selections for the dynamic selections are specified in an internal format (stack formula). You can use the function modules FREE_SELECTIONS_INIT, FREE_SELECTIONS_DIALOG, and FREE_SELECTIONS_RANGE_2_EX from the function group SSEL to fill texpr in the calling program. While the first two function modules execute a user dialog, you can transfer ranges tables to FREE_SELECTIONS_RANGE_2_EX for each node in the dynamic selection in an internal table of the type RSDS_TRANGE. These are then converted to a table of the row type RSDS_TEXPR. If the calling program contains a selection screen with the same dynamic selections, you can transfer its content beforehand to a table of the type RSDS_TRANGE using the function module RS_REFRESH_FROM_DYNAMICAL_SEL.
    The lines in the internal table type RSDS_TRANGE contain a flat component TABLENAME for each node and a table-like component FRANGE_T of the type RSDS_FRANGE_T for the fields in the node. The lines in RSDS_FRANGE_T contain a flat component FIELDNAME for each field and a table-like component SELOPT_T of the row type RSDSSELOPT from the ABAP Dictionary. RSDSSELOPT contains the four components SIGN, OPTION, LOW, and HIGH and can include the ranges table.
    <b>Example</b> Program report1 is linked to the logical database F1S, which supports dynamic selections for the node SPFLI. Program report2 enters conditions in a nested internal table of the type rsds_trange with selection conditions for field CONNID in node SPFLI; this is then converted to a table of the type rsds_texpr, which is transferred at SUBMIT.
    <b>Program accessed</b>
    REPORT report1.
    NODES: spfli, sflight, sbook.
    <b>Calling program</b>
    REPORT report2.
    TYPE-POOLS rsds.
    DATA: trange TYPE rsds_trange,
          trange_line
            LIKE LINE OF trange,
          trange_frange_t_line
            LIKE LINE OF trange_line-frange_t,
          trange_frange_t_selopt_t_line
            LIKE LINE OF trange_frange_t_line-selopt_t,
          texpr TYPE rsds_texpr.
    trange_line-tablename = 'SPFLI'.
    trange_frange_t_line-fieldname = 'CONNID'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'BT'.
    trange_frange_t_selopt_t_line-low    = '0200'.
    trange_frange_t_selopt_t_line-high   = '0800'.
    APPEND trange_frange_t_selopt_t_line
      TO trange_frange_t_line-selopt_t.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'NE'.
    trange_frange_t_selopt_t_line-low    = '0400'.
    APPEND trange_frange_t_selopt_t_line
      TO trange_frange_t_line-selopt_t.
    APPEND trange_frange_t_line TO trange_line-frange_t.
    APPEND trange_line TO trange.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        field_ranges = trange
      IMPORTING
        expressions  = texpr.
    SUBMIT report1 VIA SELECTION-SCREEN
                   WITH FREE SELECTIONS texpr.
    <b>SUBMIT - selscreen_options</b>
    ... [USING SELECTION-SCREEN dynnr]
        [VIA SELECTION-SCREEN]
        [selscreen_parameters] ... .
    1. ... USING SELECTION-SCREEN dynnr
    2. ... VIA SELECTION-SCREEN
    The addition USING SELECTION-SCREEN specifies the selection screen, VIA SELECTION-SCREEN specifies whether it is displayed. The additions selscreen_parameters provide values for the parameters, selection criteria, and the free selection of the called selection screen.
    The values are transferred to the selection screen between the events INITIALIZATION and AT SELECTION-SCREEN OUTPUT The following hierarchy applies for transferring values:
    First, the variant of the addition USING SELECTION-SET is transferred, which sets all parameters and selection criteria to the values of the variant. The values previously set in the called program are overwritten.
    The values are then transferred to the table of the addition WITH SELECTION-TABLE. All parameters and selection criteria specified there are overwritten accordingly.
    Finally, the values of the additions WITH sel value are transferred. All parameters and selection criteria are overwritten accordingly. If the addition WITH sel value is used more than once for the same parameter, this is overwritten with the last specified value. If the addition WITH sel value is used more than once for the same selection criterion, a selection table with the corresponding number of lines is transferred.
    Providing values for free selections is independent of this hierarchy.
    The options for parameter transfer enable a selection screen to be viewed as a parameter interface of an executable program. This applies particularly for background selection screen processing and for parameters and selection criteria that are defined without screen elements using the addition NO-DISPLAY.
    The additions selscreen_parameters only work the first time the called program is executed. If a selection screen is displayed in the called program, the runtime environment calls the program again after it is finished, thereby replacing the values specified in selscreen_parameters with the previous input values.
    <b>... USING SELECTION-SCREEN dynnr</b>
    This addition specifies which selection screen is called. dynnr is a data object that must contain the screen number of a selection screen defined in the called program when the SUBMIT statement is called.
    If the addition USING SELECTION-SCREEN is omitted or the screen number 1000 is entered, the standard selection screen is called. If no standard selection screen is defined in the called program, no selection screen is called.
    If a screen number that is not 1000 is entered in the addition USING SELECTION-SCREEN, the corresponding independent selection screen is called. If no selection screen with this screen number is defined in the called program, this leads to an untreatable exception.
    <b>... VIA SELECTION-SCREEN</b>
    If this addition is specified, the selection screen is displayed on the screen. Otherwise, background selection screen processing takes place. In background selection screen processing, the selection screen events are triggered without the selection screen being displayed.
    <b>Reward if usefull</b>

  • Connection CLosed Error due to submit statement.

    Hi friends,
    I have a Method which calls this function
    CALL FUNCTION 'Z_SLOT_TRIGGER_PRODUCTS'
              EXPORTING
                iv_rspar   = lt_rspar
                iv_variant = lv_variant.
    The Function module Z_slot_trigger_prouducts has a form in which there is a submit statement
    Submit the slotting transaction to background & process the transaction immediatly
    SUBMIT z_slot_products
       USING SELECTION-SET gv_variant
        WITH SELECTION-TABLE p_lt_rspar_tmp
         AND RETURN.
    During the debuging i see that when it reaches this submit statement it is giving an error as below in the inbound queue:
    ThISend: bad tm type / connection closed (no data)
    Can anyone please help me with this error. Thanks in advance.

    Check the documentation of the submit statement:
    When the SUBMIT statement is executed, the system runs an authorization check for the authorization group specified in the program attributes.

  • Problem in Submit Program in background

    Hi Expert,
    I have one progam which fetch the sales order data as per input selection and pass it to COOISPI  T.Code.
    Through the program
          SUBMIT PPIO_ENTRY
                  USING SELECTION-SCREEN '1000'
                      WITH P_TCODE = 'COOISPI'
                      WITH P_AUTYP = '40'
                      USING SELECTION-SET 'SAP&COOISPI'
                      WITH SELECTION-TABLE rspar_tab
                     AND RETURN.
    But when i schedule the job of program then it is not running.
    Submit statement is running in background mode or not.
    Is there any other way to doing this work.

    HI ,
      yes it works
    You check the statement SY-BATCH  ..
    Or u can call the transaction and pass the values...
    Please see the sample code :

  • How to send report output from SUBMIT statement

    Hi,
    I need to develop one report whcih can be use to send any report output in mail as attachment in txt of execl format. So i will be using SUBMIT statement to execute the report in my new report and i need to convert the reportout in txt or excel format and need to send as attachment in mail. This new report can be use to execute any report which may have ALV GRid, Normal outout screen. So what could be the best way to develop this kind of report.
    Br,
    Piyush

    >
    piyush mathur wrote:
    > Hi Suhas,
    >
    > LIST_TO_ASCI will give me data in lines. and its difficult to separate the columns in another internal table for attachment file. As this report is going to use to send any report output so i can not fixed the delimiter. So i am looking some function which can split the data in columns when I am reading from List.
    > Br,
    > Piyush
    No need to seperate nothing additionally, this will come automatically in the attached file. Draft below
    DATA list_tab TYPE TABLE OF abaplist.
    SUBMIT your_report EXPORTING LIST TO MEMORY
                  AND RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    DATA string_tab TYPE list_string_table.
    "use table type appropriate for attchement
    DATA ascii_tab TYPE soli_tab.
    CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
       listasci                 = ascii_tab
       listobject               = list_tab.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename = 'C:\test.txt'
        filetype = 'ASC'
      TABLES
        data_tab = ascii_tab.
    DATA go_email_doc TYPE REF TO cl_document_bcs.
    go_email_doc = cl_document_bcs=>create_document(
                                          i_type = 'TXT'
    go_email_doc->add_attachment( i_attachment_type = 'TXT'
                                  i_attachment_subject = 'My Attachment'
                                  i_att_content_text = ascii_tab ).
    Regards
    Marcin

  • Problem in submit statement ?

    hi friends..
    i have one report program (for eg zpgm1) from that i call another program (for eg zpgm2) by using submit statement.
    in zpgm1  i have only one radio button
    in zpgn2 i have one parameter with obligatory.
    the issue is
    while executing from zpgm1 it will call the zpgm2 but it show error message like "parameter is required field" because its an mandatory field.
    i don't want that message while submit ..
    can you plz..
    thanx  in advance

    try this if it works.
    in the zpgm2 , instead of making the parameter as OBLIGATORY , do a validation on that field
    eg
    <b>instead of this</b>
    parameters : p_matnr like mara-matnr <b>obligatory</b>.
    <b>use this</b>
    parameters : p_matnr like mara-matnr.
    at selection-screen.
    if p_matnr is initial.
      message e001(ZE) with 'Matnr is mandatory field'.
    endif.

  • Submit statement in ABAP program

    Hi All,
          I am using two submit statements in my program for two different reports. When i run the program i get the output screens of the two reports at the ouptut. Is there any way i can hide the user seeing the output screens of the two programs and display only the output screen of my program. If you have any clues please post it.
    Thanks & Regards,
    Rahul Rathi

    You can call executable programs from other ABAP programs using the following statement:
    SUBMIT <rep>|(<field>) [AND RETURN] [<options>].
    You can either specify the name of the program you want to call statically by entering the program name in the code of the calling program, or dynamically by specifying the name of a field (in parentheses) containing the name of the program. If the system cannot find the specified executable program when trying to execute the SUBMIT statement, a runtime error occurs.
    If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal session) are deleted. After the called executable program has finished, control returns to the level from which you started the calling program.
    If you use AND RETURN, the system stores the data of the calling executable program and returns to the calling after processing the called program. The system resumes executing the calling program at the statement following the call.
    The SUBMIT statement has a set of additions <options> for passing data to the called program and specifying various other processing options. Some of them are described in the following sections:
    Have a look at below link. It will help you.
    http://www.sapdevelopment.co.uk/reporting/rep_submit.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9dd035c111d1829f0000e829fbfe/content.htm
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Problem with Submit statement

    Hi All,
    I have a problem with the usage of the submit statement.
    I have a report program, say report 'A'.
    In the report program 'A', I have a custom screen with number '9001'.
    In the screen 9001, of program A, there is a button to display ALV.
    In the PAI event, under module Module call_report, i am calling another report program say B, using the statement Submit B and return, when the button is clicked.
    In the report program B i have a select options. and a docking alv container in it.
    Flow of the program is:
    1. Run the program A.
    2. Select the button on screen 9001.
    3. Call the report program B.
    4. Enter a value in the select option and run the program B.
    5. Go back to program A by selecting back button.
    The problem is as at step 4.:
    Now, when i press Intervals button ( Arrow mark ) present beside the select option, my program B is getting executed and the list output is being shown.
    Kindly let me know what is the problem.

    you can very well use the submit procedure as suggested above or you also can do "leave to screen '9001' " for the back button.

  • Problem using Submit statement

    Dear Experts,
    I am trying to use submit statement in a report for transaction ML85. I have used the below code.
    submit RMSRVF00 with FRGCO = 'S1'
                    with FRGGR = 'S1'
                    with listu = 'ENTRY_REL'
                    with ebeln = '4500000309'
                    AND RETURN.
    But when I execute the report the values which I set are not filled and the screens opens with error message as '' Fill in all required entry fields". I am passing values for fields Releasecode - FRGCO, Release group - FRGGR, Purchase Order - EBELN, Scope of list - LISTU.
    Please tell me why this message is coming and values are not set for fields.
    KR,
    Bharath

    hai,
    try like this
    SUBMIT ZVENDOR_REPORT_NEW1 USING SELECTION-SCREEN '100'
                  WITH SELECTION-TABLE TB_OUTPUT
                   WITH P_DATE = SY-DATUM
                   WITH S_ERDAT BETWEEN '01.01.2008' AND '01.06.2008'
                   AND RETURN.
    or you can go in this way using type pools:
    TYPE-POOLS RSDS.
    DATA: TRANGE                        TYPE RSDS_TRANGE,
          TRANGE_LINE                   LIKE LINE OF TRANGE,
          TRANGE_FRANGE_T_LINE          LIKE LINE OF TRANGE_LINE-FRANGE_T,
          TRANGE_FRANGE_T_SELOPT_T_LINE LIKE LINE OF TRANGE_FRANGE_T_LINE-SELOPT_T,
          TEXPR                         TYPE RSDS_TEXPR.
    TRANGE_LINE-TABLENAME = 'TB_OUTPUT'.
    TRANGE_FRANGE_T_LINE-FIELDNAME = 'S_ERDAT'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-SIGN   = 'I'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-OPTION = 'BT'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-LOW    = '01.01.2008'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-HIGH   = '01.06.2008'.
    APPEND TRANGE_FRANGE_T_SELOPT_T_LINE TO TRANGE_FRANGE_T_LINE-SELOPT_T.
    TRANGE_FRANGE_T_SELOPT_T_LINE-SIGN   = 'I'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-OPTION = 'NE'.
    TRANGE_FRANGE_T_SELOPT_T_LINE-LOW    = SY-DATUM.
    APPEND TRANGE_FRANGE_T_SELOPT_T_LINE  TO TRANGE_FRANGE_T_LINE-SELOPT_T.
    APPEND TRANGE_FRANGE_T_LINE TO TRANGE_LINE-FRANGE_T.
    APPEND TRANGE_LINE TO TRANGE.
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
      EXPORTING
        FIELD_RANGES = TRANGE
      IMPORTING
        EXPRESSIONS  = TEXPR.
    SUBMIT ZVENDOR_REPORT_NEW1 VIA SELECTION-SCREEN
                   WITH SELECTION-TABLE TB_OUTPUT
                    WITH FREE SELECTIONS TEXPR AND RETURN.

Maybe you are looking for

  • Mail crashes everytime I try to launch it

    I'm desperate here. I can't open Mail at all. I click it, the window opens, I can see the subjects and mailboxes, and BOOM, it crashes. Launching again, crash. I tried pretty much everything, then I restored the whole system from a 2 day old time mac

  • ITunes not working

    When ever i try to open iTunes, windows immediatly comes up with iTunes has encountered a problem and needs to close with options of debug, send error report, or dont send. What do i do to get iTunes working again?

  • HT1918 hi can anyone tell me how to edit my credit card info

    i am looking to take my credit card info off our account so he can just use the gift cards but it isnt allowing me to do so.........please help!!!!!! very fustrating lol

  • How to get QaaWS query details?

    All, I am wondering if there is a way to "audit" any QaaWS actions. From what I know, the only way to look at any QaaWS queries is thru the QaawS tool that comes as part of the client install. Is there a way to access information on the web queries i

  • Corruption of MIDI Melody Track

    Background: I loaded a MIDI file that I created on a Korg PA1 X Pro keyboard. I added a MIDI melody track. It played fine for several days, but then stopped playing when I start the song, and no MIDI data is generated for this track. If I click on th