Execute a report in background

Hi All,
I have to create a batch job which will run a report. For that batch job i have to show only few Columns in report. This report also used to run for others batch jobs.
Now i want to know how can i modified my report to know which batch job is executing my report while processing in background.
i.e i can modify the report output based on the folloing condition.
If SY-BATCH is initial and BATCHJOBNAME = 'Test'.
desired output.
else.
endif.

Hi piyush,
1. The answer to your question is :
the FM
GET_JOB_RUNTIME_INFO
2. Use this FM inside the code
of your report.
3. It will give you various details like.
EVENTID
EVENTPARM
EXTERNAL_PROGRAM_ACTIVE
JOBCOUNT
JOBNAME
STEPCOUNT
regards,
amit m.

Similar Messages

  • Executing a report in background,without selection scr  with a variant

    Dear All,
    Please let me know whether I can execute a report which doesn't has a selection-screen, in background, <b>using a variant</b> ?
    Alok.

    Hi,
    In order to restrict the user to run it only in background , you can as well check for SY-BATCH condition.
    The other way is try to remove "execute in foreground" option from the menu and this can be done with the function module .
    Do reward points if useful and close the thread if the doubt is cleared
    data: begin of int_exc occurs 0,
    code like sy-ucomm,
    end of int_exc.
    data wf_repid .
    initialization.
    clear int_exc.
    int_exc-code = 'ONLI'.
    append int_exc.
    int_exc-code = 'PRIN'.
    append int_exc.
    move: sy-repid to wf_repid .
    call function 'RS_SET_SELSCREEN_STATUS'
    exporting
    p_status = '%_00'
    p_program = 'wf_repid'
    tables
    p_exclude = int_exc
    Regards,
    Ram
    Pls reward points if helpful....

  • Execute  MCSI report in background : process Output

    Hello Folks,
    I am working on Ecc 6.0 . i executed the report MCSI (RMCY9200) in background .
    I need to process the output of that Job , But could not find any spool for the same job ...
    Then i came to know that the Output of the job has to be seen from the Select Version option with the same Report MCSI(tcode)...
    But now i have no idea, as how to process that output through an abap program...
    Experts, please throw sum light, as how i can process it through an abap program ?
    Thanks & regards
    Sonal...

    Hi Rajani,
    This is because of the printer specification selected while running/scheduling the job.
    Please follow the below steps to get it corrected:
    1) Go to SE38, enter the program name and press F8
    2) Enter the selection parameters and from menu click Program -> Execute in Background
    3) Now you need to select *Properties* button at below
    4) Click on Format in the Next window
    5) Select one which format with maximun WIDTH ot the width which works for you.
    6) Save the Settings and run the job
    Hope this helps!
    Regards
    Shital

  • Execute report painter report in background

    Hi All,
    I have created new library, report group and a new report in report painter, the report is working fine if we execute in foreground, but if we execute in background then the values are blank.
    Please help me how to get the values if we execute the report in background.
    Regards,
    Raj

    Hi,
    I have created a new report for balance sheet which displays for whole year by a break up of periods from 1 to 16,
    because if extracting the data for whole year i am getting ABAP short dump as runtime exceeded.
    Now i want to run the report in background, but when i run the report in background the values are not appearing in the report.
    I am using T.code GRR3.
    Regards,
    Raj

  • Executing the report in the background

    Hi Frnds,
    I want to execute a report in background.After executing the report I want to receive a mail.
    I think this is possible through reporting agent.
    so i need the steps for this how to do...pls do the need ful..waiting for reply..
    Thanks and Regards
    Rajasekar.

    Hi,
    there are two parts of it -
    a. you have some exceptions & you run report in background & are informed if exception occurs, for that kind of scenario look at -
    http://help.sap.com/saphelp_bw33/helpdata/en/d3/a850390aa3b608e10000000a11402f/content.htm
    b. Without exception you can play with WEb template & get informed -- I am not very sure.see this --
    http://help.sap.com/saphelp_bw33/helpdata/en/9e/9f653ade969f4de10000000a114084/content.htm
    If you are on BW350, it can be achieved by Information Broadcasting feature. see this -
    http://help.sap.com/saphelp_nw04/helpdata/en/a5/359840dfa5a160e10000000a1550b0/content.htm
    Hope it helps
    regards
    VC

  • Executing Report in Background

    Dear All,
    I have a report with more than 400 characters in width. If it is executed in foreground the report is properly displayed but if the report is executed in background, the generated spool only displays upto 255 characters.
    Is there a way to execute the report in background and make sure that the spool is generated with required width?
    Regards,
    Anosh

    Hi Sharabh,
    I have tried printing it after unchecking the "spool request max 255 characters width" option. Still the generated report does not show the report upto 400 characters.
    Can you please suggest some other solution or maybe provide a way to define our own printing format?
    Regards,
    Anosh

  • Change in Normal list when i execute Report in Background.

    Hi all ,
    When we execute the Report in background a normal list will be displayed in the spool. In that Normal
    list is it possible to shift the columns that are displayed at the last to be displayed at the beginning.
    Regards ,
    Murthy

    Hi,
    Yes you can do that.
    You can determine the program is runing in background mode by using system variable SY-BATCH = 'X'.
    If SY-BATCH = 'X'.
    Then you can shift the column of internal table.
    Endif.

  • Error while execution report in background

    Hi,
    I am uploading the data from excel file using ALSM_EXCEL_TO_INTERNAL_TABLE function module in one of the report. If I execute the report in background its giving a error message 'Error during import of clipboard contents'.
    Please help me out what should be the problem.
    <REMOVED BY MODERATOR>
    Thanks,
    Vinay.
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 11:20 AM

    When a program is executed in background, the programs runs in the application server and so connection exists with the PC.
    And the FM ALSM_EXCEL_TO_INTERNAL_TABLE reads the file from PC. Since the connection is already lost when the program is run in background, the program will not work and might give a short dump.
    So you might have to upload the file into application server and then use OPEN DATASET, READ DATASET commands to read data from the application server file.
    <REMOVED BY MODERATOR>
    Thanks,
    Balaji
    Edited by: Alvaro Tejada Galindo on Feb 21, 2008 11:21 AM

  • Need to schedule a report in background from an user exit

    Hi Experts,
    I have a requirement to execute a report in background from an <b>user exit</b>. Please advise.
    Thanks in advance,
    Vivenchandar R

    Use the <b>submit</b> statement.
    For example
    SUBMIT zipr_trans_details "VIA SELECTION-SCREEN
                                  WITH so_trdt  IN lr_tr_period
                                  WITH so_empno IN lr_emp
                                  AND RETURN.
    Where <b>zipr_trans_details</b> is the report name.
    Message was edited by:
            Naren Someneni

  • Creating spool for ALV report in background

    Hi,
    Can we create a spool request if we run in background/forgorund? please help me..
    I am very much thankful for your quick responses.

    Yes we can create it. Execute the report in background using SM36 and then u can view the output using SM35 or the spool request number and tcode SP01.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Running report in background getting runtime error.

    Hi,
    I am getting run time error , when I execute the report in background .
    When I debug it I am getting error - when it is executing
    CALL METHOD cl_ppegihdr_cntl=>exppe_read .
    In ST22 I get error on "
    SET HANDLER event_rec_tool_at1->on_function_selected FOR
      mr_toolbar_at1."
    ABAP Runtime error is
    SET_HANDLER_FOR_NULL
    Thanks and regards ,
    Rohit.

    Hi,
    Are you getting this error in foreground? What is the subrc?
    Please can you post a screenshot, or more detail on the runtime error.
    In the meanwhile here is the help docu for this which may help you, http://help.sap.com/abapdocu_70/en/ABAPSET_HANDLER.htm

  • Executing a report program in background from another program

    Hi Experts,
    I developed a report to display material change history based on change date range. Report is taking much time (around 15-20 mins) as I'm hitting CDPOS and CDHDR tables. User wants to execute the report in foreground because he/she can give selection criteria that is required everytime.
    So, my requirment is now to create another program with same selection screen elements which will execute the original program in background. In the new program, we will be just capturing the selection elements and will pass them to original program to run in background and display a message to user without wait for the background job to complete. Original program should send an email to an fixed email id with the report output as attachment (for example excel file).
    Please suggest.
    Thanks in Advance,
    Siva Sankar

    Hi Siva,
    Please see the link
    http://help.sap.com/saphelp_nw04/helpdata/EN/2a/fa01dd493111d182b70000e829fbfe/content.htm
    Regarding a Change Document Function Module ----- VERY VERY Urgent
    When using function modules , I dont think you can directly get data based on material and plant . these function modules usualy works with object class and creation date .
    Once you retrieve the data using the function modules you have to filter out the unncecessary data based on your selection screen conditions .
    Regards,
    Ratheesh BS
    Edited by: Ratheesh Bhaskarapillai Suseeladev on Mar 8, 2012 5:19 AM
    Regarding a Change Document Function Module ----- VERY VERY Urgent

  • How to execute report in Background from Dialog process?

    How, or what is the best way, to lauch an executable program (report) into the background from a dialog program (dynpro)?
    <b>Example:</b>  The SUBMIT...AND RETURN still executes the called program before it returns control to the calling program.  I just want the report to be kicked off and the dialog to continue as normal.  I do not want the report execution time to affect the dialog process.
    Thanks in advance for your time.

    Hi Nablan, I'm also trying to do parallel processing and created a function module that kicks of another report program.
    However, the process doesn't seem to work. The Main program runs from start to finish but the called program in the function module doesn't seem to run. When I used the option STARTING NEW TASK task name the code ran but in the foreground. I don't want to use this option as it runs in the foreground and SAP limits one to six sessions. Is there something I'm missing in the attributes of the function module I created. Currently the attributes are: Processing type Remote enable module and it's set to start immediately. I had used Normal function module initially but this did not work with the STARTING NEW TASK task name option.
    Below are the codes segements I used.
    In my main program I have the following code segement
    CALL FUNCTION 'Z_CA_PROG_CALL'
      IN BACKGROUND TASK
      EXPORTING
        zprogram            = 'ZCA_TEST1'
      EXCEPTIONS
        program_call_failed = 1
        invalid             = 2
        OTHERS              = 3.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    COMMIT WORK.
    In the function module I have the following code.
    FUNCTION z_ca_prog_call.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(ZPROGRAM) LIKE  ZCA_INTERFPROG-ZPROGRAM
    *"  EXCEPTIONS
    *"      PROGRAM_CALL_FAILED
    *"      INVALID
      SUBMIT (zprogram).
      IF sy-subrc <> 0.
        CASE sy-subrc.
          WHEN 1.
            RAISE program_call_failed.
          WHEN OTHERS.
            RAISE invalid.
        ENDCASE.
      ENDIF.
    ENDFUNCTION.

  • Supress Background Print parameters when user executes ALV report by F9

    Hi friends,
         How can we Supress Background Print parameters pop-up, when user executes ALV report by F9
    or by navigation from selection screen -i.e;  Program ->>Execute in Background.
    Please guide me
    Thanks in Advance,
    Ganesh

    Sorry,
    i need to supress the POP-UP which asks for background Print Parameters in the ALV report. when i press F9 in a selection - screen of a Tcode
    as we supress Pop-up for a smartform or script by passing the Print Parameters
    This 'RS_SET_SELSCREEN_STATUS' excludes the commands(say F9 function code) in report
    I think we need to set the Print paramters in the Program
    please guide me
    Thanks,
    Ganesh

  • Restrict 'Executing report in background' from selection screen

    I want user to not to select option for executing report in background from Selection Screen of the program.
    i.e. 'Execute Program in Background' option in 1st menu bar tab should either be disabled OR if user clicks on it then he should get error message on selection screen itself.
    Thanks,
    Falguni

    Hi Falguni,
    Write the code based on function code SJOB in the event AT SELECTION-SCREEN. Write the following code :
    AT SELECTION-SCREEN
    CASE SY-UCOMM.
    WHEN 'SJOB'.
    MESSAGE E000 WITH 'You cannot schedule background job'.
    ENDCASE.
    Thanks & Regards,
    Faheem.

Maybe you are looking for