Submit report repeatedly through loop

Hi Experts,
I need to submit report in loop. For that i have used SUBMIT as follows
loop at itab into wa_it.
SUBMIT ('ABC') VIA SELECTION-SCREEN
        WITH s_item = wa_it-item
        AND RETURN.
endloop.
The above statement works fine. But i want next item no (wa_it-item) to be filled automatically as soon called report executes for current item number instead of pressing 'BACK' button.
If anybody worked on this please help me.
Thanks and regards,
Shivanand Kalagi.

> I need to submit report in loop. For that i have used SUBMIT as follows
> loop at itab into wa_it.
> SUBMIT ('ABC') VIA SELECTION-SCREEN
>         WITH s_item = wa_it-item
>         AND RETURN.
> endloop.
>
> The above statement works fine. But i want next item no (wa_it-item) to be filled automatically as soon called report executes for current item number instead of pressing 'BACK' button.
>
Just take out the selection-screen option since you dont want to go through the selection screen.
You can write as follows
loop at itab into wa_it.
submit abc with with s_item = wa_it-item and return. <<< This will call the program without selection screen but passes the
clear: wa_it.                                                                        parameters required to the program .
endloop.
Try this.... Sure it works

Similar Messages

  • Skip Error message in submit report

    Hello Gurus,
    I am using SUBMIT <REPORT> command inside a loop of my calling report. For one record the SUBMIT <report> is throwing an eror message due to which my report is getting stopped by displaying the error message.
    My requirement is to skip the record if there is any error in SUBMIT <report> and process rest of the records.
    Please help me out.

    Hi,
    Vasanth's idea regarding doing a CALL FUNCTION IN BACKGRUOND TASK does work, unless you need to get back some information from the SUBMIT, as export parameters can't be set when using IN BACKGRUOND TASK.
    As i need to get data from the SUBMIT, i'll keep looking for other alternatives, so other ideas are still welcome...
    Regards,
    mr.
    Hi Manuel,
    Try calling report in background task like below:
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = c_name                    "this name can be any name defined in constants(you do not have to create a job name anywhere in system or SM36)
          IMPORTING
            jobcount         = w_number
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
    *" Job opened successfully
        IF sy-subrc EQ c_0.
    *" Call program to process IDoc
          SUBMIT ZSubmit WITH <any value>                                                      " e.g. p_field1 EQ <value>
                          VIA JOB c_name NUMBER w_number
                          AND RETURN.
    [Note: In ZSubmit report you can send the data to calling program through ABAP memory i.e. Use EXPORT parameter to export data
    Ex: constants: c_memory(7) type c value 'MEMORY1'.
    At the end of ZSubmit report, before returning to the calling program write below statement:
    EXPORT i_message TO MEMORY ID c_memory1.]
    *" Successful processing of IDoc
          IF sy-subrc EQ c_0.
    "Here you can import data from ZSubmit report
    import i_message from memory id c_memory1.
    After retrieving the data, free the memory otherwise it will affect the performance of your report:
    Free memory id c_memory1.
    *" Close the job
            CALL FUNCTION 'JOB_CLOSE'
              EXPORTING
                jobcount             = w_number
                jobname              = c_name
                strtimmed            = c_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.
    ENDIF.
    ENDIF.
    Hope this helps!
    Regards,
    Saba

  • Submit report using internal table

    Hi Experts!!,
    REPORT 1
    TYPES:   BEGIN OF ty_out_table,
             partner LIKE /sapsll/pntbp-partner,
             bpvsy   LIKE /sapsll/pntbp-bpvsy,
             country LIKE adrc-country,
            END OF ty_out_table.
    internal table declaration & definition
    DATA:  gt_out_table TYPE STANDARD TABLE OF ty_out_table
                   WITH KEY partner
                            bpvsy.
    I have data in internal table gt_out_table.
    I want to pass data gt_out_table in report 2. using SUBMIT REPORT.
    How to do that ?
    REPORT 2
    select-options: s_partnr  for  /sapsll/pntbp-bpvsy.
    parameters: p_upd,
                      p_value .
    please suggest.
    Thanks
    Anee

    hai,
    ... WITH SELECTION-TABLE rspar
    Effect
    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.
    Notes
    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.
    When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.

  • Suppress spool in Submit Report

    Hi All
    I am doing a Submit Report in background in loop.
    I can check from the background job if the Submit was successful or not. But if it is successful I dont want any output in spool.
    By default it is creating a spool request for every Submit.
    But dont want any spool to be created as the submit will be executed no. of times.
    Kindly let me know if and how we can suppress the spool request. The code I have written is attached below.
    LOOP AT lt_t320a INTO ls_t320a.
               SUBMIT XYZ
                      WITH matnr   IN matnr
                      WITH werks   =  ls_t320a-werks
                      TO SAP-SPOOL SPOOL PARAMETERS print_parameters
                      WITHOUT SPOOL DYNPRO
                      VIA JOB job NUMBER jno
                      AND RETURN .
      ENDLOOP.
    Thanks in advance.
    Regards
    Prafulla

    Hi Narinder,
    I have tried without TO SAP-SPOOL but it doesn't work.
    Submit is automatically creating the spool request when run in background mode.
    Kind Regards
    Prafulla

  • Getting the messages after SUBMIT report

    Hi,
    I have a requirement, wherein I'll SUBMIT a report(Report A) through a background job. I also have a custom table, which will have the job information (JOBNAME, JOBCOUNT).
    Now, I want to have a separate control report(Report B) which will read the custom table for the job information and will output the results of the report A submitted through the job. How can this be achieved?
    Also Is there any way, through which I can get the messages raised by the report A using the job information in report B?
    Thanks in advance.
    Sujit.

    Hi,
    I have a requirement, wherein I'll SUBMIT a report(Report A) through a background job. I also have a custom table, which will have the job information (JOBNAME, JOBCOUNT).
    Now, I want to have a separate control report(Report B) which will read the custom table for the job information and will output the results of the report A submitted through the job. How can this be achieved?
    Also Is there any way, through which I can get the messages raised by the report A using the job information in report B?
    Thanks in advance.
    Sujit.

  • Will SUBMIT report EXPORTING LIST TO MEMORY work, when Run in Background?

    You can use SUBMIT <report> EXPORTING LIST TO MEMORY, and then Call the FM LIST_FROM_MEMORY to get the Data.
    This works fine, when the Program is Run in Foreground. My question is, will it work when I Run the Program in Background? i.e. When I Run the Program in Background, will the SUBMIT Statement, Export the List to Memory? Because only then the FM LIST_FROM_MEMORY will get the Data.
    Any alternate solution to meet the same requirement will be appreciated.

    It works for me... my spool output looked like:
    11.01.2008          JC: Calling program - test list to memory                  1                                                                               
    ZLOCAL_JC_SDN_CALLING_PROGRAM                started at 12:54:29                        
    ZLOCAL_JC_SDN_CALLING_PROGRAM                call complete 12:54:30                     
    ZLOCAL_JC_SDN_CALLING_PROGRAM                started at 12:54:30                                                                               
    11.01.2008           JC: Called program - testing list to memory                                                                               
    ZLOCAL_JC_SDN_CALLED_PROGRAM                 was called at: 12:54:29                    
    for the following code:
    report zlocal_jc_sdn_calling_program.
    parameters:
      p_start(1)            type c.
    start-of-selection.
      perform testcase.
    *&      Form  testcase
    form testcase.
      data:
       lt_list              type table of abaplist.
      write: / sy-repid, 'started at', sy-uzeit.
      submit zlocal_jc_sdn_called_program
        exporting list to memory
        and return.
      write: / sy-repid, 'call complete', sy-uzeit.
      call function 'LIST_FROM_MEMORY'
        tables
          listobject = lt_list.
      write: / sy-repid, 'started at', sy-uzeit.
      call function 'WRITE_LIST'
        tables
          listobject = lt_list.
    endform.                    "testcase
    and
    report zlocal_jc_sdn_called_program.
    start-of-selection.
      write: / sy-repid, 'was called at:', sy-uzeit.

  • I want to fill the rows of the report from the loop

    I want to fill the rows of the report from the loop
    For example, in forms
    cursor bdl is select code,decode(:global.user_lang,1,name,2,latin_name) name
    from GL_ANALYSISHDR
    begin
         go_block('bdls');
         clear_block;
         first_record;
         for rec in bdl loop
         :bdls.code:=rec.code;
         :bdls.name:=rec.name;
         next_record;
         end loop;
         go_block('bdls');
         first_record;
    end;
    I tried to use the REF CURSOR
    But it return the values in one time and does not allow me to conduct and control of

    Why do you need to do it by a curesor loop? Can't you put the query in the datamodel of the report and simply pass the parameter to restrict the query?

  • JOB_OPEN, SUBMIT REPORT VIA JOB, JOB_CLOSE, How to get result?

    Hi Friends,
    I am calling reports using jobs as calling job_open, submit report via job.., and job_close. But I want to the output/result of the report. How can I do this?
    Thanks.

    Hello nkara,
    Welcome to SDN!!!
    Check this thread:
    background grid
    REgards,
    Vasanth

  • Submit report to get output list

    Hi friends,
       I have one requirement to take output list of a transaction in one internal table.
    As the transaction is very much interactive , that perticular internal table gets populated somewhere in the middle of the standard program...later on that table undergoes further processing  to cope up with he interaction...
    using  SUBMIT report ,  we can export it to memory
    and using  FM  'LIST_FROM_MEMORY' we can get it back as following.
    list_tab contains data in two fields RFCSIZE  and RFCRECORD in numbers only...
    Submit   report_name  with SELECTION-TABLE SELTAB
            exporting list to Memory and return.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = list_tab
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
       BUT , Can we get the same output list (i.e before interaction) in one internal table...
    thanks

    Hi,
    You can check whether the list is exported in between before the submit.
    Supposed it is exported before the interaction den you can import it ..Just check the value is fetched and stored in a temporary table.
    Is it a csutom program or standard SAP one..?
    Hope this helps.
    Regards,
    Navin.

  • Submit report with dynamic selections

    Hi All,
    I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
    But the dynamic selections are not getting passed.
    Request you to kindly provide some inputs
    My code is
    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 = 'PA0002'.
    *trange_frange_t_line-tablename = 'PA0002'.
    trange_frange_t_line-fieldname = 'GBJHR'.
    trange_frange_t_selopt_t_line-sign   = 'I'.
    trange_frange_t_selopt_t_line-option = 'EQ'.
    trange_frange_t_selopt_t_line-low    = '1987'.
    trange_frange_t_selopt_t_line-high   = '1987'.
    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 RPCADVQ0
    VIA SELECTION-SCREEN
                    WITH SELECTION-TABLE rspar_tab
                    WITH FREE SELECTIONS it_texpr
                    and returN.
    Kindly provide your inputs
    Regards
    Reshma

    Hi Reshma,
    Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
      data: trange  type rsds_trange,
              g_repid type sy-repid.
    g_repid = 'RPCADVQ0'.
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = g_repid
          mode_write_or_move = 'M'
        importing
          p_trange           = trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
      if sy-subrc eq 0.
    " Do the changes to the trange
    CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
    EXPORTING
    field_ranges = trange
    IMPORTING
    expressions = texpr.
    submit RPCADVQ0
    VIA SELECTION-SCREEN
    WITH SELECTION-TABLE rspar_tab
    WITH FREE SELECTIONS it_texpr
    and returN.
    endif.
    Cheers,
    Kothand

  • Submit report in BAPI

    Hi all,
    Is there is any restriction in using <b>submit report and return</b> statement in BAPI function modules ?
    Thanks ,
    Joby

    hi,
    the below guidelines has to be followed while developing BAPIs.
    1.BAPI must not contain CALL TRANSACTION or SUBMIT REPORT.
    2.BAPI must not invoke a COMMIT WORK.instead use the BAPI.transaction commit to execute the commit after the BAPI has executed.
    3.BAPI structures must not use includes.
    4.There should be no Functional dependencies b/w two BAPIs.
    <b>if helpful reward some points.</b>

  • SUBMIT report probs

    when I submitted the report RM06BA00 in other program using
      SUBMIT (REPORT)
        USING SELECTION-SET VARIANT
        EXPORTING LIST TO MEMORY AND RETURN.
    It's not coming to program from where I called...it's displaying the report
    so when I used FM LIST_FROM_MEMORY for further process like emailing this report...I am not getting any data.
    Could you pls. let me know why this is displaying report instead of coming back to the program from where it's submitted?
    Reply ASAP.
    Regards,
    Sreedevi P

    Hi Sreedevi,
    Refer to the codes in this link.
    Re: Submit Statement
    Regards,
    Arun Sambargi.

  • SUBMIT REPORT statement issue in abap

    Hi Experts,
    I am facing issue while doing SUBMIT REPORT statement.
    Below are the details for the Issue:
    1. We want to execute another report ZTEST2 from one report , so we have written code in report ZTEST1 as below:
                          SUBMIT ZTEST2 AND RETURN.
    2. It goes to ZTEST2 successfully but when we execute ZTEST2 and click on BACK buttton , it directly goes to ZTEST1 selection screen.
    Instead we want to go ZTEST2 program's selection screen. As this back button is standard ALV button is there any way we can handle this without creating new PF-STATUS.
    Regards,
    Sanjana

    That's very limiting.
    It depends, there are some things you can do if you ztest2 does something that is traceable.
    Without any more info I suggest to check time-lapse between submit calls. If it's inferior to 2 seconds I'd suppose user want's to leave.
    mind you the syntax is wrong:
    do.
    g_initial = get time.
    SUBMIT ZTEST2 AND RETURN.
    g_final = get time.
    if g_final - g_initial <= 2.
         exit.
    endif.
    enddo.
    For the user is in most cases transparent, only if he remains a lot of time in selection screen he'll remain there.
    regards,
    Edgar

  • Submit report and export to memory

    Hi
    I am using this code to submit report
    submit ZM005REP
    WITH S_BLEND IN R2
    WITH S_GROUP IN R3
    WITH S_WERKS IN r1
    exporting list to memory and return.
    I am using LIST_FROM_MEMORY to read the list.
    I want to further use the values from this list for calculations , but when I saw the list its just an array of strings.
    I want to read the opening bal field which is returned in this list.
    Any advice on this ?
    Thanks,
    Shital

    Hi,
    DATA  BEGIN OF itab_list OCCURS 0.
            INCLUDE STRUCTURE abaplist.
    DATA  END OF itab_list.
    DATA: BEGIN OF vlist OCCURS 0,
            filler1(01)   TYPE c,
            field1(06)    TYPE c,
            filler(08)    TYPE c,
            field2(10)    TYPE c,
            filler3(01)   TYPE c,
            field3(10)    TYPE c,
            filler4(01)   TYPE c,
            field4(3)     TYPE c,
            filler5(02)   TYPE c,
            field5(15)    TYPE c,
            filler6(02)   TYPE c,
            field6(30)    TYPE c,
            filler7(43)   TYPE c,
            field7(10)    TYPE c,
          END OF vlist.
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = itab_list
      EXCEPTIONS
        not_found  = 4
        OTHERS     = 8.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = vlist
        listobject         = itab_list
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    Then you can use the ITAB_LIST for caliculation which is having all the values.
    Thanks
    Sudheer

  • Submit report using selection table not working in OO CL_SALV classes

    I have used CL_SALV classes in my report. now the problem is submit report is not working. any suggestions.
    It works in REUSE_ALV  FM

    Still i m facing the same problem

Maybe you are looking for