How to Trigger a Job from se38 Report

Hi,
I need to trigger a job from an se38 report program.
Currently the code I'm using is:
  SUBMIT YARTZ_SPOOL
         USER SY-UNAME
         VIA JOB 'YARTZ_JOB2'
         NUMBER 1
         TO SAP-SPOOL
         SPOOL PARAMETERS l_print_parms
         WITHOUT SPOOL DYNPRO
         AND RETURN.
But the SY_SUBRC return I get is 8 which stands for 'Error In job Scheduling'
Is the method used correct?
Or am i going wrong in scheduling the job? As far as Job scheduling goes, I used the Date/Time schedule and scheduled it at a time 20 minutes later.
Thanks.

Hi,
use the code
  IF p_bjob = 'X'.
    CONCATENATE sy-cprog sy-datum sy-uzeit
                INTO jobname SEPARATED BY '_'.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = jobname
      IMPORTING
        jobcount         = jobcount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      IMPORTING
        out_archive_parameters = arc_params
        out_parameters         = print_params
        valid                  = valid
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    IF valid = chk.
      SUBMIT YARTZ_SPOOL
                      WITH <selection-screen parameters if any>
                      AND RETURN
                      USER               sy-uname
                      VIA JOB            jobname
                      NUMBER             jobcount
                      TO SAP-SPOOL
                      SPOOL PARAMETERS   print_params
                      ARCHIVE PARAMETERS arc_params
                      WITHOUT SPOOL DYNPRO.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = jobcount
          jobname              = jobname
          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
          invalid_target       = 8
          OTHERS               = 9.
      IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        MESSAGE i029 WITH jobname.
      ENDIF.
    ELSE.
      MESSAGE s000 WITH text-003.
      STOP.
    ENDIF.
  ENDIF.
reward points if useful
regards,
Anji

Similar Messages

  • How to trigger a job from the another job?

    Dear Pals,
    Im new to Business objects data integrator 11.7.2.3. 
    Requirement :
    I have two jobs JOB1 and JOB2. JOB2 to be executed only after completion of JOB1.Please do let me know how to meet this requirement.
    Thanks in advance.
    Regards,
    Diras

    export the execution command for both the jobs from the web admin batch job history page
    this will export the job launch command to a .bat or .sh file depending on OS to %LINK_DIR%/log directory
    you can call these jobs in another script in sequence
    or if you are looking for lanuching Job2 only if Job1 is successful, then in the Job1 you can add a script at the end and call the script (to which the execution command is exported) for Job2 by using the exec function

  • Regarding Triggering the job from se38

    When i trigger a job from se38, i get a message saying " Event or Parameter has been raised on the server " can any one make me understand what does it mean.

    Hi
    SE38 functions are,
        Create variants
         Display variant directory
         Display and change values and attributes
         Copy, delete and rename variants.
    Find the link below,
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/67ee407552742ae10000000a155106/frameset.htm
    I think this will help you,
    Regards
    Sibvanand

  • How to call a Workflow from a Report in SE38?

    How to call a Workflow from a Report in SE38?
    Please can Anyone Send me a Source code (with Explanation)which I can use for calling Workflow >> WS99900253?
    Regards,
    Shashank.

    you can use FM
    SAP_WAPI_CREATE_EVENT
    SWE_EVENT_CREATE
    OR
    SAP_WAPI_START_WORKFLOW
    Regarding usge of this FMS search the forums you will get ample examples.
    Thanks
    Arghadip

  • Creation of background job from SE38

    hello all...
    In the selection screen of my report program, there are two radiobuttons - read mode or update mode.
    In read mode, the program reads an excel file and gives the output in teh form of errors, if at all, after some chekcs on this excel file.
    In update mode, the program should check the excel file, get an internal table with errors from the excel file as well as run BDC for the correct records in excel file. So the output here has two blocks, first one - errors in excel file, second one - errors in BDC update.
    But this update mode should run in background.
    HOW TO CALL THE BACKGROUND JOB FROM THIS REPORT PROGRAMME when the update mode is selected??
    Advance Thanks
    omkar

    Hi Vishal,
    1. How are u running the BDC ?
    2. If u are using call transaction syntax,
       then there is an extension to it.
        MODE mode
      (See help F1 on call transaction)
    The processing mode can take the following values:
    'A' Display screen
    'E' Display only if an error occurs
    'N' Do not display
    'P' Do not display; debugging possible
    3. We can use N
    4. N means, it won't display any screens
       of that BDC transaction.
    5. It does not exactly mean the BACKGROUND JOB
       generated thru sm36.
    Regards,
    Amit M.
    Message was edited by: Amit Mittal

  • How to trigger sender rfc from r3 system

    Hi experts,
    can any body send  documents about " how to trigger sender rfc from r3 system"
    regards
    sandeep.

    HI Sandeep,
    To send RFC data on timely basis you can schedule the programs.
    In Partner Profile use setting collect program. Use program RSEOUT00 to send data at particular time.
    You can schedule the report RSEOUT00 according to your requirements. So it flushes all the idocs in the background as per your schedule this program.
    Plese refer the below thread, it will help you.
    Re: Triggering Idocs from sender  side
    Idoc triggering from a transaction
    Cheers..
    Vasu
    <i>** Reward Points if found useful **</i>

  • Remove Reschedule jobs from Developer Reports Sever 6i

    Dear All,
    Please guide me how i can remove reschedule jobs from Developer Reports 6i
    Regards
    USMAN ALI

    Install Forms in one directory (You can have reports in the same
    directory).
    Install oracle DB in another directory.
    Don't change any file and reboot.
    The listener will start automatically as a service.
    (If not from a command line write "lsnrctl start" to start it).
    To connect from forms/report to the DB you need to activate the
    sqlnet easy config tool from the directory where forms is.
    Follow the wizard to define an entry in the tnsnames.ora file
    automatically.
    Then you can use your forms with the DB.
    (IF you get problems it usually helps to let us know the error
    code you get so we can direct you in the correct direction).

  • How to call a package from the Report in Oracle Application Express

    How to call a package from the Report in Oracle Application Express

    Hello,
    What do you mean? Something like SELECT mypackage.function( par1, par2) from dual?
    Or do you want to execute a procedure when something happens on the page, like clicking a button?
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to Trigger an IDOC from SAP R/3 to two systems at a time

    Hi experts,
    Can any one please tell me How to Trigger an IDOC from SAP R/3 to two XI systems at a time.
    My current production R/3 system sends a DELVRY03 IDOC to Production XI system ( Name : XIP) .
    I would like to route the same IDOC from production R/3 system to my Quality XI System ( Name XIQ) .
    Problem is production R/3 system triggers an IDOC once. We need to write a logic to route the same to two different systems
    Can any one tell me how can we do that ?
    Regards
    Ram.

    Hello Ram,
    Do you have connectivity between your production & XIQ?
    What does "connectivity" mean?
    1. RFC destination is maintained.
    2. Port defined for the RFC destination.
    If no, create these. (Search in SDN for details).
    If yes, proceed:
    1. Define the logical system for XIQ.(BD54)
    2. Define the same as your partner profile. (WE20). Add the message type SYNCH with the port for XIQ.(This is imp)
    3. Create a distribution model view with sender as "your production" & receiver as XIQ.
    3.1. Add the messages which you want to distribute.
    3.2 Generate Partner profiles.
    No coding is reqd. for this.
    BR,
    Suhas

  • How to Trigger an IDOC from SAP R/3 to two XI systems

    Hi experts,
       Can any one please tell me How to Trigger an IDOC from SAP R/3 to two XI systems at a time.
    My current production R/3 system sends a DELCERY01 IDOC to Production XI system ( Name : XIP) .
    I would like to route the same IDOC from production R/3 system to my Quality XI System ( Name XIQ) .
    Problem is production R/3 system triggers an IDOC once.
    Regards
    Ram.

    Hi Ravi,
      Thank you very much for your answer.
    As I am not completely aware of R/3 side,I am getting little problem in understanding your answer.
    Could you please explain the same in some what beter way.. Thank you ..

  • HOW TO TRIGGER AN WORKFLOW FROM A PROGRAM ?

    HELLO THERE ,
    CAN ANYBODY PLZ TELL ME HOW TO TRIGGER AN WORKFLOW FROM AN PROGRAM AND TO PAS THE VALUE TO THE CONTAINER ?

    Hello Neon,
    If you want to trigger the workflow directly, use the FM, SWU_START_WORKFLOW
    CALL FUNCTION 'SWU_START_WORKFLOW'
      EXPORTING
        task                  =
    *   LANGUAGE              = SY-LANGU
        user                  =
    *   SENDER_ID             =
    * IMPORTING
    *   RETURN_CODE           =
    *   WORKITEM_ID           =
      tables
    *   CONTAINER             =
    *   MESSAGE_LINES         =
        attachment_list       =
    A workflow can also be triggered by and event which is in turn triggered by a program.
    By the FM, SWE_CREATE_EVENT
    Example:
    w_key = 'Connie'.
      w_creator-otype = 'US'.
      w_creator-objid = 'SAPDEV02'.
      CALL FUNCTION 'SWE_EVENT_CREATE'
        EXPORTING
          objtype                       = 'YH_BUDDIES'
          objkey                        = w_key
          event                         = 'event'
         creator                        = w_creator
    *     TAKE_WORKITEM_REQUESTER       = ' '
    *     START_WITH_DELAY              = ' '
    *     START_RECFB_SYNCHRON          = ' '
    *     NO_COMMIT_FOR_QUEUE           = ' '
    *     DEBUG_FLAG                    = ' '
    *     NO_LOGGING                    = ' '
    *     IDENT                         =
    *   IMPORTING
    *     EVENT_ID                      =
    *   TABLES
    *     EVENT_CONTAINER               =
       EXCEPTIONS
         objtype_not_found              = 1
         OTHERS                         = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        WRITE: / 'EVENT TRIGGERED'.
      ENDIF.
      COMMIT WORK.
    Hope it helps you.
    Regards
    Indu.

  • How to trigger an interface from a database(COBOL) in online mode?

    Hi everybody,
    Can you please tell me how to trigger an interface from a database(COBOL) in online mode?
    thanks a lot,
    Ramya Shenoy

    If you can make a HTTP call from you DB platform -
    HTTP -> BPM (Receive -> Send Step (execute an SP or your select statement here in the JDBC receiver channel) -> send (to target) )-> end.
    VJ

  • How to pass the value from Sub report to main report

    I have un report(mainreport) within a subreport(subreport).
    With reporting services, how to pass the value from Sub report to main report?
    thanks

    Hi Alebet,
    With reporting services to pass values from sub report in to main report is not supported directly.
    But there are some workarounds through which you can get this .
    There are two ways to get this.
    1- Put your sub report query into some table. i mean to say through the subreport query get some temporary table.
    2- Using this temporary tables data write some Scala function in the data base.
    3- Now in your main report query return this scala function as a column.
    4- Extract the column value where ever you want in your main report which is getting calculated from the subreport query. so you will be getting the values returned from the subreport in the main report.
    This will definitely work fine as i have done some report in this way.
    Another way of doing is that
    1- prepare another data set with the same query as in sub report in the data tab.
    2- then refer this 2nd dataset in your main report .
    But better way will be the top one.
    Anyway please let me know if you get the solution.
    Thanks
    Mahasweta

  • How to trigger IDOC'S from SAP

    Hi All,
    How to trigger IDOC's from SAP(ECC 6)..where can we check this in mii 11.5 weather it is fail/success
    Thanks,
    Abhi

    You can trigger LOIPRO, LOIPLO and a few others manually from POIT (SAP Txn).  Master Data related to orders can be triggered from POIM.  Depending on which IDocs you which to generate, there are other transactions to trigger different IDocs.
    You can also use Triggers from MII to generate IDocs in SAP using CLOI_DOWNLOAD_TRIGGER_MDAT (POIM equivalent) and CLOI_DOWNLOAD_TRIGGER_TRANS (POIT equivalent).
    There is also a rather nice post which detailed the process of using change pointers to automate the IDoc generation and download, but I am having trouble finding it.  Will continue to look and will post link when I find it.
    Regards,
    Mike
    I couldn't find the post I was looking for, but there is an informative note 390635 which may help.
    Edited by: Michael Appleby on May 5, 2009 1:29 PM

  • How to call Provisioning Job from On-Demand Job.

    Hi Experts,
    I need your help.
    I am using SAP IDM 7.2
    Please tell me how to call provisioning Job from ON-Demand Job.
    Regards,
    C Kumar

    As everyone else has already mentioned, the uProvision function is probably what you're looking for. It's well documented in the helpfile so I won't add the parameter description here. A provisioning task can only be run on a mskey/taskid combination so you need to provide both to start the task. That means that you should have a global or job constant pointing to the task, and a script or source select statement that looks up the mskey that you want to start.
    Simple example, using a To Generic pass to start the task "Dispatcher test #1.0.0" for 1000 entries whos names start with "USER.10K.TEEST"
    Source:
    To Generic pass destionation:
    TASKID could also be a global constant w. a task reference since tasknames have no uniqueness.
    Source SQL Statement:
    select top 1000 mcmskey mskey,(select taskid from MXP_Tasks where TaskName = 'Dispatcher test #1.0.0') as taskid
    from idmv_entry_simple where mcMskeyValue like 'USER.10KTEEST.%'
    Destionation script:
    // Main function: execT
    function execT(Par){
      mskey = Par.get("MSKEY");
      taskid = Par.get("TASKID");
      OutString = uProvision(mskey,taskid,0,0,"test dispatcer #1.0.0",0);
      // uInfo(mskey+":"+taskid+":"+OutString);
      return "";
    Br,
    Chris

Maybe you are looking for

  • Nokia 603 cannot turn on , problem with ON button

    Hi, I'd appreciate if anyone could help me My nokia603 ON button works fine when the phone is already on, meaning i can press it to switch the phone off, but when the phone is off, and try to turn it on again by pressing the on button, it doesnt resp

  • EOIO vs single thread

    I have a scenario, R3>IDoc(EOIO Queue)-->BMP(...do something there after), we set up the EOIO queue by Idoc serialization(add a line to idxquque table),  the problem is: we send multiple idocs at the exactly the same time(same second), the order they

  • Remove Padding from Header in DW5.5?

    Can anybody help me with a pickle? I'm trying to create our headers in HTML only and I can't figure out how to get the padding off below the header so it touches the border. Here's the code: HARD CODE: <table width="93%" align="center" cellpadding="0

  • Help with Alerts

    Hi Gurus, We are on SAP Business One version 9 PL03 and we maintain an after-sales MS Access SAP add-on where users input the details of a damaged/faulty after-sales item(s) (under warranty) which the customer(s) has brought back for repair. The user

  • Printer agent message on boot up

    Each time I boot up I get the message  " Do you want Printer agent to accept incoming network connections.  Have checked my network and printer settings and don't see anything that I can change that would fix this.