Triggering background job event from Unix script

Hi all,
  I am having one question regarding triggering of background job in SAP using Events from Unix script. Is this possible? If so, can anyboy provide some sample code related to Unix script and how do we communicate to SAP from Unix system. Actually, here the backend of R/3 system is MSSQL. I am having a program in R/3 system which is scheduled as a background job based upon event trigger. I want to trigger that even from the unix script.
  Appreciate for your help in advance.
Thanks,
Adithya K

Hi,
Check if this can help you
http://help.sap.com/saphelp_sm32/helpdata/en/fa/096e6b543b11d1898e0000e8322d00/content.htm
Regards,
Atish

Similar Messages

  • Background job - Event tiggering not happening

    Hi All,
    Background job X will run on daily basis and which in turn triggers two jobs say A and B.
    The job X got finished successfully but jobs A and B havn't been triggered and so not running.
    Please help me on this.
    Thanks & Regards,
    Gopi L.

    HI,
    Gopi check the start condition of job A & B, what event is triggering these jobs.
    Also check SAP note 395170.
    Regards,
    Sachin Rane.

  • Call ABAP program from Unix script passing dynamic filename

    Hi,
    Does anyone know if it is possible to call an ABAP program from a Unix script passing a dynamic filename to the ABAP program?
    We are receiving a file from an external company and on receipt of the file want to call an ABAP program passing the filename.  The filename is made up of File ID, Date and Time which we need to read in the ABAP program.  We usually use Events to trigger a program which is fine when the filename if static however since this filename will be dynamic we cannot do this.  In addition we cannot just rename the file to a static name in the Unix script as we need to know the value of the date and time from the file ID in the ABAP program.  I can change the ABAP program to check our /in directory for a Filename that starts with the fixed File ID however I thought there must be a better way of doing this.  We want the external company to put this information in a file header record but they don't want to change the file contents.  Any ideas would be appreciated.
    Thanks,
    Sinead.

    You could follow the following method
    1.Let the external file reside in the SAP application layer in a defined path e.g. /usr/sap/tmp/interface/working/
    2.Write an ABAP program which will include the following steps:-
       i) read all files in the file path using function module EPS_GET_DIRECTORY_LISTING
      ii) Read the data from files existing in the directory using OPEN_DATASET statement
    iii) After the files have been read move the files to another directory e.g. /usr/sap/tmp/interface/backup/ or you can delete the file.
    3.Schedule this program to be executed depending on the frequency of the external file being generated.

  • Triggering background jobs

    What is the best solution to trigger background jobs within user exits?
    Currently the method I am using is quite cumbersome.
    1. Create user event in SM62
    2. Create background job attached to this user event.
    3. Within user exit call function module BP_EVENT_RAISE using user event.
    The problem I have with this approach is that in the program I have to add a 15 - 20 sec delay to handle record locking. Lets say I am in a user exit in MM02, triggering this event without the delay can lead to no records been processed.
    What are other ways of implementing this solution?
    Can I do a SUBMIT report VIA JOB
    or CALL FUNCTION IN UPDATE TASK.

    Try this way also.
    In the userexit update a custom table with document number + flag (pending for process)
    Create standalone program that to be scheduled like every 5 minutes (as you like ) search for this table and get all open documents (with flag eq space ) and process one by one.( Calling jobs)
    This will reduced number of repetative background jobs
    Say User A edit document 100 at 10.00 am and saves at 10.01 am and user B edit document 100 at 10.02 am and save it
    10.03 am ( so every save if you trigger a backgound job, unncessary create jobs for same document number 10 )

  • Background Job call from a program

    Hi all,
    We have a program which runs for max of 5 minutes (say).
    It is scheduled to run every minute in SM36 so that it keeps continuing to run.
    But sometimes even when the previous job is running the one starts up, thereby creating inconsistent results.
    So we need to call the job from the running program itself.
    How should we go abt this ? Is there any other way available to solve this ?
    Thanks in Advance,
    Regards,
    Vivek K

    Hi,
    Managing Jobs from the Job Overview
    Use
    The Job Overview, or Job Maintenance, screen is the single, central area for completing a wide range of tasks related to monitoring and managing jobs, including defining jobs; scheduling, rescheduling, and copying existing jobs; rescheduling and editing jobs and job steps; repeating a job; debugging an active job; reviewing information about a job; canceling a job's release status; canceling and deleting jobs; comparing the specifications of several jobs; checking the status of jobs; reviewing job logs; and releasing a job so it can run.
    Procedures
    Specifying Jobs
    To display the Job Overview screen, choose CCMS ® Jobs ® Maintenance or call Transaction SM37. Before entering the Job Overview screen, the system first displays the Select Background Jobs screen, where you must select the criteria for the jobs you want to manage. These criteria include:
    Job name (which can contain a wildcard (*) to select jobs with related names oru2014by using the wildcard aloneu2014any job). Required.
    Name of the user who scheduled the job (the wildcard is allowed here as well). Required.
    Job status
    Planned or actual start time of the job.
    Job start condition or event linked to the start condition
    Job step
    When and how often the job runs, or " periodicity"
    You can also choose Extended Job Selection, where you can more precisely define the specific criteria that determine which jobs to select. If you have administrator Authorizations for Background Processing, you can display jobs in all clients. Without this authorization, only jobs in the client that you are logged on to will be displayed.
    Once you have set the criteria for you job selection, choose Execute.
    Managing and Monitoring Jobs
    Once you have called the Job Overview screen (Transaction SM37 or CCMS ® Jobs ® Maintenance) and selected which jobs you want to manage as described above, you can choose from a wide range of management tasks.
    To copy a single existing job, choose Job ® Copy.
    To reschedule or edit job steps or attributes of a single job, choose Job ® Change. A job step is an independent unit of work within a background job. Each job step can execute an ABAP or external program. Other variants or authorizations may be used for each job step. The system allows you to display ABAP programs and variants. You can scan a program for syntax errors. You can also display the authorizations for an authorized user of an ABAP job step.
    To repeat a single job, choose Job ® Repeat scheduling.
    To debug an active job, choose Job ® Capture: active job. Only a single selection is allowed. If an active job seems to be running incorrectly (e.g., running for an excessively long time), you can interrupt and analyze it in debugging mode in a background process, and then either release it again or stop it altogether.
    You will be able to capture a background job only if you are logged on to the SAP server on which the job is running. To find server information in the Job Overview, select and mark the job, then choose Job ® Job details.
    To review information about a job, choose Job ® Job details. Details displayed can include:
    current job status
    periodicity, or the repetition interval
    other jobs linked to the current job, either as previous or subsequent jobs
    defined job steps
    spool requests generated by the current job
    To cancel a job's "Released" status, select the job or jobs from the Job Overview list and choose Job ® Release -> Scheduled.
    To cancel a job from running but keep the job definition available, select the job or jobs from the Job Overview list and choose Job ® Cancel active job.
    To delete a job entirely, select the job or jobs from the Job Overview list and choose Job ® Delete. Jobs with the status of Ready or Running cannot be deleted.
    To compare the specifications of more than one job, select the jobs from the Job Overview list and choose Job ® Compare jobs.
    To check the status of jobs, select the job or jobs from the Overview Job list and choose Job ® Check status. This allows you to either change the job status back to Planned or cancel the job altogether. This is especially useful when a job has malfunctioned.
    To review job logs, select a job or jobs with the status Completed or Canceled from the Job Overview list and choose Goto ® Job log.
    To release a job so it can run, select a job from the Job Overview list and choose Goto ® Release.
    Regards,
    Jagadish

  • Error in triggering background job

    HI, I've been facing an error which a background job is being scheduled. The scenario is something like this ...
    1) A third party schedulling system triggers a SAP job and monitors the progress
    2) In SAP, the master job is been copied with a different user name and then released for processing.
    3) There are multiple jobs which get triggered but there is one job which is causing a problem.
    4) The job makes a copy an stays in a scheduled status without getting released. While i try to manually release the job it give me an error that cannot create record in the database.
    5) Upon checking the system log it gives me this -  Error: INSERT background sched. table(job $$$$).
    There is already an entry for the specified job in the table TBTCS.
    6) While checking the TBTCS table i've found multiple entries out there. Should this table be empty or have information about the runtime of this job.
    Please help as this background job is causing concerns in archiving processess defined.
    Thankx in advance for your help.
    Arvind.

    the earlier problem of background job was solved by changing the  output device assigned to user wf-batch .
    regarding the transport request :
    when i was trying to execute the step : "Schedule bakgrd for missed deadlines " MANUEL it was giving me an option of SAVE AND SCHEDULE . which was creating the transport request . but when i executed it automatically it worked fine without asking a request to me ... i don't know why )-: ... probablly we can specify a different interval then the standard of three minutes and which will be transported (it's just a guess) . i have  executed it  automatically ...
    well thanks all for u r help

  • How to submit a batch compare job using a unix script and cron?

    I understand I can setup a unix script to be used to schedule a database compare job. I'm not sure how to get past the popup log in window tho... When I use the command line and include the -id<myid> the OMS login window pops up requesting login password and service. This won't do if I do not want to run this interactive. I cannot find any syntax for the command line other than --id<adminid>  How to I include the password and service?
    Thanks ;)
    Laurie

    I had the same problem.
    My shell looks like (baseline_ELITE.sh):
    ocm login -idsysman
    ocm capture -l BL_ELITE -idsysman
    I don't have the ocm logout.
    First, run the baseline_ELITE.sh, it will ask you about the password. The next times, it never ask again for the password, but take in account don't use the ocm logout.
    Humberto Gomez
    OCP Dev2k, 8i, 9i
    [email protected]

  • Run Crystal Reports in background on event from asp

    How would I run a Crystal Report file in the background after an onClick event from an ASP web page?
    Are there any code samples of how this can be configured?
    I have Crystal Reports Server 2008 and Crystal Reports 2008.

    See if the solution in [this|Re: CR2010 Production Release; thread will help.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • How to invoke from UNIX script and pass back return code?

    Though I am an experienced developer, I am new to java. I created a class containing a single method. I have performed my testing by running the class class.method from the command line in a UNIX (Solaris) environment. Now, I would like to have the class.method invoked from a UNIX shell script, and to return a success/failure indicator from the method, to the UNIX script. I modified the method to make it return char, rather than being defined as void. Within the class and method, I declared and initialized a char variable. I added a finally clause which contains a single return statement, returning the char return code variable. Within my UNIX script, I invoke the class/method as follows:
    return_code = java myClass
    This does not seem to be invoking the method however. Can someone please tell me what I am doing wrong? Or is more information needed in order for someone to help me out.
    Please let me know.
    Thanks.
    Brad

    stdunbar,
    Using your suggestion of System.exit(retVal); seems to allow the java method to be performed successfully (Thank You). But I am still having a problem with the value being recognized by the shell script.
    In my script, I'm doing the following:
    java MyClass inputparameter > return_code
    export return_code
    echo $return_code
    But return_code does not seem to contain a value. Just before the System.exit(retVal); I added System.out.println("return code = " + retVal ); and I can see that retVal. When I run the java method outside of the UNIX shell script, I can see that retVal does indeed contain a value. So I think my problem might actually be the code in the UNIX script.
    Thanks again.
    Brad

  • Calling maxl from unix script

    Hi guys..I want to call a maxl script from a unix script. i am using ksh shell in unix..
    Can anyone give me the syntax from this..I am not very familiar with this.

    Actually I found there was an Esscmd.sh file too.that's why wanted to be sure about the option of esscmd.
    And would these scripts accept parameters like this:
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script.mxl 1 2
    and if we place & after the script name would it be a nohup process and run the next ones parallely??:
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script1.mxl &
    <path>Middleware/user_projects/epmsystem1/EssbaseServer/essbaseserver1/bin/startMaxl.sh /maxl-Path/script2.mxl &
    Sorry if my questions seem stupid.
    I know very little about this tech and just want to clear any confusion and know as much as i can.

  • E-Mailing Background Job Log from SM36

    Friends,
    Is there a way that you can set up automatic emailing of the log from a periodic background job set in SM36? I want this log to be sent to few external E-mail IDs.
    Let me know.
    Thanks
    Jagadish

    Dear Jagadish,
    In my previous project we have achieved the same requirement,like sending the mail to particular User Id's
    for a background run job.
    Check with these steps,
    Go to T code S023 > create>enter some name and Title->Folder ->private or shared one>Save->
    back button->select name & change then recipient name mail address-->recipient type --->internet
    address and then save.
    In SM36 before scheduling the job click on spool list recipient and assign the one which you have
    created,then you schedule the job ,give some job name and then save.
    Before doing the above steps ask your BASIS consultant whether sending mails is active,the same can be
    checked in T code SCOT.
    Check and revert back whether you are successfful or not.
    Regards
    Mangalraj.S

  • Raise alert from Unix script

    Hi,
    I have a scenario where my post processing Unix script would append 5 individual files to create a master output file. If everything works fine, well and good. In case of any error - XI has to raise an alert to the support team. Could you please let me know how this can be done. I assume that the Unix script should be coded such a way so that it raises an alert if something fails in its processing logic. Could you please let me know how to do this? Any sample Unix script would also be highly appreciated.
    Thanks in Advance,
    Santhosh

    Hi Prateek,
    Many thanks for yor response. I was also thinking on this approach - but i didn't want to add on another file based interface to the existing set of all file based (all this problem is coz of this file based integration) interfaces. This would be my last option.
    is there any other way to directly trigger an alert thru unix command prompt?
    Btw :- Many thanks for your reference to the blog.
    Regards,
    Santhosh M.

  • Tcl proc with input argument run from UNIX script...how

    Environment:
    OWB 10g Client on Windows XP Professional
    Repository - 9.2.0.4 on UNIX (AIX 5.2)
    Target - 9.2.0.4 on UNIX (AIX 5.2)
    I need a little tcl advice, please!
    I have a tcl script (proc, I guess) that takes one argument, in this case a mapping name.
    I would like to execute this tcl script from a UNIX shell script and pass the name of the mapping as an argument to the UNIX shell script. Something like:
    OMBPlus.sh omb_deploy.tcl $1
    where omb_deploy.tcl is the script that has all the OMBPlus commands in it to create the deployment plan and execute it.
    I'd like to pass the mapping name as a command line argument to the UNIX shell script but it doesn't like it.
    When I execute the script as above, I don't see any output and the mapping does not get deployed.
    So, I need a little help on two (2) issues:
    1- How do I generate a log file of the output of the tcl script?
    2- How do I pass the mapping name as an argument to the UNIX shell script?
    For #1 I have tried using the 'open logfilename w' at the top of the tcl script but it produces no output.
    I saw another example from this forum where the author used a 'putslog' command in the script. I can't find any documentation on that command, what does it do?
    That same script set a global OMBLOG variable at the top of the script and used the 'putslog' command in the body.
    Is OMBLOG some special reserved word for logging? I couldn't find anything on it.
    I'm trying to learn tcl but struggling to put all the tcl stuff together with all the OMBPlus stuff and make it all work is getting the best of me.
    Any assistance, with examples (I learn best from them), is greatly appreciated.
    Gary

    Well duh!
    I ended up just logging everything from the UNIX shell script and letting the tcl script write everything to stdout.
    I also finally found the $argv parameter and have used that to pick up the name of the mapping being passed to OMBPlus.
    It seems to be working so far.
    Gary

  • How to fire an event from Java Script

    Hi,
    Here is my problem: using JSF
    I have a selectOneMenu list box when a value changes a valueChangeListner event is fire that all works great now the problem I'm able to add items to the list from a popup form using Java Script but I need the valueChangeListner to fireup every time I add a item any ideas how to do that
    Thanks

    Just do form.submit().

  • How to capture events from vbs script in java

    Hello all
    i have vbs script that executing some actions after its done running or after its fails the vbs script
    returns string , my question is how can i execute this script but also capture in java the returned string from the vbs script
    Thanks

    Hello
    nop im talking about java here is what i got untill now .. ( not working )
    for example say i have vbscript that do only that :
    myVbs.vbs :
    set WshShell = WScript.CreateObject("WScript.Shell")
    WScript.Echo "Hello World!" and i like to capture this "Hello World!" string in my java code how can it be done?
    this is my java code , but its does not working ..
    public class ExcVbs {
         public static void main(String args[]) throws InterruptedException{
              Process p = null;
              try {
                   p = Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler myVbs.vbs" );
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              p.waitFor();
              OutputStream pus = p.getOutputStream();
              System.out.println(pus.toString());
              System.out.println( "Code=" + p.exitValue() );
    }

Maybe you are looking for

  • Mobile me: problem syncing/ computer idenity issue?/ ical

    hi, so about 2 months or go my computer (a macbook pro 2.8 ghz) would tell me that the password for mobile me was incorrect, when it wasn't. i could keep getting mail (my .me account) but the sync system kept telling me the password was not correct.

  • "Sort by site" is not working in the history bar

    The other "sort by" options in the history bar are working fine. Each time I change it, the list of websites gets re-sorted. Except for Sort by site, which isn't doing anything. Is there a fix for this problem?

  • Vendors total sales by gjahr.

    after a selection in bsik and bsak, bsek etc... into the tb_out i collect into tb_col the total amount for each lifnr. now i want to collect the total amount by gjahr . how can i change my code, please? LOOP AT tb_out.         CLEAR  tb_col.        

  • Customer Loyalty Call

    So, I finally answered a call from an 866 number I didn't recognize and found that it was from the "Verizon Wireless Customer Loyalty" department where they were trying to get me to agree to leave my unlimited data plan and go to another plan.  She s

  • Iphoto 11 no longer creates events or list newly imported photos...

    iPhoto 11 seems extremely buggy. I think I'm going to downgrade back to the prior version. Anyone have suggestions before I take this action? Problems: 1) When ever I import new photos they no longer show up in new events or the "photos" grouping of