How run a report in background process ?

Hi Experts,
I wrote a code in which I am have multiple selection screens....means in first screen there will 3 radio buttons.
So, depending upon the radio button selected, the other selction screen will be displayed...
So, here i want to run a report in background process...But in menubar im not able to find 'program'.
So, please help me this to run my report in background process.. with any simple code...
Thanks,
Rocky.

Hi,
Try to see this example and adapt it for your case:
constants :   c_jobname  like tbtcjob-jobname  value 'ZRFC_CM_38',
              c_jobclass like tbtcjob-jobclass value 'A',
              c_x        type c                value 'X',
              c_msgclass type arbgb            value 'ZXXXSD',
              c_error    type bapi_mtype       value 'E',
              c_status   type bapi_mtype       value 'S',
              c_msg1     type msgnr            value '177',
              c_msg2     type msgnr            value '178'.
data : v_jobcount like tbtcjob-jobcount.
ranges:
  r_auart    for vbak-auart,
  r_wbstk    for vbuk-wbstk,
  r_mtart    for mara-mtart,
  r_reswk    for ekko-reswk,
  r_vtweg    for vbak-vtweg.
  call function 'JOB_OPEN'
    exporting
      jobname          = c_jobname
    importing
      jobcount         = v_jobcount
    exceptions
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      others           = 4.
  if sy-subrc = 0.
  Assignment of Ranges
    append lines of:
       distribution_channel to r_vtweg,
       order_type_range     to r_auart,
       status_range         to r_wbstk,
       material_type_range  to r_mtart,
       plant_range          to r_reswk.
  Submit program in background
    submit z_beve_salesorder_list
      with p_spart   = division
      with p_file    = file_name
      with p_land1   = country
      with s_vtweg   in r_vtweg
      with s_auart   in r_auart
      with s_wbstk   in r_wbstk
      with s_mtart   in r_mtart
      with s_reswk   in r_reswk
       via job c_jobname
    number v_jobcount
       and return.
  Close the Job
    call function 'JOB_CLOSE'
      exporting
        jobcount             = v_jobcount
        jobname              = c_jobname
        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
        invalid_target       = 8
        others               = 9.
    if sy-subrc = 0.
    Status Message
      return-type  =  c_status.
      message id c_msgclass
         type c_status
       number c_msg1
         into return-message
         with c_jobname
              sy-datum
              sy-uzeit.
    else.
    Error Message
      return-type  =  c_error.
      message id c_msgclass
         type c_error
       number c_msg2
         into return-message
         with c_jobname.
    endif.
  endif.
Regards.

Similar Messages

  • Is it possible to run ALV report in background if Yes how?

    is it possible to run ALV report in background if Yes how?

    Hi,
    Why not?Through se38 only you create ALV report. there you can give your report name and go to program on menu bar - click - execute buton- click-Background . You will get new screen there you can choose Execute immediate or schedule.
    <REMOVED BY MODERATOR>
    Cheers,
    Chandra Sekhar.
    Edited by: Alvaro Tejada Galindo on Mar 4, 2008 2:12 PM

  • How to make a .EXE file run always as a BACKGROUND PROCESS ???

    I have a .EXE file that i want to run always on STARTUP.
    And it should run only in the BACKGROUND PROCESS LIST in TASK MANAGER.
    It should not show up on the TASKBAR or NOTIFICATION TRAY.
    Plz Help !!!! Thnx in advance

    What is the need for such a security?
    If you are an administrator and you want to run the EXE file in background in all other user accounts (which are non-admins), you can simply add the file path under the run key in registry. The registry entry is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    The EXE file is not visible to non-admin users (of course, visible to administrators), even in Task Manager.
    Depending on the application behaviour and the way it works, it may or may not be visible in system tray or task bar.
    Balaji Kundalam
    some where i read to add the path in inverted commas followed by -auto
    Eg : "C:\Users\GAURAV\Documents\****.exe" -auto
    i added it and it ran on startup but it showed on my desktop !!! i dnt want it to show on desktop !

  • CNTL_ERROR while running a report in background mode

    Hi,
    I am running a report in background on daily basis. I am using cl_gui_custom_container class here and calling the constructor of this class. I am getting a CNTL_ERROR exception at this point. But if i run the same report directly, it is not throwing any exception. The problem is if i schedule it to background. I am not able to sort it out. So please if any body knows, answer this.
    Thanks,
    Kumar

    Hi Nithin,
    I was facing the similar issue in a custom report program. I did apply the logic that you'd mentioned.
    I've implemented the code as below.
    IF  gr_container IS INITIAL.
    *** Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    * Run in foreground
          CREATE OBJECT gr_container
            EXPORTING
              container_name = 'WORK_AREA_CONTAINER'.
          CREATE OBJECT lv_grid
            EXPORTING I_PARENT = gr_container.
        ELSE.
    * Run in background
          CREATE OBJECT lv_grid
            EXPORTING
              I_PARENT = gr_dockcontainer.
          ENDIF.
          ENDIF.
    i_parent_control = gr_dockcontainer.
            CREATE OBJECT m_base_splitter
            EXPORTING
              parent            = i_parent_control
              ROWS              = 1
              columns           = 2
            EXCEPTIONS
              cntl_error        = 1
              cntl_system_error = 2
              OTHERS            = 3.
            CALL METHOD m_base_splitter->get_container
            EXPORTING
              row       = 1
              column    = 2
              RECEIVING
              container = m_splitter_right_part
            EXCEPTIONS
              OTHERS    = 1.
    After I've implemented the above code I'm getting the following error in the batch job:
    Category               ABAP Programming Error
    Runtime Errors         OBJECTS_OBJREF_NOT_ASSIGNED
    Except.                CX_SY_REF_IS_INITIAL
    You attempted to use a 'NULL' object reference (points to 'nothing')
    access a component (variable: "M_BASE_SPLITTER").
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    Either the reference was never set or it was set to 'NULL' using the
    CLEAR statement.
    Would you be able to help me in the above issue?

  • Authorization object for running a report in background

    Good day experts,
    I tried running a report in background, I choose immediately so that it doesn't have to be scheduled. But when I checked it in my own jobs, It remains at scheduled status. When I tried it on my admin account, It works and with status finished. It seems to be an authorization problem. What object could I be missing with my user account? I tried S_TCODE SMX and SP02 but still not working.
    Thanks in advance!

    Hi karshbax,
    What you're looking for is authorization object S_BTCH_JOB. You need authorization for field JOBACTION = RELE.
    In future use transaction SU53. It shows last error authorization error, so if this is authorization problem then after try of manual releasing of job you'll find in SU53 precise info what went wrong.
    Best Regards
    Marcin Cholewczuk

  • To run a report in background in selection screen using a new button

    hi friends iam new member to this site
    nice to meet u all
    i want to run a report in background using the selection screen of the same report and i want to keep a button in application tool bar.
    after enter the values in the selection screen by clicking that button it should move to the screen which we get generally by menu option
    program-->execute in background
    and by entering the output device and start condition it should be scheduled in the background.
    with job_open,job_submit and job_close we need variants.
    for this i tried through bp_jobvariant_schedule and
    bp_jobvariant_overview but with this we can run with variants only
    but the user wants to enter the values in selection screen and need a button to run background
    ok friends i think u understood me
    please inform soon ok bye have a nice time

    Hi Jagadish
       There are two ways for you to handle the situation.
    1. Train the users to enter the values in selection screen and manually go for backgroung scheduling.
    2. Use At user command and within that basing on the option selection selected, use FM:JOB_OPEN with sy-repid get the job number, submit the program with the values on the selection screen and lastly executing FM: JOB_CLOSE with the job number from JOB_OPEN and SY-REPID.
    Note that you have to set 'X' for export parameter something like startimmed while calling FM: JOB_CLOSE for immediate execution. Am not on SAP to give you the exact parameter.
      Hope the above info helps you.
    Kind Regards
    Eswar

  • How to run GR55 reports in background for cost center hierarchies

    1.  I have been asked by our users to create batch jobs to run in the background for some GR55 reports, that can then be sent directly to cost center managers via email.
    I have figured out the process to do this as long as the cost center manager only needs to see a single cost center at a time.  However, if they are in charge of multiple cost centers, we also want to send them a summarized report using the hierarchy we have set up.  I can't seem to make this work, as the job only seem to recognize the last cost center in the group and the report is for that cost center.
    Example.  cost centers 100, 200 and 300 belong to hierarchy abc.  If I run the job just for cost center 100 it is fine.  But if I have a variant to run hierarchy abc, or even if I use the range 100 to 300, all I get is a report for cost center 300.
    We cannot use BW because we only have revenue in BW.  I am being asked to make this work from standard R/3 within the GR55 realm of reporting.
    2.  In addition, the report selection criteria includes two separate plan/forecast versions.  They need to update these each month prior to running the reports and sending them out.  I looked at the variables associated with the versions and tried to set them up with default values that I hoped would update automatically so that they don't have to manually change 50 or so variants each month.  But I don't see any dynamic variables that I can use to have the system make that change without going into each variant individually.
    3.  There is another piece to this equation as well.  There is another report they want sent out in batch, but it is several pages wide in SAP and several pages long.  So when you run it in batch and either spool it or get it sent as an email, it is very ugly in the formatting due to all the page splits horizontally and vertically.  If anyone knows how to get the report to stay together like it would if you had excel integration turned on, it would be very helpful.  I have tried running it with that integration turned on, but the jobs are set up with user batch_mgr and not my id, so it isn't working well.  The batch_mgr id is just a system id, not a dialog id.  We also don't want the jobs set up with a regular user id because if people leave, then the jobs all need to be changed.

    Kim,
    I may have options for issues 1 and 2. In case of 3, what I can tell you is I understand the concern, but this is what  typically happens in some standard CO reports that are not ALV compatible, I don't think there is not much  there to do unless you add some custom code for the output.
    In regards to point 1, yes,  I have noticed that this happens in some standard and custom reporting, not sure what is going on. I came up with a work around that  made the trick for my client in a similar scenario; which is editing the cost center groups. For instance, instead  of having the group set as a range from 100 to 300,  the groups are have  listed the cost centers, 100, 200 and 300. Obviously, the disadvantage of  this option is  that it would require a bit of more cost center group maintenance.
    In regards to point 2,  I understand from your note  that your users already have set up selection variants for the report. One option for you is to get the help from a developer to create a custom period variable and tiny program that runs in batch every month that would update that variable accordingly. Once that's done, you may have to update at least once, the selection variant  attributes to change the period to a selection variable, so everytime from that point of time forward that the variable gets updated,  it will be ready with the right value for every selection variant that uses it.
    Hope this helps.
    GG

  • [REPORT][How to run a report in background?]

    Hi there!
    I'm with a problem here. How do I make a report run background always, without the interaction of the user to select this type of execution?
    Thanks in advance.

    Hi
    U can create a new report to run it in background mode:
    - Open the 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.
    - Run the report
        SUBMIT <REPORT>   USER SY-UNAME
                          VIA JOB VA_JOBNAME NUMBER VN_JOBCOUNT
                          WITH ....... =  .......
                          WITH ....... = ........  AND RETURN.
    - Close the 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.
    Or you create a periodic job by SM36
    Max

  • How do run any vi as background process

    Hi,
    Thanks for your replies to my earlier queries. I have completed the VI project for UPS. Now I want to make this VI to run in background process, means we have to give a one installable file to the user, when he/she installed this file, the VI has to run as background process and it has to start whenever PC boots up. And also VI icon for displaying front panel has to go to system tray (where time is displayed). Can you please let me know how to do this.
    Regards
    Shivakumar Singh

    I just did a quick search on the knowledge base and found a couple of examples for you wanted to do. I would suggest doing a quick search on there.
    Knowledge Base Example
    Knowledge Base
    Joe.
    "NOTHING IS EVER EASY"

  • How to run Various Reports in background.

    I want ro run the various MM MIS reports in Background.

    Hi,
    In the Selection Criteria of the report, Press F9 to run the reports in the background.
    Set the Parameters for the Background job (Print Options & Time) and save.
    To view the output of the reports executed in the background, Select from the SAP Easy Access System --> Own Spool Requests
    To view the details of one of these report, simple click in the check box on the left hand side of the report you wish to view, and click on the icon in the type column.
    Hope it helps.
    Regards,
    Bijoy Kumar

  • Running Crystal Reports in background mode

    Ist there any way to run Crystal Reports against R/3 (ECC) in background mode instead of as a dialog user? We're having timeout issues since the dialog timeout is set to 30 minutes. We have several reports that run quite a bit longer than that.
    Update: I just answered my own question. Pages 58-59 of the install and configuration guide shows you how to do this.
    Edited by: Mike Garrett on Jan 22, 2009 4:57 PM
    Edited by: Mike Garrett on Jan 22, 2009 8:41 PM

    Hi,
    SIA should be all you need because it is starting the other processes as well. Keep in mind that if you do that that most likely all you reports will run in batch mode (also those called on demand.)
    Ingo

  • Submit Report (Regarding Background Processing)

    Hi Guru's,
    I want help regarding Background Processing.
    I have developed a program which is running fine in forground but in Background mode no values are comming.
    All values are becomig Zero.
    Plz help.
    *--- Submit Report for 'COGI' (Postprocessing of Error Records from Automatic Goods Movements)
      SUBMIT coruaffw USING SELECTION-SCREEN '1000'
                      WITH  r_cumul = 'X'
                      EXPORTING LIST TO MEMORY
                    AND RETURN.
    *---- Get the List
      CALL FUNCTION 'LIST_FROM_MEMORY'
        TABLES
          listobject = it_list_tab
        EXCEPTIONS
          not_found  = 1
          OTHERS     = 2.
      IF sy-subrc = 0.
    *--- Convert to Ascii
        CALL FUNCTION 'LIST_TO_ASCI'
          TABLES
            listobject         = it_list_tab
            listasci           = it_asci_tab
          EXCEPTIONS
            empty_list         = 1
            list_index_invalid = 2
            OTHERS             = 3.
        IF sy-subrc <> 0.
    *      MESSAGE i000 WITH 'Problem in converting LIST to ASCII'.
        ENDIF.
        DESCRIBE TABLE it_asci_tab LINES w_cogi.
        w_cogi = w_cogi - 5.
      CALL FUNCTION 'LIST_FREE_MEMORY'
        TABLES
          listobject = it_list_tab.

    Hi Arbind,
                  You have used return you need to add the addition with.Try this way hope it works
    SUBMIT zreport EXPORTING LIST TO MEMORY
                    AND RETURN
                    WITH P_1 = P_1
                    WITH P_2 = P_2
                    WITH P_3 = P_3
                    WITH S_4  IN S_4
                    WITH S_5 IN S_5
                    WITH S_6 IN S_6.

  • Running ALV REPORT in background

    Hi Experts ,
    Before writing this query , i went through all the threads related to ALV report in background . But found none of them satisfactory .
    I am running a alv report in background . I am not using OO ALV . I am using " REUSE_ALV_GRID_DISPLAY" .
    This report is schedules through a background job . It is creating a spool .
    But I am getting a error message : *" FRONT END NOT AVIALABLE "*
    What i have found so far :
    I am planning to use sy-batch variable to check whether it is running in background or not , Then I am planning to read  the spool and if the spool is created , i will display the ALV .
    Is this the correct approach or some other way to generate the ALV REPORT .
    Also by this way will the error message *" FRONT END NOT AVIALABLE "* go .
    Please advice .
    Regards,
    Abhishek

    Hello Everyone ,
    Thanks for your replies .
    I have the spool generated . But it is waiting status .
    The issue here is how I am going to say that the spool is in " Completed " status . Because only after when my spool is in completed status , I want to display the status .
    Is there way for this ?
    Regards ,
    Abhishek

  • Running ABAP Report in background

    Hello,
    I am getting timed out error when I execute my report program.
    I believd running the report can do it for now.
    Can you please tell me detils on  how I should proceed on dev, qa and production environment.
    Regards,
    Sameer.

    Hello Sameer,
    You need to schedule the ABAP program in SM36 transaction.
    Following are the steps:
    1. Fill general data like Job Name, Job class and click on step button from application menu
    2. Fill ABAP program details on this screen like ABAP Report Name, Variant Name (If any) and save it.
    3. Go to SM37 transaction (Background Job monitor)
    4. On initial screen newly created job will be filtered by user name or using job name.
    5. it will be listed in job queue with Scheduled status.
    6. Select the Job from listing and click on Release button from application toolbar
    7. depending on your requirement you can release job immediately and it will start running as an when background wp is allocated to this job.
    8. Or else you can schedule it with some frequency using other options like Date/Time, or using other events to trigger it.
    Check if this can help.
    Thanks,
    Augustin.

  • Report Execution - Background Process

    Hi Friends,
    I have developed a report program.
    I have also created a transaction code for executing it.
    Now the user needs to execute this program as a background job.
    I have tried with SM36 and SM37 transactions. Here, you need to set the variants and time for execution.
    But the user has lots of selection criteria and setting the variants for this requirement is highly impossible.
    Kindly let me know whether I can add any additional statements in the program so that the program executes as a background process when initiated th' the selection screen / transaction code.
    Kindly provide your suggestions.
    Thanks in advance.

    Hi Karthik,
    Looks like a wrapper ABAP program is required to meet your requirement. This program can be called in the background and in turn can submit the report program that you have created to achieve the actual functionality.
    In this wrapper program, you need to create a dynamic variant using FMs (search RSVARIANT in SE37). Here you can populate the fields of the selection screen based on any complex criteria as you mentioned using ABAP statements. The dynamic variant is similar to the variants created on the selection screen.
    Once you have the variant (dynamic) ready you can create a background job and submit it within this wrapper program, for which you again have to use the FMs (search createjob*, and go to the function group).
    You have to release the submitted job and you can get the status of the job while it is running using the standard FMs provided for this.
    Finally, you can create a spool list for the wrapper program that can detail the status of the submitted job.
    It is a good idea to delete the dynamic variant once it ahs been used because if required again, it can be created again. If the dynamic variant is created daily or several times a day, it is definitely good to delete it after the use. The right place to do deletion is at the end of the wrapper program after confirming that the job submitted has completed. Or as an alternate strategy, all variants prior to a week can be deleted when the wrapper program runs today (we are using this strategy).
    I have used this successfully.
    Hope this helps.
    Thanks
    Sanjeev

Maybe you are looking for

  • How to populate cusotom fields using BAPI_GOODSMVT_CREATE  for MIGO

    Hi, I was to update custom field using BAPI_GOODSMVT_CREATE for MIGO and store it is MSEG table. Please tell me how to proceed. Moderator message: last warning, if you continue to post the same thread again, I will submit your user ID for deletion. S

  • Out ot memory

    I got this error: Java lang out of memory when i am saving audio in aByteArrayOutputStream,i can only record about 8 minutes. The initial size of memory is: 256m My code is: public void run(){        int frameSizeInBytes = frtoData.getFrameSize();   

  • Heating back panel lumia 520

    Hello ...i want to know about my new 15 days old Lumia 520 ..lumia 520 back full panel is heating when I used it for 6-10 minute...anything I used make it that I feel it is damaged or not? please suggest me what to do or is thus problem is similar to

  • How to disable Open File dialog in Preview

    After I upgraded from Mavericks to Yosemite, Preview app started popping up the Open File dialog box every time I launch it.  It used to just launch and do nothing. Is there a way to prevent Preview in Yosemite to present the Open File dialog box to

  • CFGRID not displaying

    Hi All, I have a simple query which is returning 2 rows and I am trying to display the results in grid using cfgrid. And it throws objected expected error @ CF_RunContent('<object id=\'finalPayment\' classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-4445535400