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

Similar Messages

  • 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.

  • How to schedule a report in background

    could anybody inform me
    how to schedule a report in background
    if possible plz send the entire step by step process
    thanx
    regards
    kals.

    HI,
    Use transaction SM36
    For step by step process refer this link...
    http://help.sap.com/saphelp_bw30b/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
    Hope this helps!!
    Cheers
    Alfred

  • Scheduling a report in background and passing data for processing

    Hi all,
    Using code (in a report1) ...i  want to execute a report (report2) in background.....but at the same time i want to pass data (an internal table and a variable) to that report2.
    is it possible to pass data like internal table to a executable report and at the same time pass the data to that report.
    Thanks in advance.
    Thanks and Regards,
    Sushil.

    hi
    regarding  Scheduling a report in background check the below thread
    SCHEDULE THE ZREPORT IN BACKGROUND DYNAMICALLY
    regards
    chandra

  • Send email from PA30 user exit

    When I try to send an email from user exit in ZXPADU02 it never makes it to SOST.  WIll always go to SBWP outbox if I set the flag but never gets sent to receiver address.
    If I paste the following code into a report it works fine.  Is there some other parameter for this FM or some additional process needed to send email from a user exit?
        DATA: maildata TYPE sodocchgi1.
        DATA: mailtxt  TYPE TABLE OF solisti1 WITH HEADER LINE.
        DATA: mailrec  TYPE TABLE OF somlrec90 WITH HEADER LINE.
          CLEAR maildata.
          REFRESH: mailtxt, mailrec.
          maildata-obj_name = 'SRVC_EMAIL'.
          maildata-obj_descr = 'Email test'.
          maildata-obj_langu = sy-langu.
          mailtxt-line = 'Test line from user exit'.
          APPEND mailtxt.
          mailrec-receiver = '[email protected]'.
          mailrec-rec_type  = 'U'.
          APPEND mailrec.
          CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
            EXPORTING
              document_data              = maildata
              document_type              = 'RAW'
              put_in_outbox                = 'X'
              commit_work                  = 'X'
            TABLES
              object_header                = mailtxt
              object_content               = mailtxt
              receivers                       = mailrec
            EXCEPTIONS
              too_many_receivers            = 1
              document_not_sent            = 2
              document_type_not_exist    = 3
              operation_no_authorization  = 4
              parameter_error                  = 5
              x_error                              = 6
              enqueue_error                    = 7
              others                           = 8.

    Put the function call 'SO_NEW_DOCUMENT_SEND_API1'
    in a report Program & SUBMIT that report from ZXPADU02.
    Arya

  • Trigger a waiting ABAP program from a User Exit of CO01

    Hi all,
       We would like to launch a ABAP program from a User Exit (EXIT_SAPLCOZV_001) of CO01, this ABAP program has a special characteristic: using Function Module RFC_PING_AND_WAIT, so this program will be existing until terminating event coming.
        Our purpose is terminate CO01 normally before finishing of ABAP program. We don't know if it's possible?
        Actually:
           1. when we use SUBMIT ..., the process will stop CO01 (stop not normally) and then launch ABAP program. => This is not suitable for our purpose.
           2. when we use SUBMIT ... and RETURN, CO01 will wait for finishing of ABAP program => This is not suitable for our purpose too, because we wish CO01 terminated normally when ABAP program is still existing and waiting for its terminating event.
    Do you have a solution that is suitable for our purpose, could you please help us?
    (The context is below:
    Time:  Begin-->CO finished> ABAP finished-->    
       Launch CO01 --> Call User Exit --> Call ABAP program for waiting --> CO01 saved normally.
    > ABAP program still waiting ---> waiting for terminating event       
    Thanks a lot,
    Vinh Vo

    Hi,
         Try with the function module BP_EVENT_RAISE, it takes eventid, and eventparm as import parameters in the User exit.
    1) With Eventid, you create a background job of the ABAP program and schedule it. Eventparm can be the Production order number.
    2) So when ever the Event is triggered the FM gets triggered and which in turn run the ABAP program, so the foreground the CO01 transaction runs without waiting for the ABAP program to complete.
    Regards
    Bala Krishna

  • Starting a GP from a User Exit?

    Hi all,
    How do I start a GP from a user exit?
    The scenario is like this: when a notification is created in SAP (transaction QM01), it should trigger the GP.
    Thank you very much,
    Frederik-Jan

    The actual place to find the information you need to start GP using Web Services (which you can then implement in a User Exit) is here
    http://help.sap.com/saphelp_nw2004s/helpdata/en/44/44c59fd7c72e84e10000000a155369/frameset.htm

  • How does the PRODUCTION SYSTEM take the benifit from the USER EXITS?

    how does the PRODUCTION SYSTEM take the benifit from the USER EXITS?
    please explain

    and it is not the production system that benefits. its the company and the people working with SAP that benefits from the user exits which allow SAP to be altered for the company specific situations.

  • Function module needed to schedule a report to run in background.

    Hi,
    I am in need of a basis fm ro schedule a report to run in the background.
    There exists a function group BTCH with fm MINI_JOB_WIZARD which is what I need.The problem is that all the import parameters is mandatory
    IN_JOBNAME
    IN_REPVARNT
    IN_REPORT
    The problem with the above fm is that it requires a report variant which my report doesnt have since my report has no selection screens.
    Can you please suggest me any alternative fms which does the above wizard like stuff without the annoyance of supplying a variant .
    Thanks

    Try to use the standard FM for submit of jobs :
    - [JOB_OPEN: Create a Background Processing Job|http://help.sap.com/saphelp_nwce711core/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm]
    - [GET_PRINT_PARAMETERS|http://help.sap.com/saphelp_40b/helpdata/pt/9f/dba5d535c111d1829f0000e829fbfe/content.htm] for ... print parameters.
    - [JOB_SUBMIT, ABAP SUBMIT: Add a Job Step to a Job|http://help.sap.com/saphelp_nwce711core/helpdata/en/fa/096ce5543b11d1898e0000e8322d00/frameset.htm] -  Use the FM if you have a variant (or call an external program), else use a ABAP [SUBMIT |http://help.sap.com/abapdocu_70/en/ABAPSUBMIT.htm] [selscreen_parameters|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm] [job_options|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_VIA_JOB.htm] [spool_options|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_PRINT_PARAMETERS.htm], you can pass parameters with the [WITH expr_syntax1 WITH expr_syntax2 ... |http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#&ABAP_ADDITION_4@4@] option.
    - [JOB_CLOSE: Pass a Job to the Background Processing System|http://help.sap.com/saphelp_nwce711core/helpdata/en/fa/096eff543b11d1898e0000e8322d00/frameset.htm]
    Regards,
    Raymond

  • 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.

  • Fail to schedule FullClient report (PDF, Inbox) from Java

    This is occurring in XI Reports 3.1
    I'm trying to schedule a Deski (FullClient) report through the Java API.
    The report has a PDF format and Inbox destination...
    It also has a prompt with a default value.
    When I schedule the report through InfoView it does so succesfully.
    When I try to perform the same action through the Java API... the scheduling does not work.
    Here's a snippet of code I'm using:
    =======================
    loInfoObjects = moInfoStore.query("SELECT * FROM CI_INFOOBJECTS WHERE SI_NAME = '" + lsRptNm + "'");
    loFullClientPubl = (IFullClient)loInfoObjects.get(0);
    loFullClientPubl.properties().setProperty("SI_KIND", CeKind.PDF);
    loFullClientPubl.getProcessingInfo().properties().setProperty("SI_KIND", CeKind.PDF);
    loFullClientPubl.getSchedulingInfo().setRightNow(true);
    if (loFullClientPubl.hasPrompts())
        IFullClientPrompts loPrompts = loFullClientPubl.getPrompts();
        IFullClientPrompt loPrompt = (IFullClientPrompt)loPrompts.get(0);
        loPrompt.getValues().set(0, "123456");
        loFullClientPubl.getPrompts().set(0, loPrompt);
    else //This is the scenario that executes....
        loFullClientPubl.getPrompts().add("Code").getValues().add("123456");
        loFullClientPubl.getProcessingInfo().properties().setProperty("SI_HAS_PROMPTS", true);
    loFullClientPubl.schedule(); //Schedule the report
    =====================================
    After I execute the code, I can see that an entry has been created in CI_INFOOBJECTS but no record of the scheduling shows up in infoView, not even as a "failed" report. It's as if the report had never been scheduled.
    In CI_INFOOBJECTS ...
    Unlike the manual scheduling, the SI_KIND, and SI_HAS_PROMPTS properties for the failed scheduling are not set to "PDF" and "true" as expected, but remain as "FullClient" and "false"
    This is the reason why I set the properties programmatically prior to scheduling the report. While this did change the values in CI_INFOOBJECTS, it still did not fix the problem of scheduling, that is no reports show up in infoView.
    Have any of you guys come across this? I'm stumped...
    Thank you

    I think its your code.
    Look at the code snippet below for scheduling.
    //Retrieve the first object in IInfoObjects collection
    IFullClient fcDoc = (IFullClient)oInfoObjects.get(0);
    IFullClientFormatOptions reportFormat = fcDoc.getFullClientFormatOptions();
    //Set schedule format.
    int formatType = IFullClientFormatOptions.CeFullClientFormat.PDF;
    reportFormat.setFormat(formatType);
    //set prompts
    IFullClientPrompts fcPrompts = fcDoc.getPrompts();
    Iterator iter = fcPrompts.iterator();
    while(iter.hasNext())
          IFullClientPrompt fcPrompt = (IFullClientPrompt) iter.next();
          fcPrompt.getValues().set(0,"new prompt value")
    //Retrieve the ISchedulingInfo Interface for the Report object and set the schedule
    //time (right now) and type (run once)
    ISchedulingInfo schedInfo = fcDoc.getSchedulingInfo();
    schedInfo.setRightNow(true);
    schedInfo.setType(CeScheduleType.ONCE);
    //Schedule the InfoObjects.
    infoStore.schedule(oInfoObjects);
    I haven't testing the setting prompts part but it should work. This will schedule to default location. To schedule to Inbox use the following:
    IDestinationPlugin destinationPlugin = (IDestinationPlugin)infoStore.query("SELECT TOP 1 * "FROM CI_SYSTEMOBJECTS WHERE SI_NAME='CrystalEnterprise.Managed'").get(0);
    //Retrieve the Scheduling Options.
    //This interface is the one which allows us to add the file location for the scheduling.
    IManagedOptions managedOptions = (IManagedOptions) destinationPlugin.getScheduleOptions();
    managedOptions.setDestinationOption(IManagedOptions.CeDestinationOption.ceInbox);
    managedOptions.setIncludeInstance(true);
    managedOptions.setTargetObjectName("My Report Instance");
    managedOptions.setSendOption(IManagedOptions.CeManagedSendOption.ceCopy);
    //Set of users that will receive the instance. 
    Set userSet = managedOptions.getDestinations();
    //Query for the id of a particular user that will receive the instance.
    IInfoObjects users = infoStore.query("SELECT TOP 1 SI_ID " + "FROM CI_SYSTEMOBJECTS " + "WHERE SI_NAME='Administrator' AND SI_PROGID='CrystalEnterprise.User'");
    if (users.size() > 0) {
         IInfoObject user = (IInfoObject)users.get(0);     
            int id = user.getID();                                   
             userSet.add(new Integer(id));
    IDestination destination = schedInfo.getDestination();
    destination.setFromPlugin(destinationPlugin);
    Thanks
    Aasavari

  • Scheduling of Report  Mail it to concern User

    Hi Experts
    Is it Possible to Send the reports on Mail on predifned Time . Eg If daily how much material is dispatch. I want to schedule this report at 5 PM every day .Per day wise.
    If Possible please guide me
    Thanks & regards
    Ashish Gupte

    Hi Gordon,
    Your Answer is quiet helpfull but in the new version that is SAP 8.81 PL04 there is schedule in Query Manager showing schedule just want to try this option also.
    Thanks
    Ashish Gupte

  • How to select several values from a user exit variable in a planning folder

    Hello,
    I have created a user exit variable for limiting the values only to which the user need to access.
    For a simulation part, it is then necessary for him to select several values from these values (not only one, and not all)
    But It seems in this case the user has only two possibilities :
    - keep all the values without any restriction
    - restrain the selection to only one value.
    It seems possible for the user to access to a multiple choice window, but this possibility doesn't seems to work : in all tests we did, only the first value was taken into account by BPS.
    If this method is not good do you know an other manner to permit the user to choice several values amongst a set of pre-selected  (because the original set is too important) values ?
    Thanks for your help.

    Hi Mayank,
    Thanks for your response, but I don't think it corresponds to my problem.
    I my case, I use a user exit variable to filter some data. It seems BPS offers the possibility to the user to select several values amongts the pre-selected values presented by the user exit variable, but it doesn't work. We can use a popup in which we enters the required values, but in final, only the first value is taken into account.
    I don't know if it is due to a BPS bug or if it is not a good solution in regard to BPS philosophy. In this case, the concerned caracteristic isn't in the header but in lead columns.
    I must present a solution to my client next monday, so I have not enough time to open an OSS message.
    An alternate solution should be interesting too.
    My need is to present to a user a selection of values amongst all values from an infoobject (the user exit variable seemed to be a good solution) and the user must have the possibility to select some values amongst these as filter.
    Regards

  • How do I SUBMIT from a user exit which is called in an update task?

    I want to send an idoc each time there is a goods movement. So, in the user exit of MB_POST_DOCUMENT I am calling IDOC_OUTBOUND_WRITE_TO_DB. This creates an idoc of status 30. However, in order to send the idoc I want to SUBMIT RSEOUT00. I get an ABAP dump on the SUBMIT because MB_POST_DOCUMENT is called in the update task, where SUBMIT is not allowed. Do you know any other way I can execute RSEOUT00 at this moment without having to call it later in batch?
    Thanks!!
    Joy

    Hi Naren,
    Your reply is VERY helpful!! Thank you so much.
    I added  CALL FUNCTION 'RSAP_IDOC_EINBUCHEN_VOM_BIW_4' IN BACKGROUND TASK. I am no longer getting the dump, but my idoc is still a status 03 and not a status 30. Should I expect to see it turn to a status 30? I ran this function directly in SE37 -> Test with the same parameters and it ran perfectly and turned the idoc to a status 03. Is there anything else I need to do in the code?
    Thanks again,
    Joy

  • Coming back to the Transaction from a User Exit

    Hi,
    I perform some checks in a User-Exit before saving a transaction & throw an error message if something is not proper. But, the transaction terminates after that. I need to give the user an option to make changes in the transaction. eg, if user exit checks if a certain field should not be empty, the user should have an option to enter the field after the user exit throws the message. How can i go back to the same screen from the exit to achieve the same.
    Thanks in advance.
    Bikash
    This was for a general scenario wherein after an error message triggered by an Exit is displayed, the transaction just terminates.
    Message was edited by: Bikash  Agarwal

    Hi,
    If you give error message, it will leave the current transaction.
    Instead try using some POPUP function module, which will have options 'OK' and 'CANCEL'.
    If user presses 'OK', then allow user to do modifications and if he presses 'CANCEL', then write LEAVE PROGRAM to come out of transaction.
    Hope it helps.
    Regards,
    Shashank

Maybe you are looking for

  • Error message in po

    Hello friends,   An error is occuring while creating a po the message is "The document number you entered does not lie within the interval defined for purchasing documents" please help me on this...... Thank you

  • Install sqldeveloper on windows 7 64 Bit and Oracle 11.2

    Hi, how can I find the rigth jdk. I installed JDK on C:\Program Files\Java\jdk1.6.0_23. I installed Oracle 11.2 including sqldeveloper. But I cannot find the correct folder to start sqldeveloper. Where can I find this path? When I include a path with

  • Error iTunes??

    I would like for me, excuse my bad English (google translation), but I hope that you sent me still can help! I have an iPod nano 8GB bought, now I wanted to iTunes on my Windows Vista Home install. Unfortunately I always get the following error messa

  • Does eMac support iTunes7 for iPhone?

    Since loading ios6 for iPhone it no longer connects to iTunes and I can't download iTunes 7 to my eMac. Is there a solution other than a new mac?

  • Best practice to split up documents into articles?

    Dear Adobe, at the today's InDesign and DPS session I was asking how the DPS folks, split up the InDesign documents to upload as different articles to the dps? Bob wanted to ask Collin, but forgot to do it! I will explain my situation (supposing that