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.

Similar Messages

  • 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

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

  • 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

  • Raising Alerts from BI

    Hi All,
    I want to raise two alerts from BI7, will you please let me know the step by step process of how to do this.
    Thanks in Advance,
    Radhika

    You can check if Pc has alert or not from
    Rspc> Processchain>attributes--? alert
    If alert check box is on ,your pc has alert
    Make sure you have sufficient authorization to do it.
    Anyway will give you step by step procdure for it
    You can send messages to an application process of the chain, depending on the success or failure of the process.
    1. To do this, using the context menu for a process, create another process variant of type Send Message.
    2. If you maintain a message, first specify whether you want the message to be sent when the process has been completed successfully or unsuccessfully. Then choose Next.
    3. A dialog box appears, in which you can select an existing process variant or create a new one.
    4. If you create a new process variant, edit the document that is going to be sent and maintain a list of recipients.
    5. Save your process variant and go back.
    The message process variant is now assigned to your application process. When the message is sent, the status information and the process log are also sent.
    Note, you must configure SAPconnect in order to ensure that your system can send email - use transaction SCOT if this has not been configured.
    It's set as a property for an individual process in the chain. You would have to set on each process where you want notification.
    One technique you might consider, is that tou can create a "meta-chain" made up of local chains, and you can set a message on each of the "local chain" processes in the meta-chain
    Also go through these links
    How to Trigger an Alert from a Process Chain (NW7.0)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0f4e952-e46e-2910-1f9e-cae187cd16d1
    SAP Network Blog: Information Broadcaster Triggered by a Process Chain
    Information Broadcaster Triggered by a Process Chain
    Hope it helps you,Revert me back if you have any queries
    Regards
    Bala

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

  • How to Raise Alerts from the fields of Mapping?

    HI,
    We had a very typical requirement for our client.
    Scenarios is IDOC to multiple files else consider a simple file to file scenario.
    Source structure contains some 5 fields and the target also remains the same 5 fields.
    Assume SERNO presents in both structures.
    The issue here is i need to check for a Target SERNO field  should accept only numerical value, there is a possibilty of coming alphanumeric and sometimes with specialcharacter appended  numeric. i have developed a udf which allows only numeric.
    The mapping is getting failed if alphanumeric or special character exists in that field.
    But, the client requires an alert mentioning that this mapping is failed due to the problem in Source SERNO field so that he can easily debug and resubmit those idocs.
    I want to know is it possible to raise alerts at field levels.
    Thanks,
    --Kishore

    Hi Raja,
    This is a new development and we dont hve any Alert framework right now exist, i believe even the alert category its not possibel to drill down to the field level.
    if its possible could you please elaborate.
    We have many fileds to check as similarly defined above example SERNO, so if the alerts are triggered @ filed level that are failed that will be a great..
    My Ultimate requirement is to notify client that due to this field the mapping was occured and alert should throw some light on to locate the error at the field level.
    Please suggest how to procced..
    Thanks,
    --Kishore

  • 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

  • Calling sqlplus from unix script

    hello,
    I am trying to connect to sqlplus from shell:
    #!/bin/bash
    SERVER_NAME=ORA1
    sqlplus -s SYS/PASSWD@$SERVER_NAME AS SYSDBA <<EOF
    select * from v\$version
    EOF
    However, the output is:
    Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
    where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
    <logon> ::= <username>[<password>][@<connect_string>] | / | /NOLOG
    <start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
    "-H" displays the SQL*Plus version banner and usage syntax
    "-V" displays the SQL*Plus version banner
    "-L" attempts log on just once
    "-M <o>" uses HTML markup options <o>
    "-R <n>" uses restricted mode <n>
    "-S" uses silent mode
    Do you have any idea about that?
    Thanks.

    the connection was establised. thanks.
    any idea why I am getting the same output twice for the following statement?
    #!/bin/bash
    ORACLE_SID=ORA1
    export ORACLE_SID
    sqlplus -s SYS/PASSWD@$ORACLE_SID AS SYSDBA <<EOF
    select SUM(bytes) from dba_data_files where tablespace_name = 'tts1';
    EOF
    the output is
    SUM(BYTES)
    3.4773E+10
    SUM(BYTES)
    3.4773E+10

  • How to Raise alert in XI when a new file reaches application server

    Hey guys
    i have a requirement in which i need to trigger a piece of  ABAP code whenever a new file reaches a specific directory of Application server.
    i m using File adapter on receiver side and i want to raise a trigger so that the ABAP code is executed automatically whenever some new file reaches the directory
    we are running Win server
    thanx
    ahmad
    Message was edited by:
            Ahmad

    HI,
    It is possible to write a ABAP program to raise alert.and schedule it , In ABAP program we can check the file is existed or not in a specified folder if existes then we can raise Alert.Actually Alerts are maintained by SAP Alert Management only.
    So , but not clear , you said you are using the File receiver adapter .
    -- onoption is -this can bepossible with OS command .
    -- also we can raise alert from Payload itself , why becz i understand whenever you are going to write a file with file adapter then you need to raise an alert right?
    so if message is existed i mean data existed then from raise alert and store the file onoption
    -- Also you can try calling an ABAP program as the auto-reaction method of the MTE in CCMS
    Regards
    Chilla
    See the below links
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/434fa590-0201-0010-1e9a-c27e6283a0fe
    SMS through SAP ABAP program
    XI Alert from BPM with Follow-Up Activity
    ABAP programming BAPI To XML
    How to send qRFC Alert to Internet Email from AP0 3.1 running 4.6D BASIS
    /people/gregor.wolf3/blog/2005/03/05/create-users-in-an-abap-system-with-bapi-ostermiler-java-utilities

  • Unix Script for calling oracle packges.

    Hi All,
    I would like to know how to call packages(pro,fun) with parametrs from unix script.
    Can anybody provide me the sample code.
    thanks in advance.
    Dinesh

    This topic has been covered a few times in the past.
    Here are two threads that a quick search found:
    Execute stored procedure from script
    how to call shell script from pl/sql procedure.
    There are several other threads that may be of interest.
    HTH -- Mark D Powell --

  • Call a unix script from pl/sql package

    Hi,
    Using 11.2.0.3 on AIX.
    Is it possible to call unix script from pl/sql package?
    I am cretaing a file in a directory but would like this to automatically be written to an archive directory as well.
    Could either use 2 utl_file.put_lines to 2 separate directories or 1 utl_file and cal script to archive file in another directory.?
    Thoughts?
    Thanks

    user5716448 wrote:
    What am I doing wrong?think how file name will look like:
    SQL> select 'file_name' || to_char(sysdate,'DD/MM/YYYY HH24:MI:SS') from dual;
    'FILE_NAME'||TO_CHAR(SYSDATE
    file_name15/08/2012 11:47:51Will AIX swallow such name? Obviously not. And, unfortunately, UTL_FILE.FCOPY doesn't raise an error in such case. So use someting like:
    UTL_FILE.FCOPY ('SOURCE_DIR',v_FILE_NAME,'DEST_DIR',v_file_name||to_char(sysdate,'DD_MM_YYYY_HH24_MI_SS'));SY.

  • Executing Unix scripts from a stored procedure

    From the sql*plus windows, I am able to execute the host command and '!sh' commands; but I need to ececute Unix scripts from a stored procedure. Hoe can I do this? Where can I get good documentation on this? Any help would be greatly appreciated!
    Thanks..

    Hi,
    U can use external procedure ( newly added feature in 8.0.3 onwards) and call any shared library. From shared library u can execute it.
    One sql command is there HOST(' '). U can run a OS command. But u can not use it in PL/SQL.
    U can call pls sql from shell !!!!!..
    Thanks...
    Boby Jose

  • Calling a report from unix shell script

    Hi,
    I had to call a report from unix shell script.
    May i know the procedure to accomplish this
    Thanks in Advance
    A.Gopal

    First you should not include the whole path to your report in the call ...
    Use like this:
    /ora/u01/oracle/v101/as2/bin/rwrun.sh report=an_stati destype=file desname=/ora/u01/oracle/v101/as2/test.pdf desformat=pdf
    In $ORACLE_HOME/bin/reports.sh:
    1) Verify that you have updated the REPORTS_PATH variable to include your folder where you have the report in question
    REPORTS_PATH=/ora/u20/app/qits/env1/run:$ORACLE_HOME/reports/templates:$ORACLE_HOME/reports/samples/demo: ....
    2) Verify that the REPORTS_TMP variable is pointing to a valid location and that the oracle user has access to write on it.
    After that, post the content of the tracefile located at $ORACLE_HOME/reports/logs/{in-process report server name folder}/rwserver.trc
    If no file is present then it means that you need to enable trace in your reports's conf file.... go to the $ORACLE_HOME/reports/conf folder and and locate the .conf file that correspond to your in-process reports server name (as specified in the rwservelet.properties file)... open/edit the file to enable trace logs ..
    i.e.
    Change the following line:
    <!--trace traceOpts="trace_all"/-->
    to <trace traceOpts="trace_all"/>
    Bounce the reports server and try to run the report again, this time the .trc file should be generated, post the content so that we can take a look.

  • Displaying an alert (Applescript or otherwise) from shell script?

    I have a point in a shell script where I'd like to put up an alert dialogue on a particular error condition. The script runs in the background and doesn't have a terminal window. I tried writing a little applescript that uses the applescript alert command and call it using osascript from my shell script, but it doesn't work. If I enter "osascript ~/myscript.scpt" in a terminal window, I get the error message "/Users/Ted/myscript.scpt: execution error:No user interaction allowed. (-1713)" (If I run myscript.scpt from the script editor it does what I want it to do.) Any ideas? I suppose I could have my shell script create a file in some folder and have my applescript be triggered as a folder action, but that seems pretty roundabout!

    Thanks -- I apologize for not doing a more thorough search! Yes, that comes very close to addressing my need, but I have run into one difficulty. If I run my shell script from the terminal (pasting it in) everything works fine. If I run it as a packaged app (with Platypus) everything works like it's supposed to, except that the alert applescript (it's just a one line script) briefly flashes the alert dialogue when it's supposed to and then dies, rather than waiting 10 seconds or until I click OK. I'll have to experiment and see if I can tell what's going on.

Maybe you are looking for

  • Does the Canon MD225 work on iMovie 09?

    The apple site does not specifically mentioned the MD225 is compatible with iMovie 09, but Canon video cameras have normally been pretty good with iMacs. The minute you mention iMacs to the guys at the video camera store they start to twitch... Thank

  • Printing checkboxes in SAP script

    Hi, I have a requirement where I need to print checkboxes for all the items displayed in SAP Script output. Is there any way to print checkboxes in the output document? Regards, Rajesh Bhogi

  • Using SAP Content Server for SAP E-Recruitment

    Hi SAP Experts, We are presently implementing SAP E-Recruitment using BSP services, We are successfully runnig with Whole E-recruitng cycle when we use SAP system DB as storgae for External Candidtes' Documents. But, Our Client wants to have SAP Cont

  • Improving persistent class performance with on-demand DB reads?

    Hi, Something that has been troubling me for some time is the data access design of persistent classes. A persistent class loads the ENTIRE data set when it is instantiated. To me this defeats one of the advantages of get/set methods. What I would li

  • Order of imported scanned photos

    I am trying to make an iPhoto slideshow using a mixture of digital photos and older photos scanned in. I had used numbers to order the original photos, but when I try to merge new photos into the album from a scanner, I tried to use decimal points to