Trigger sheduled job

Hi all,
I need to trigger or release sheduled job when particular file is present in folder.
I mean for example..
I have sheduled a job ZFCP0001A01...I want to trigger job if ZFCP.TXT file is present in particular folder. If file is not present, then dont trigger job.
Does anyone has program which i can shedule everyday to trigger above job if file present.
Many Thanks
Shiva

Hi shiva,
It is possible.
Just create one event for job that you are going to monitor..i.e file placing in a folder.
then by using SM36/SM37 u can schedule your job ZFCP0001A01 based on Job Start condition after event in SM37.  you need to configure it.
Pls check with your basis people to create that event.
Reward points if my reply helps u
~Lakshmiraj~

Similar Messages

  • 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

  • Trigger a job using an event through a process chain

    Hi,
    After the success of 5metachain, I am using AND condition
    My requirement is as follows, it should trigger a job which needs to be after AND condition,
    I have created an event using sm64. Basically the client wants to trigger the job using the event through the process chain. I have tried test scenariou2019s using ABAP program (Process type) in the process chain but it is failing. Is there any other way to trigger a job using an event through a process chain? If ABAP program is the only option, can you please specify what all needs to be filled in the variant?
    Regards.
    Jerry

    Hi,
    Create a program like below,
    CALL FUNCTION 'BP_EVENT_RAISE'
      EXPORTING
        EVENTID = 'EVENT WHICH YOU HAVE CREATED'
    EXCEPTIONS
       BAD_EVENTID                  = 1
       EVENTID_DOES_NOT_EXIST       = 2
       EVENTID_MISSING              = 3
       RAISE_FAILED                 = 4
       OTHERS                       = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    search and include the program name which you have created above in the "ABAP program" process type which you are going to include in the process chain.
    Include the event which you have created in the start condition of the job.
    Note: No need of give any variant, because here we are calling only one function in this program.
    Regards,
    Sridevi.

  • About ME2N T code Shedule job in SM36..

    Hai SAP Gurus,
                                In Fore ground I always use ME2N with my desired variant as input parameters to get PO Pending value in rupees.
    I want Four Field: Plant,Still to be delivered Value,Material & Currency.
    But I cant get his fields while i set back ground shedule job ..
    My Immediate job is to take report for Pending PO Values for Plantwise & Material Type wise..
    Kindly guide me...

    Hi Sweta,
             Its always better to use the SAP std report..which also match your requirements..but on the other hand as you said that its taking time, this is because your input parameter range is very wide..ie. Plant and material type...I suggest you to take the other parameters into consideration like period etc...
    On the other hand if we see, then it can also be possible via using the table EKBE....
    when you execute the table as per your plant and material type...system will show the results(but indirect one)..
    Here you need to calculate the open/remaining qty...You do this by downloading the results to the excel sheet/speadsheet....and via using the formula calculate the values faster....
    Regards
    Priyanka.P

  • How to trigger a Job on cancellation of another Job ?

    Hi Friends,
    I have a requirement stated as below.
    We need to trigger a Job (JobB) on cancellation of another Job (JobA). This needs to happen on a periodc basis.
    If JobA is success then we dont need to run JobB.
    Could you please let me know how to acive this.
    Regards,
    Ravi Kasnale

    Try this,
    goto SM36 & create a job say job name "Job_test"
    Define a Job Step,
    choose an ABAP program say Zjob_start
    before this step Write an ABAP program "Zjob_start" which can,
    check status of "JobA"
    Use FM's mentioned by other members in this post.
    Check the status of JobA
    If its cancelled start your new job.
    by some FM's  mentioned by other members in this post.
    The start conditions for Job_test should be "After Job"
    & mention JobA in the parameter unchecking the checkbox & finish.
    Try, this may work.

  • Trigger SAP job

    Hi Experts,
    I have a requirement to trigger SAP job whenever there is a new file in a network folder which is outside SAP. File name is like worklistYYYYMMDDHHMMSS.CSV. Timing of this file creation are unpredictable.
    Also, this new file should be passed to SAP job for running.
    Do you have any idea about possible solution? Can we user Event based trigger (SAPEVT command)?
    Please let me know the details.
    Many thanks,
    Apps

    Hi
    You can do it in this way.
    Creat a program in ABAP which picks up the file from Application Server
    Put all the reocrds in an internal table and post it in SAP.
    This program will be batch program and it will run once in every hr and
    it will store the last captured file name in a Z table so whenever it picks up new file it will
    compare the name old file and if they are not same delete the old file name and insert the new file name in the Z table.
    Your batch program can pick up the file name from this Z table.
    Hope it is useful.
    Regards
    Neha

  • 3.1EA2 can't edit Sheduler job

    error ORA-27469: DESTINATION_NAME is incorrect job attribute
    when I try to edit sheduler job.
    Error text is in russian, "is incorrect job attribute" is translation from russian.
    Oracle database version is 10.2.0.4 on Linux x64

    Please give the job definition, and what and how you're trying to edit.
    K.

  • Trigger a job based on a job that will be created during runtime

    I searched sdn and I did not find any threads addressing my issue(Trigger JOB B after a JOB A which will not be available untill runtime).
    My Req:
    I have a where in, a JOB 'A' will trigger to execute a BDC session in program A using a SUBMIT ...RETURN statement.
    I will have to trigger a different job 'B' using program B, the moment the 1st job runs completed.
    I thought this would be possible, by handling the events and trigger the FM in program A after the SUBMIT statement. But the problem is SUBMIT statement would just create the job and return the control back to the program A and immediately call the FM to raise the EVENT. In this case, my job B will trigger and even complete before JOB A could complete successfully.
    I tried using AFTER JOB option in SM36 instead of AFTER EVENT. The problem with this option is, JOB A will be available ONLY during runtime and hence cannot schedule program B with the option AFTER JOB.
    Any thoughts are highly appreciated.
    Thanks for your help.
    Best Regards,
    Kiran

    Hi Thomas,
    I programmed the way you mentioned and this triggers both the jobs at the same time.
    DATA: number  TYPE tbtcjob-jobcount,
          jobname LIKE tbtcjob-jobname.
    jobname  = 'JOB1'.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = jobname
      IMPORTING
        jobcount         = number
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      SUBMIT zhbn_life_premium_summary_rpt
      VIA JOB    jobname
          NUMBER number
          AND    RETURN.
      IF sy-subrc EQ 0.
        CLEAR: jobname.
        jobname = 'JOB2'.
        CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = jobname
          IMPORTING
            jobcount         = number
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 3
            OTHERS           = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          SUBMIT zhbn_life_premium_summary_rpt
          VIA JOB    jobname
              NUMBER number
              AND    RETURN.
          IF sy-subrc EQ 0.
            WRITE: 'job 2 success'.
            jobname = 'JOB2'.
            CALL FUNCTION 'JOB_CLOSE'
              EXPORTING
                jobcount             = number
                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.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      jobname = 'JOB1'.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = number
          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.
      ENDIF.
    ENDIF.
    Am I missing anything?
    Thanks
    Kiran

  • Can report program trigger a job and then a job trigger another report?

    Actually I'd like one ABAP4 report program trigger another ABAP4 report program and yesterday some people here suggested me to use SUBMIT statement at the end of the source program, but if we don't want to touch the source code of the source program, what would be the best way to trigger another report program, in this way: report program1 -> job -> report program2?
    or report program1 -> event -> job -> report program2?
    Thanks

    Hi Kevin,
    I know this is a late reply and you probably already solved your problem. However, the new Job Scheduling capabilities of SAP NetWeaver might be something to look at. You can find more information about this on SAP Service Marketplace under quick-link job-scheduling (http://service.sap.com/job-scheduling)
    Kind regards,
    Edwin Esser

  • Trigger Batch Jobs in order

    Hi,
    I have four batch jobs under one project. I need to run each batch job in order and trigger one by one in order of execution.
    For example, first job should run then once it finishes, second job should start and on and on.
    Can this be done in DI designer?
    Appreciate your help.
    Arun

    Hi  Michael,
    Thank you for the tips.
    I tried running all the jobs as a single job, but i am getting pagable cache <1535 MB> buffer pool issue. After this message, the job server hangs and the output file size becomes enormous in GB.
    I changed from pageable cache to memory cache, but still the issue continued. Do not know how to work around so i split one job into four.
    Any tips or information on working around the buffer pool is greatly appreciated.
    Thanks,
    Arun
    PS: My source and target files are both in txt format and source file has more than 100,000 records.

  • Trigger a job on placing a request for database provisioning on EM12c

    Hi
    I have created a job and associated it with a script that must run in Em12c. This job has to be auto-executed as soon as a request for database is made in the Database Self-Service Portal. How is this done in EM12c.
    Thanks

    Hi,
    All dbms_scheduler calls automatically commit. You cannot commit in a trigger so you are getting an error. There are two ways around this.
    - one is as suggested above to put the enable into an autonomous transaction using PRAGMA AUTONOMOUS_TRANSACTION.
    - the other way is to have the trigger enqueue an AQ message and then either use a job or a registered notification to do whatever you need to do. The advantage of that approach is that if there is an error in the trigger the message enqueue will be rolled back, but the autonomous txn would commit either way. But this is a bit more setting up (create a queue, enqueue a message, register a subscriber or create an event job).
    Hope this helps,
    Ravi.

  • Mail trigger  - Background job

    Hi Experts,
                     I have faced one problem in Mail Triggering. to the User.
    Our Requirement is,
                    Whenever we execute one report ( ALV output) in Background , The Output should go the user thro mail ( automatic Mail trigger when the background Job is finished)
             if anybody knows, plz guide me to do it.
    With Regards,
    Mahesh.

    Hi Dude,
    Execute This Program as it is.UR requirement will be full filled .
    Here the important Thing is the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      tables
        packing_list               = it_packing_list
        contents_txt               = it_message
        receivers                  = it_receivers
    Hope this Code helps U.
    *& Report  ZSENDMAIL
    report  zsendmail.
    parameters: psubject(40) type c default 'Testing'.
    PUSH BUTTON
    data: it_packing_list like sopcklsti1 occurs 0 with header line,
    it_contents like solisti1 occurs 0 with header line,
    it_receivers like somlreci1 occurs 0 with header line,
    it_attachment like solisti1 occurs 0 with header line,
    gd_cnt type i,
    gd_sent_all(1) type c,
    gd_doc_data like sodocchgi1,
    gd_error type sy-subrc.
    data: it_message type standard table of solisti1 initial size 0
    with header line.
    *START-OF-SELECTION.
    start-of-selection.
      perform populate_message_table.
    *Send email message, although is not sent from SAP until mail send
    *program has been executed(rsconn01)
      perform send_email_message.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
      perform initiate_mail_execute_program.
    *& Form POPULATE_MESSAGE_TABLE
    adds text to email text table
      form populate_message_table.
      data : itab type table of sflight with header line.
      data : lv_itab(255) type c.
      select carrid
             connid from sflight into corresponding fields of table itab
             where carrid = 'LH' and connid = '0400'.
      loop at itab.
      write : / itab-carrid , itab-connid.
      concatenate itab-carrid itab-connid into lv_itab separated by space.
      append lv_itab to it_message.
      endloop.
    endform. " POPULATE_MESSAGE_TABLE
    **& Form SEND_EMAIL_MESSAGE
    *send email message
    form send_email_message.
    *fill the document data.
    gd_doc_data-doc_size = 1.
    data: tab_lines like sy-tabix.
    describe table it_message lines tab_lines.
    read table it_message index tab_lines.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + strlen( it_message ).
    **POPULATE the SUBJECT/GENERIC message ATTRIBUTES
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SAPRPT'.
    gd_doc_data-obj_descr = psubject.
    gd_doc_data-sensitivty = 'F'.
    **describe the body of the message
    **information about structure of data tables
    clear it_packing_list.
    refresh it_packing_list.
    it_packing_list-transf_bin = space.
    it_packing_list-head_start = 1.
    it_packing_list-head_num = 0.
    it_packing_list-body_start = 1.
    describe table it_message lines it_packing_list-body_num.
    it_packing_list-doc_type = 'RAW'.
    append it_packing_list.
    **add the recipients email address
    clear it_receivers.
    refresh it_receivers.
    it_receivers-receiver = 'KRK'.   "p_email.
    it_receivers-rec_type = 'B'.
    it_receivers-com_type = 'INT'.
    it_receivers-notif_del = 'X'.
    it_receivers-notif_ndel = 'X'.
    append it_receivers.
    it_receivers-receiver = 'OBT'.   "p_email.
    it_receivers-rec_type = 'B'.
    it_receivers-com_type = 'INT'.
    it_receivers-notif_del = 'X'.
    it_receivers-notif_ndel = 'X'.
    append it_receivers.
    **CALL the fm TO post the MESSAGE to sapmail
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      exporting
        document_data              = gd_doc_data
        put_in_outbox              = 'X'
    importing
       sent_to_all                = gd_sent_all
      tables
        packing_list               = it_packing_list
        contents_txt               = it_message
        receivers                  = it_receivers
      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.
    **store function module return code
    gd_error = sy-subrc.
    **GET it_receivers return code
    loop at it_receivers.
    endloop.
    endform. " SEND_EMAIL_MESSAGE
    *& Form INITIATE_MAIL_EXECUTE_PROGRAM
    **instructs mail send program for sapconnect to send email.
    form initiate_mail_execute_program.
      wait up to 2 seconds.
      if gd_error eq 0.
        submit rsconn01 with mode = 'INT'
        with output = 'X'
        and return.
      endif.
    endform. " INITIATE_MAIL_EXECUTE_PROGRAM

  • Trigger a job after all jobs have completed

    Hi All.
    I have a program which schedules several jobs based on some complex criteria maintained in a config table. Some of the jobs scheduled can be  in a chain, some can be independent.
    At the end of all these jobs which my program spurned off, I want to run another program which will collect their spools and send it in one shot to a recipient.
    How can I know when all my jobs have completed? I know I can look at TBTCO table - but can I trigger the spool sending program automatically based on completion of all jobs?
    The point is I do not know which job can complete at the end - otherwise I could have triggered an event from that last job.
    Any clues please?
    Thanks in adv.

    Hi Aishi,
    There's a simple trick you can apply..There's no need for the third party tools for this.
    Create a custom table with the fields for p_Date(Primary Key) and the fields for each program of the background jobs.
    Update the custom table with the value 'X' after each program is succesfully completed and check for all the fields in the table if they are all updated and if they are all updated then trigger the final batch job with the Event using
    FM "BP_EVENT_RAISE'.
    Hope you understood the logic.

  • Batch File to trigger SAP job

    Hi all,
    Please can anyone advice on how to write a batch file to trigger the sap job. For example: If file exists in an external folder (e.g. C:\Temp), a command will trigger to run the SAP job.
    Many thanks,
    Shashi

    You could do this.
    Check if file exists.
    Do something when it does.
    Move file to another directory and rename file with data/time stamp
    Renamed file give history of activity
    Schedule this program to run every X amount of time
    data: w_result type c.
    data: w_file type string value 'C:\temp\test_down.spf'.
    data: w_file_size type i.
    call method cl_gui_frontend_services=>file_exist
      exporting
        file                 = w_file
      receiving
        result               = w_result
      exceptions
        cntl_error           = 1
        error_no_gui         = 2
        wrong_parameter      = 3
        not_supported_by_gui = 4.
    if w_result ne 'X' .
    else.
      write: / w_file.
      write: / 'File exists'.
    Do something when it does.
    Move file to another directory and rename file with data/time stamp
    Renamed file give history of activity
    endif.
    flush needed for some methods of class cl_gui_frontend_services
    call method cl_gui_cfw=>flush
      exceptions
        cntl_system_error = 1
        cntl_error        = 2
        others            = 3.
    Bruce

  • How to change sheduled jobs from one users to other user?

    Hi,
    I want to change shoulded jobs from one users to other user.
    Is there any way that we change job from one user to other user.
    apart procedure with sm37: single job selecting with copy option.
    Regards,
    Gianluca Vinco

    Hi,
    Please try the folloiwng for changing the User of a Scheduled job:
    1. Go to transaction SM37, select the 'Scheduled' Job by checking the check box and then use the menu path Job -
    > Change
    2. You may reach the Change Job xxx screen. Here, click on the Step button
    3. You may reach the Step List Overview screen
    4. Here select the step in the list and click on the Change icon to make the User change in the pop up Edit Step window
    I hope this helps you in your work.
    Best Regards
    Sitaraman

Maybe you are looking for

  • Problems with log4j in jboss please help

    Please i need help because i can't anywhere else. Below is the log4j properties file # initialise root logger with level INFO and call it log4j.rootLogger=INFO, BLAH # add a Appender to the logger BLAH log4j.appender.BLAH=org.apache.log4j.RollingFile

  • How to change OS_owner

    Hello everyone. I'm new on here and also with my Macbook pro. I recently bought my macbook pro from a friend. They reset it back to factory settings so when I first turned it on it asked for my name and everything, but now when I open up my folders,

  • Patching to 10.2.0.3

    hi folks I am running oracle 10 R 10.2.0.2 I want to apply patch 10.2.0.3 without losing data...Should I simply install patch on $ORACLE_HOME?? dbs will remain safe?? thanks

  • Where is XML workflow in LOGIC?

    You got my money APPLE, so WHERE IS THE XML WORKFLOW IN LOGIC?!@?

  • Hard Drive replacement nightmare

    On a G4 466 system with a 30gb primary hard drive running OSX 10.3.9, I attempted to perform a CCC disk copy to replace the startup disk. The drive I used as new was an IBM Deskstar 60GXP (40gb, ATA100, 7200rpm) that I previously used as a backup for