SAP XI: How To Write Shell Script And use it in File Adapter On XI Server

Hi,
I want to split file at sender side in XI using Shell Script and then after i want to do
Mapping.
Can anyone tell me what exactly it means "write a script in UNIX shell on XI SERVER"?
Regards,
Akshay.

Hi,
You can execute a Unix script running in the XI server from the File communication channel. Ie. if you want to do something which was not part of XI adapter configuation , then you can make use of external unix script and you can execute those from the XI.
For this, write a unix script and place in the XI OS level provided that path is accessible from PI Channel.
E.g
So u can use this in either Sender Channel to modify the data before it reaches into the Integration Server or in Receiver channel it is generally used to transfer the files into different location via Secure FTP
SAP help: http://help.sap.com/saphelp_nw2004s/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Blog:/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
XI  can be in any OS.
Hope this helps,
Rgds,
Moorthy

Similar Messages

  • Shell Script not getting invoked in File adapter

    Hi all,
    Requirement:
    PI need to pick the file from source directory and send it to target directory using SFTP.
    I'm using SCP command for this purpose.
    When I run the shell script (with simple SCP command) from command prompt, script is working fine.
    Same script is called from PI File adapter but script is not getting invoked.
    In the communication channel logs, "Executed OS command" is available. There are no Error/Warning messages in the log.
    NFS transport protocol is used in the File communication channel.
    Complete directory path of the shell script is mentioned in File channel -> Run Operating System command after message processing.
    Even the following simple command is not working from PI receiver file channel:
    echo "Test file" >> /data/test.txt
    Please let me know if I'm missing out something.
    Thanks,
    Geetha

    Hi Geetha,
    I think the syntax u are using is not correct. Please follow the below syntax:
    /path/<script_name> %F
    for ex: /staging/Interface/XI/Script/FTPData %F
    use the above in the communication channel.
    %F should be after a space.
    FTPData is the script name
    /staging/Interface/XI/Script/ is the location where the script is present
    Cheers,
    Souvik
    Edited by: Souvik Chatterjee on Apr 14, 2011 3:38 PM

  • How to write an array and a scalar to file?

    I would like to write my data to a file but am having trouble approaching the problem. In the file I would like to write both the x and y values of my data points in two columns, however, the y data is in an array and the x data is made up of 3 pieces of information: an initial x, an x incremented value, and the number of points in my data sample. How could I go about this?
    Solved!
    Go to Solution.

    The number of points is redundant, because it will be the same as the "other" array.
    Here's what I usually do:
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ramper.png ‏13 KB

  • Date and Time in Sender File Adapter Target Directory

    Hi there,
    is there a way of using Date and Time from XI to the Target Directory naming? To use variable substitution some fields of the message had to contain that date and time information, which is not our case.
    For filename you can use "add time stamp" option, but and for target directory?
    Thanks and regards,
    Henrique.

    > <i>Do you have further information on how to perform
    > this with shell commands?</i>
    > >> You need to write a shell script. This script will
    > add the date/time stamp into the folder in the target
    > system. This shell script is executed from the File
    > adapter. So once the file is written into the target
    > directory, then it will rename the directory.
    Hi there, Moorthy
    We've tried to write that shell script that you mentioned, but now we have a few doubts on how to make it create the proper directory.
    In the file adapter, my target directory is "/%var1%/%var2%/", where %var1% and %var2% are variable substitutions, referencing data which comes from the payload. Now, I need the shell script to append "/<Year>/<Month>/" in the target directory. But where to archive the script? If it stays in the root directory, than how to make it create "/<Year>/<Month>/" folders inside a directory which is variable (/%var1%/%var2%/)?
    Is there a way of passing %var1% and %var2% as parameters for the shell script?
    Thanks a lot,
    Henrique.

  • I am new in indesign scripting, please tell me how to write a script to get  content of a element in xml and then sort all the content

    I am new in indesign scripting, please tell me how to write a script to get  content of a element in xml and then sort all the content

    Hi,
    May the below code is useful for you, but I dont know how to sort.
    Edit the tag as per your job request.
    alert(app.activeDocument.xmlElements[0].contents)
    //Second alert
    var xe = app.activeDocument.xmlElements[0].evaluateXPathExpression("//marginalnote");
    alert(xe.length)
    for(i=0; i<xe.length; i++)
        alert(xe[i].texts[0].contents)
    Regards
    Siraj

  • How to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also

    032ee1bf-8007-4d76-930e-f77ec0dc7e54 wrote:
    how to run 3 job(a,b,c) parallel in unix shells script and after will complete d will start  and we have to handle the error also
    Please don't overwhelm us with so many details!  
    Just off the top of my head ... as a general approach ... something like
    nohup proca
    nohup procb
    nohup procc
    while (some condition checking that all three procs are still running ... maybe a ps -ef |grep  )
    do
    sleep 2
    done
    procd
    But, we'd really need to know what it is you are really trying to accomplish, instead of your pre-conceived solution.

  • How do I locate someone who can write some scripts and plugins for Illustrator CC?

    How do I locate someone who can write some scripts and plugins for Illustrator CC?

    I just wanted to add a screen shot of the dialog showing the sound in question.

  • Shell script blog -OR- Give me tips on how to write better scripts!

    Hi folks,
    I don't write a lot of shell scripts, and the ones that I do write are usually quite short, so as a learning exercise I made a shell/CGI blog script.. And I was hoping that some of the shell scripting experts in the community could give me some pointers on form, style, etc! The script works just fine, but maybe I haven't coded it very elegantly. Or maybe in some places I haven't necessarily used the right (or most appropriate?) commands to accomplish what I want.
    It's a simple blog. It can either:
    - Display a blog post (by default the newest, unless the name of a post is given)
    - Display a listing of posts for a certain tag
    Posts are saved in normal files in markdown format. Tagging is accomplished by putting the name of the tag(s) into the filename, separated by hyphens. For example: the file "wonderful_blog_post-whining-computers-archlinux.md" would be a post named "wonderful blog post", and it would have three tags ("whining", "computers", "archlinux"). Maybe it's not the best idea in the world... but I went with it anyhow
    I put the script on pastebin for you all to see: http://pastebin.com/L8nMpUjT
    Please do take a look and let me know if I've done something badly! Hopefully I can learn a thing or two from your comments.
    And there's a working example of it here: http://www.ynnhoj.net/thedump/s.cgi

    falconindy wrote:
    To sort files by modification time (safely) requires GNU stat and some bash:
    declare -a files
    while IFS=$'\t' read -r -d '' ts file; do
    files+=("$file")
    done < <(stat --printf '%Y\t%n\0' * | sort -zn)
    printf "%s\n" "${files[@]}"
    The array is of course unnecessary as you could print inside the loop, but I see no way around the usage of null delimiters and bashisms (read's -d flag in particular) to be 100% safe.
    Thanks for the example, though I'm trying to avoid bash and write my script in posix shell. So after some tinkering, this is what I've come up with to make a simple list of blog post file names:
    #!/bin/sh
    cd posts
    while IFS=$'\t' read -r ts file; do
    ALLPOSTS="$ALLPOSTS $file"
    done << EOF
    $(stat --printf '%Y\t%n\n' *.md | sort -rn)
    EOF
    echo $ALLPOSTS
    So I suppose that it isn't 100% safe - but could it be acceptable? Is there anything else I could do?
    Edit: as it turns out, my server is running some flavour of BSD, I think FreeBSD. So the above examples don't work with FreeBSD's stat. Ah well..
    Last edited by upsidaisium (2011-02-23 08:26:29)

  • How to call shell scripts

    Hi,
    Please let me know how to call shell scripts from WDA
    Thanks
    Bala Duvvuri

    Hi Bala
    You can not call any client side funcitons using Web Dynpro ABAP, it is possible in BSP using JavaScript.
    You can use Suspend and Resume Plugs to navigate to a BSP page and perform the shell script and return to WDA using Resume Plug.
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/19bf8c16f25d7ae10000000a11466f/frameset.htm
    Now, you can use JavaScript to execute shell script:
    http://www.itjungle.com/mpo/mpo052302-story01.html
    Abhi

  • Passing params from SQL file to Shell Script and then from Shell to SQL Fil

    Afternoon guys,
    Have a fun question for all you gurus in shell scripting out there. I have a shell script that is calling 2
    different SQL programs. My objective is to pass a variable called request_number from one sql program
    to the shell script and then from the shell script back to another SQL program. I will explain why I
    need this to happen.
    Here is what the shell script looks like which calls sql programs student_load_a.sql and
    student_load_b.sql. Student_load_a.sql basically creates the control file (.ctl) which is needed for the
    SQL*Loader and then student_load_b.sql reads the table that was just loaded and does the main
    processing. My main objective here is to be passing the request_number which is being generated
    using an Oracle Sequence in student_load_a.sql and using this generated number in my main
    processing in student_load_b.sql to select records from the table based on request_number.
    Any ideas ?Any help or recommendations is welcome and appreciated.
    *1. Shell Script*
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id
    exit_status=$?
    # Do sqlloads
    sdesqlldr.exe userid=$p_user_id control=student_load-$p_job_id.ctl \
                                                 log=student_load-$p_job_id.log \
                                                 bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id
    exit_status=$?
    exit 0*2. student_load_a.sql (Would like to pass back the Sequence Number back to shell script and then use in student_load_b.sql*
    -- Accept system input parameters
    define p_job_id = &1
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ' || '''' || request_number_seq.nextval || ''',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    *3. student_load_b.sql (This is a big file so I am only adding code that is relevant for the SQL)*
    {code}
    declare
      v_request_number    number(6);
      v_student_id                  number(7);
      cursor cur_student_load is
        select  student_id
        from   TMP_STUDENT_LOAD
        where  request_number = v_request_number
        order by 1;
    begin
        v_user_id := '&1';
        v_job_id := &2;
        -- This is the variable I would like to be be passing from shell script to student_load_b.sql
        -- v_request_number = '&3';
         open  cur_student_load;
         fetch cur_student_load into v_student_id;
          exit when cur_student_load%notfound;
          .... more logic of if then else in here
         close cur_student_load;
    end;
    {code}
    Edited by: RDonASnowyDay on Jan 29, 2010 4:03 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How come you are mixing WinDoze script (*.exe) with Unix?
    You are aware that you will be passing the password along with the user id to the second sql script?
    I will assume Unix ksh:
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    p_seqno=`sqlplus -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id`
    exit_status=$?
    # Do sqlloads
    sqlldr userid=$p_user_id control=student_load-$p_job_id.ctl \
           log=student_load-$p_job_id.log \
           bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql \
               $p_user_id $p_job_id $p_seqno
    exit_status=$?
    exit 0And the first sql script would look like this:
    -- student_load_a.sql
    -- Accept system input parameters
    set echo off pages 0 feed off lin 80 trims on ver off
    def p_job_id = &1
    col seqno NEW_VALUE seqno
    select request_number_seq.nextval seqno from dual;
    set term off
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ''&&seqno'',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    :p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to write Java Scripts in Apex

    Hi All,
    Can any on tell me how to write Java Scripts in Apex.
    Thanks in Advance,
    Mukund

    If you want to link your custom JavaScripts to an Apex page, you have several options:
    1. Add an HTML Region on Page 0 (Script will be written to every page) called something like "JavaScript & CSS". In this region add your Script to the region source like this:
    <script language="JavaScript">
    function hell ()
    alert ("Hello World");
    </script>
    2. Add a similar region to the page you are working on (can only be accessed on this page)
    3. Create an external JavaScript file and either load it into the WORKSPACE or into the images (/i/) directory on the server. You can then link the JS into you page via modifying the Page Template.
    Hope that makes sense. Let me know if you want any further help with option 3.
    Duncs

  • Need help with shell scripting and Patching

    Hello all,
    I am a very new Oracle DBA and I just have an interview where i have been ask two questions that i have no idea of what it is
    1/ What is shell scripting and how do you do shell scripting?
    2/ What is Patching and how do you do patching?
    Can some one help to have a very good understanding of these tow questions?
    Thanks a lot

    1/ What is shell scripting and how do you do shell scripting?shell accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , the you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is know as shell script.
    Shell script defined as:
    "Shell Script is series of command written in plain text file. Shell script is just like batch file in MS-DOS
    for example:- for taking backup, health check and doing some task Operating system level or Oracle database level we can create shell script and schedule a cron job
    2/ What is Patching and how do you do patching?for example ,in windows while using sometimes you might face an issue/error and it gives pop up error message would like to send/report this error to microsoft? microsoft will send you a fix for that. lot of fixes for errors/bugs are released as patches.( n number of patches with newer features are releases as new version)
    likewise in oracle for resolving bugs we should have to apply patch.
    patch is basically a fix for a bug/bugs. we need to use opatch utility to apply the paches.
    hope, this helps you

  • I am a teacher of mathematics and i have a windows pc, but i want to do the next step. I want to buy an iMac. I want to learn how to write mathematical equations and how to do geometrical schema in my documents with iMac. Help me please!!! Thank you very

    I am a teacher of mathematics and i have a windows pc, but i want to do the next step. I want to buy an iMac. I want to learn how to write mathematical equations and how to do geometrical schema in my documents with iMac. Help me please!!! Thank you very much!!!

    Bonjour VAGRAI
    1) To write math expressions in a text :
         — Microsoft Office 2011 etc. for Mac use its included Equation Editor.
         — OpenOffice.org (OOo) and NeoOffice : download free Dmath 3.3.
         — iWork (Pages, Numbers, Keynote), download free MathType 6.7, fully functional for 30 days, then becomes « Lite » for life as good as the Microsoft equation editor ; it’s better than using Grapher’s equation editor (Applications > Utilities) because MathType can be called from Pages and allows editing equations by clicking the math expressions your text (details on MathType website) .
         — Graph.app 2.3 in Mountain Lion is built to draw curves and surfaces from equations, so it uses an equation editor less powerful than mathType, but it’s easier typing expressions. You may get 2D 3D geometrical drawings from clever equations. Suggest a glance at   http://y.barois.free.fr/grapher/  to know all about Grapher (83 pages Instructions for Use - Grapher) and some examples
      2) Geometrical schema :
         — GeoGebra is very popular and used by math teachers.
         — Google SketchUp 8 was not built for mathematics but for architecture, but it’s very easy using it to draw 2D 3D surfaces and solid figures.
         — ShapeOnYou.app allows simples geometrical figures  http://pierre.chachatelier.fr/programmation/shapeonyou_en.php
    3) Some useful websites for screen shots of geometrical schema :
         http://www.mathcurve.com/
         http://perso.orange.fr/roger.assouly/
    Drawings files PDF, TIFF, JPG … can be inserted in an iWork window (Pages).
    I hate LaTex : not necessary to write math books !  
    Au revoir VAGRAI,
    YB24
    Attachment : lines and curves were made with Google SketchUp 8, screen copied (Command-Shift-4), inserted on a Pages sheet to add letters figures rectangles title.
    SketchUp allows drawing precisely an arc of circle 325 mm radius 22,5° angle for instance. 

  • Shell script for oracle alert.log file

    Hi Gurus,
    I wanted to write shell script to know the last 10 shutdown timings of the database from alert log file. I'm working on oracle 9i.
    Could anyone please advice on this.
    Thanks in advance
    regards,
    Shaan
    Edited by: Shaan_dmp on Jan 5, 2009 1:27 PM
    Edited by: Shaan_dmp on Jan 5, 2009 1:28 PM

    Use awk. I don't have a 9i to hand but here is a very simple version for 10g XE
    My awk file (the line numbers are for the notes below - don't include them:
    01:BEGIN { prevline = "";}
    02:
    03:/Completed: alter database close/ {print prevline,FS,$0;}
    04:
    05:{prevline = $0;}The command line and results (from my 300k alert log)
    $ awk -f alert.awk.txt alert_xe.log
    Fri Apr 11 18:08:40 2008   Completed: alter database close normal
    Fri May 16 18:53:21 2008   Completed: alter database close normal
    Tue May 20 17:28:23 2008   Completed: alter database close normal
    Thu Jul 17 19:08:52 2008   Completed: alter database close normal
    Fri Aug 15 15:12:48 2008   Completed: alter database close normal
    Wed Nov 05 08:52:59 2008   Completed: alter database close normal
    Fri Nov 14 16:36:03 2008   Completed: alter database close normal
    Tue Dec 09 10:46:23 2008   Completed: alter database close normal
    Mon Jan 05 11:12:22 2009   Completed: alter database close normalWhat it means:
    1) the BEGIN section at line 01 defines the variable to hold the previous line
    2) the /search string/ at line 03 finds the marker in the file for a shutdown, then does the required action (print the time which was in the previous line, and then this line; use FS (the awk field separator - normally space) as a separator
    3) at line 05 is an instruction we do on every line - so we remember it in case it is the timestamp for the shutdown.
    Now, you can include more of the corner cases for shutdowns by adding more search patterns etc. For more information, google for awk examples.
    Awk is really good at this sort of thing!
    HTH
    Regards Nigel

  • How to write data on to a location other than desktop or application server

    Hi all,
            I already posted this question.But  i didn't get exact answer
    Can anyone explain that how to write data on to a share drive located on other Nonsap server.Please I dont want to FTP the file.I dont want that solution.I need to write directly on to that Nonsap share drive..
    Thanks,
    Balaji

    I guess the only way is sending the file using a XI connection to the non sap system server,generate RFC adapters, inbound, outbound interfaces, using xml or soap or IDOC to move the file to that system.

Maybe you are looking for

  • What's wrong with Netscape4.7 or something else?

    Hi all, in my application, i used some code to launch browser(in Solaris): String browser= "netscape"; String url = "";// which passed from the GUI Process process = Runtime.getRuntime().exec("netscape -remote 'openURL(url)'") int exitCode = process.

  • Default Parameters in Crystal Report

    Hi all visitors I have created one crystal report and now i want to set the parameters to my report by using parameters in Crystal Report(  the parameters not from sql).My parameters are datetime datatype. in my report, i create one formula( get date

  • Different delivery address in PO

    Dear Sirs,           We have rented a warehouse outside our plant premises for storage of goods. when we are raising PO we want to indicate the delivery address of our storage location not that of our plant. we want to indicate in the PO that PO is r

  • Creating Playlist On Zen Micro - Adds Entire Album, Not Selected S

    I'm attempting to create a playlist while in my Zen Micro. I have a song playing and go to the song and select "Save as Playlist", and I assign it a name. When I go look at the playlist it has included the entire album in the playlist, not just the s

  • Copy keywords into title field, keep in keywords field

    I have this script that works in cs5, but it is not working in CS6- I am going to try to modify it to copy the keywords into the title field, but also drop the ";" and replace with a "," First, I can't get CS6 to run this code, though. Where is it wr