Execution of remote script in File Adapter OS Command

Hello.
I'm having issues with a remote script placed on a file adapter which fails to execute in a clustered PI (Version 7.1), running on Windows 2008.
Our current setup is as follows.
- Machine A and Machine B make up a SAP PI Cluster node.
- Machine C is our network file share, used as a sandbox for receiving and sending files.
One given scenario would be having the Cluster picking up a file from a FTP folder (Machine D) and copying it over to a given location in Machine C. This is working without problems in the cluster environment.
Now, a very specific scenario requires that after copying the file (to folder INPUT), a given script shall be executed over the received file and decide which folder should that file be archived, TO_PROCESS or NO_PROCESS folders.
So, Outbound Channel is reading from the FTP, Inbound Channel stores in Machine C and has to run a script after message processing.
The problem here is that the script is stored also in Machine C, so placing the OS Command should refer to a shared path:
Example:
sap-machine-c.gca.ad.root\InboundFiles\INPUT
sap-machine-c.gca.ad.root\InboundFiles\TO_PROCESS
sap-machine-c.gca.ad.root\InboundFiles\NO_PROCESS
sap-machine-c.gca.ad.root\Scripts\procFile.bat
If I give the command of "
sap-machine-c.gca.ad.root\Scripts\procFile.bat %F" on the receiver channel, checking RWB, Communication channel says the command was executed with success but the file doesn't leave the INPUT folder.
The script is know to execute with success from both instances, I have logged into each one of them and executed with RFCUSER in SE38 w/transaction RSBDCOS0.
I have tried to replicate this issue, reducing even the procFile.bat script to just do an "echo" command but still doesn't work (RWB PI says it does).
It seems to me that executing scripts from remote shares is a no go? Does anyone have a previous experience dealing with these cases?
Thanks,
Romeu

Hi all.
After taking some hints from this thread, we have found out that the problem lied some where in the installation part of PI.
We've set up a basic script, local and not remote, and still the system would not execute that command.
The RWB logs showed successful processing but the Application Server logs were full of errors and stack traces regarding the execution of any command. A support note was raised with SAP support in order to trace these errors.
I'm therefore closing this question as the original question is not related with remote scripting.
Thanks all for your help.
Best regards,
Romeu

Similar Messages

  • File adapter OS command line - Calling a command remotely ??

    Hi,
    We have a scenario where in which receiver file adapter after putting a file on the FTP  , a subsequent XML loader needs to be called which would load data into the client legacy ERP system.
    There seems to be some idea about doing it through file adapter OS command line.
    The problem is the how to call this loader command remotely from our file adapter OS command line.
    Any help would be appreciated ???

    >> The problem is the how to call this loader command remotely from our file adapter OS command line.
    The below link might be helpful ...
    http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature

  • Passing mulitple parameters to unix shell script via File adapter

    Hi,
    I have the following usecase.
    I have a set of files A, B, C, D  etc in a directory dir.  I also have a EOT ( end of transaction file).
    I need to merge this file once the EOT file is present in XI application server (  using NFS with File adpter).
    I have a script which can take the following paramters:
    1. EOT file name
    2. File names for A,B,C,D
    3. Directory names.
    Is it possible to send muliple parameters to the unix script from the File adapter?
    please share any blogs which do so.
    Thanks in advance,
    Best Regards
    Abhishek

    Hi,
    You can always call script from file adapter using "OS command" functionality, pass additional parameter like you do in unix for existing script (exact command which you type on unix prompt).
    Adapter will simply pass your OS command to operating system, so from XI point of view nothing is changed and it is your script which should take care of parameters.
    Regards,
    Gourav

  • Shell Scripts with File adapter

    Hi Everyone,
    Can we use shell scripts in File Adapter of XI.
    If yes can someone give me the configuration and any helpful blogs or links.
    Helpful answers will be rewarded points.
    Thanks,
    Rupash K

    Hi,
    you can just call the script in the File Adapter, before or after XI processing step.
    Nevertheless, sometimes it behavior different between to call the script as to typ the command directly on the channel configuration.
    Here is the [SAP official document|http://help.sap.com/saphelp_nw04/helpdata/en/84/e8763c997fda50e10000000a11405a/frameset.htm], it is quite easy to use. Just call the script as if you want to call it on the shell, you have to aware about the path and placeholder which you may want to pass the it as parameter to your script.
    Here are some more links
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/sapXIFileAdapterOSCommandLine+Feature
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/morewiththeFileAdapter
    regards,
    Hai
    Edited by: Hai Long on Nov 14, 2008 5:30 PM

  • External OS command script in file adapter - return value check possible?

    Is it possible to check return value of external OS script execution which is called in the file adapter? We want to see the result in the adapter monitoring. The documentation says: "Message processing is independent of any errors that occur during the execution of a configured operating system command."

    Hi Sanjay ,
    Seems possible : Try this :
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Regards ,

  • Command Line Scripts in File Adapter

    Hi,
    In the file adapter, does the command line script support "PERL" Scripts.
    thanks.
    Krishnan

    YES It will support.
    For clarification check below one.
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    FTP channel - not processing files, coz one of the files is wrong,

  • Reg: UNIX shell script at File Adapter

    Hi all,
    I am doing a File to file scenario and using command line arguments in Sending file adapter. I am using UNIX shell script ".sh" file for executing the command.
    I gave the following path at "Run OS command before message processing" parameter:
    /temp/xidelivery/send/FILOSC004_shell.sh
    and this file contains following code:
    <b>#!/user/bin/sh cp /temp/xidelivery/send/FILOSC004_in.txt /temp/xidelivery/send/FILOSC004_input_copy4.txt</b>
    I put the source file, FILOSC004_in.txt and shell script files at the respective paths.
    If I give "cp" command directly in command line it is working fine. But I could not execute this with shell script. Can any body give me the reason where I gone wrong.
    Regards,
    Pavani.

    Hi,
    can you try this,
    bash /temp/xidelivery/send/FILOSC004_shell.sh
    let me know.
    hey you can check the blog below to catch the OS errors,
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Prasad Babu.
    Message was edited by:
            PrasadBabu Koribilli

  • Calling unix scripts in File Adapter

    All,
    we have a script recindicator.sh in the root of the unix server. This script take 1 parameter.
    In the File adapter - "Run Operatning System Command After Message Processing" - we put the following,
    recindicator.sh %f
    we see the adapter working, but we are not seeing the effects of the script which is supposed to create 2 different files.
    Can we run scripts in the "Run Operatning System Command After Message Processing" ? If yes, what is wrong with our configuration?
    When we run the script directly on the server, with the parameter - it is working. so no issue in the script.
    Thanks,

    Hi,
    Yes, the script is in XI server. we tried with %F also, it is not working.
    At what directory level is the command that we give in the configuration run? is it in the root? or some other SAP folder like - "/SAP/user/..."?
    Thanks.

  • PI Sender File Adapter OS Commands not working

    Hi Guys,
    I have very simple scenario. we are using PI 7.1 with EHP1 on HP hardware with JDK 1.5.2*.
    We are processing XML files through Sender File Adapter(NFS) to Idocs. We also need to move some pdf documents to target folders on the same box (basically Sender and Receiver files/foders are mounted to PI OS hence I am using NFS)
    I am trying to put a simple OS command copy and mov command.
    in the Before Message Processing: cp /tmp/*.pdf /tmp/out/
    And in the After Message Processing: mv /tmp/*.pdf /tmp/archive/
    In the Adapter Audit logs says these commands are executed but I don't see any effect and there is no error/Traces available even in the Server logs also.
    I have been using these OS commands since XI 3.0 I never had any issue.
    I have gone through SDN but no luck, Please share your experiences.
    Thanks,
    Laxman
    Edited by: Laxman  Molugu on Feb 3, 2010 11:58 AM
    Edited by: Laxman  Molugu on Feb 3, 2010 11:59 AM

    hi ,
    As i understand your requirement you just want to take the pdf file from one folder of XI server and put it to another..
    for this u do not need a OS command..
    This requirement is simple ..infact u do not need any IR components as well..
    u just have to develop the ID part and wherever it asks for namespace or message interface u can give a dummy one..
    this would jst take the pdf file from one folder and send it to another

  • Script in file adapter

    Hi,
    I have gone through the blog:https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2411. [original link is broken] [original link is broken] [original link is broken]
    I need to convert .xml to .csv ...
    here in this blog it is said to use unix shell script and put in the path.
    Our Os is windows 2003.How do i make and place the script and how will the script get recognised.
    Kindly clarify.
    Thanks,
    srinivas

    Hi srinivas,
    In windows 2003 you can create a batch file (.bat) and trigger it from the XI file comm channel.
    From the batch file you can call the pgm (.exe) which will do the required conversion.
    FCC is another option http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    These are a collection of blogs on content conversion (both receiver and sender)
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    Chemmanz

  • File adapter put command

    Hi everyone,
    Does anyone know what kind of put statment the adapter creates to write files to a ftp? How can I see the exact command executed?
    And is there any possibility to change this command manually? Using advanced mode etc.
    Thanks...

    Go through this wiki to get some idea..
    http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature
    Below is the source code taken from above wiki where put commant has been used to write the file. Change the code as per your need..
    Script File  Batch.txt
    ======================
    open 10.4.71.145
    mmdftp
    Eimskip123
    cd /TestSource
    get TestData1.xml
    cd /TestTarget
    put TestData1.xml
    quit
    Also have a look on page 11 of this article to know FTP command..
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bd994384-0a01-0010-92b5-c54f5a1d8ae5?quicklink=index&overridelayout=true

  • File Adapter OS command to unzip files

    Hi all,
    I need an OS command or a script which unzips a file in the XI folder.
    Appreciate your response
    -Keerthi

    cmd /C "jar cvfM
    10.11.128.28\sapmnt\put\TEST\test.zip -C
    10.11.128.28\sapmnt\put\TEST\zip ."
    This will create a zip folder named test.zip in directory
    10.11.128.28\sapmnt\put\TEST\ . The contents of the zipped file will be taken from
    10.11.128.28\sapmnt\put\TEST\zip
    regards
    Ninad

  • File Adapter OS Command Line After processing (UNIX)

    Hi guys,
    I want to run only one line after message processing:
    compress -f %f
    It must be compress seeing as this is the way we use it on our legacy system where it adds the extension .Z.
    It seems crazy to write a shell script for only one line. Is there any way to run this line without using a shell script and if so should I run it in some additional characters?
    Also if this isn't possible, please show me an example of how the shell script would look like, and where on the XI server this shell script should be saved.
    Thanks a million!
    Anneke

    Hi Anneke,
    Check this blog by Sameer
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    Should help u out

  • File Adapter to read from remote file server query

    Hi all,
    I want a SOA 11g application to read files on remote server using File Adapter. Is it possible to configure the File Adapter to read from remote location instead of locally. Is it possible. Is yes where can I find the associated remote file configuration documentation.
    Thanks
    Edited by: user5108636 on 19/09/2010 19:49

    I also changed one more properties the FTP connection factory called serverType=win. I get bits and pieces in each document. Is there any working example to connect to an FTP server running on Windows using Ftp Adapter. Still not working.
    These are the error logs related to it. Please suggest
    ####<Oct 12, 2010 1:17:22 PM EST> <Info> <Common> <server_name> <WLS_SOA> <[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <46e7c258a0e5cad6:-145e5cdb:12b99475c2b:-7ffd-0000000000046afa> <1286849842995> <BEA-000628> <Created "1" resources for pool "eis/Ftp/FtpAdapter", out of which "0" are available and "1" are unavailable.>\
    [2010-10-12T12:56:07.142+11:00] [WLS_SOA] [NOTIFICATION] [] [oracle.soa.adapter] [tid: weblogic.work.j2ee.J2EEWorkManager$WorkWithListener@170e13a9] [userId: weblogic] [ecid: 0000IiTsVSi9xWD_n91FiZ1CfLfc00006s,1:24709] [APP: soa-infra] [dcid: 46e7c258a0e5cad6:f9faea1:12b852b7f0f:-8000-00000000000005ed] FTP Adapter FetchAvlFiles Recovery still not possible after 1500 attempts due to javax.resource.spi.IllegalStateException: [Connector:199176]Unable to execute allocateConnection(...) on ConnectionManager. A stale Connection Factory or Connection Handle may be used. The connection pool associated with it has already been destroyed. Try to re-lookup Connection Factory eis/Ftp/FtpAdapter from JNDI and get a new Connection Handle.
    Thanks
    Edited by: user5108636 on 11/10/2010 19:05
    Edited by: user5108636 on 11/10/2010 19:22

  • OS Command in File Adapter

    Hi All,
    I am trying to encrypt a file from XI and FTP to a different location. I am using PGP software for encryption and decryption. I am able to encrypt/decrypt the file from the OS level. The command I am using at OS level is:
    pgp --home-dir /.pgp --encrypt test.txt --recipient 0xC483S9E6
    If I use the same command in Sender File adapter in Run Operating System Command After Processing it is not encrypting. But I am using the same above command:
    pgp --home-dir /.pgp --encrypt test.txt --recipient 0xC483S9E6
    Now if I run the scenario the file is writing but it is not encrypting the file. Can you guys tell me where I am exactly going wrong.
    ---Korobee

    Hi,
    Try this, write all you OS command in a BATCH file say "encrypt.bat" and then call the batch script from File adapter. Also make sure you are giving the full path for all the files that you are refering to like
    \serverfolderpgp --home-dir /.pgp --encrypt \serverfoldertest.txt --recipient 0xC483S9E6
    Any more help let me know.
    Thanks,
    Prakash

Maybe you are looking for