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 ,

Similar Messages

  • 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

  • Adapter Return Value Truncated

    I am trying to understand what is going on with an adapter return value. Why would the return value be truncated to 1 character and then the result be "null" when the actual value the script returns is shown as "SUCCESS"?
    The web console shows the task a failed with a Response and Task Status of null.
    Class/Method: tcAdpEvent/setAdpRetVal entered.
    Class/Method: tcAdpEvent/getRetValString entered.
    Class/Method: tcAdpEvent/getRetValString - Data: class - Value: java.lang.String
    Class/Method: tcAdpEvent/getRetValString - Data: poRetVal.toString() - Value: SUCCESS
    Class/Method: tcAdpEvent/getRetValString - Data: Returning:sRetVal - Value: SUCCESS
    Class/Method: tcAdpEvent/getRetValString left.
    Class/Method: tcAdpEvent/setAdpRetVal - Data: Setting Adapter Return Value to SUCCESS - Value:
    Class/Method: tcAdpEvent/setAdpRetVal left.
    Class/Method: tcAdpEvent/finalizeProcessAdapter entered.
    Class/Method: tcAdpEvent/finalizeProcessAdapter - Data: Truncating to 1 characters - Value:
    Class/Method: tcAdpEvent/finalizeProcessAdapter - Data: Mapped to Response Code - Value:
    Class/Method: tcAdpEvent/updateSchItem entered.
    Class/Method: tcAdpEvent/updateSchItem - Data: event - Value: adpRUNCOMMAND
    Class/Method: tcAdpEvent/updateSchItem - Data: New Status - Value:
    Class/Method: tcAdpEvent/updateSchItem - Data: SchData - Value: null
    Class/Method: tcAdpEvent/updateSchItem - Data: Reason - Value:
    Class/Method: tcAdpEvent/updateSchItem left.
    Class/Method: tcAdpEvent/finalizeProcessAdapter left.
    Adapter: adpRUNCOMMAND has completed for the task: Final Update.
    -----------------------------------------------------

    Hi
    Have you got a solution for this?
    I'm having the same extrange behaviour with my adapter.
    In my case I'm using same adapter to enable/disable a user. One adapter variable determines if the action to perform is enable or disable.
    This adapter is integrated in two process tasks (Enable User and Disable User). What I can't understand is why it returns correct responses when disabling users, but returns just the first char of the response code when enablig users...
    Any hint?
    Thks

  • 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

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

  • OS Command for receiver file adapter

    Hi Guys,
    I have a requirement that in the target folder before putting the file, I have to rename the exisitng file then put the file. The target folder is in another machine and I have to use FTP option to send file.
    is it possible to use OS command after processing option in the receiver file adapter to do this? please let me know how to handle this.
    Thanks
    Mukesh

    Mukesh,
    You cannot rename the file in the FTP folder. What you can do is write a OS script where it logs in into the FTP site and renames the file. Then use this OS script before message processing so that it renames the file before you write the actual file.
    If you want to rename a file which is on the applicaiton server using NFS then you can directly rename it from the command prompt.
    Regards,
    ---Satish

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

  • *OS Command in the File Adapter

    Hi all,
    I am trying a scenario where in the username,time,date must be appended to my pay load.
    For I am trying using the batcth file with out using udfs.
    In my output file i need username,time,date info based on the login(suppose some user tests my scenario in xyz terminal his info must be displayed in my out put payload.)
    In the sender CC:
    xiserver\xi_scenario\File2File
    Run OS command before processing:
    c:\a.bat(This contains user info) after exeuting i placed in xi server to monitor the user(but i dont know where the batch file executes since there is no Dir 'c" in Xi)Please let me know how can i achieve this).
    Receiver CC:
    FCM:Append
    filetype:text
    Please correst me if i am not correct.
    Thanks,
    Srinivasa

    Srinivas,
    OS commands are usually placed in a path on the XI server itself. If XI is on UNIX shell scripts are used, while if it is on a Windows server .bat files are used. From your post, it looks like you are trying to execute a batch file on your local system.
    Not sure if it is possible to execute such OS commands out of your local system.
    You should probably could place the OS command script on a server path.
    Thanks,
    Anand

  • Which user is used to execute command defined in File Adapter?

    Hello,
    in my receiver file adapter I specified a OS command to be executed after message processing. However this command doesn't get executed. After investigation I figure out that it's because the user that is used to executed the command does not have enough authorization to run the program (It's a unix system).
    So anyone knows which user is used to execute the command? Or anyone know how to go around this security issue with OS command in Unix system?
    Thanks
    Eric

    Hi,
    As Bhavesh replied you earlier the OS command is executed by the user <sid>adm in Unix or SAPService<SID> in windows.
    Do check the note 841704 - XI File & JDBC Adapter: Operating system command.
    From Note 841704
    Also note that the command is run as user "<sid>adm" (Unix) / "SAPService<SID>" (Windows).
    Thanks
    SaNv...

  • Java command line in File adapter

    Hi all,
    In my receiver file adapter (FTP), I want to use the option "Run operating system command after message processing".  In the command I want to execute a java class.  Can anybody have information about how to do that ?
    My command line in the following : "java myPackage.MyClass %F". This command line works fine on my machine but I don't know how to do when on XI File Adapter (where to set the jar file, ...)
    Thanks in advance,
    Laurence

    Hi Laurence
    XI Command Line Functions::
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    1)Windows batch Commands::
    http://labmice.techtarget.com/articles/batchcmds.htm
    2)Linux:
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    regards
    Piyush
    Pl: reward points if it is helpful.

  • Posting XML using FILE adapter returns "HTTP_RESP_STATUS_CODE_NOT_OK"

    Hi,
    I am trying do very simple demo which reads a simple XML message from a ftp server and post that message directly to the same ftp server using FILE adapter.
    So, I add my xml message like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:TxMessage xmlns:ns="http://bsa.sisl.com">
      <Name>Bibinu</Name>
      <Address>Kalyan</Address>
    </ns:TxMessage>
    but I get a error message back from the Integration Server as:
    <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>
      <SAP:P1>401</SAP:P1>
      <SAP:P2>Unauthorized</SAP:P2>
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Error Report&lt;/title&gt; &lt;style&gt; td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;} A:link A:visited A:active &lt;/style&gt; &lt;/head&gt; &lt;body marginwidth=&quot;0&quot; marginheight=&quot;0&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; rightmargin=&quot;0&quot;&gt; &lt;table width=&quot;100%&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; align=&quot;left&quot; height=&quot;75&quot;&gt; &lt;tr bgcolor=&quot;#FFFFFF&quot;&gt; &lt;td align=&quot;left&quot; colspan=&quot;2&quot; height=&quot;48&quot;&gt;&lt;font face=&quot;Arial, Verdana, Helvetica&quot; size=&quot;4&quot; color=&quot;#666666&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;401 &amp;nbsp Unauthorized&lt;/b&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr bgcolor=&quot;#3F73A3&quot;&gt; &lt;td height=&quot;23&quot; width=&quot;84&quot;&gt;&lt;img width=1 height=1 border=0 alt=&quot;&quot;&gt;&lt;/td&gt; &lt;td height=&quot;23&quot;&gt;&lt;img width=1 height=1 border=0 alt=&quot;&quot;&gt;&lt;/td&gt; &lt;td align=&quot;right&quot; height=&quot;23&quot;&gt;&lt;font face=&quot;Arial, Verdana, Helvetica&quot; size=&quot;2&quot; color=&quot;#FFFFFF&quot;&gt;&lt;b&gt;SAP J2EE Engine/6.40&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr bgcolor=&quot;#9DCDFD&quot;&gt; &lt;td height=&quot;4&quot; colspan=&quot;3&quot;&gt;&lt;img width=1 height=1 border=0 alt=&quot;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;p&gt;&lt;font face=&quot;Arial, Verdana, Helvetica&quot; size=&quot;3&quot; color=&quot;#000000&quot;&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;User is locked.&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face=&quot;Arial, Verdana, Helvetica&quot; size=&quot;2&quot; color=&quot;#000000&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;&amp;nbsp;Details:&lt;/b&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;PRE&gt;No details available&lt;/PRE&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/font&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt;</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>HTTP response contains status code 401 with the description Unauthorized XML tag Envelope missing in SOAP message header (SAP XI Extension)</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Seems like I am missing the Envelope. What does the Envelope supposed to look like or should contain so that the scenario should work?
    Thanks !

    Did you resolve the problem?? I have the same problem, and there's no informatin about it.
    Thanks!!

  • Need help in OS command problem in File adapter.

    Hi All,
    In channel configuration, I configured  "run operating system command before message processing" with shell file. But,I foundnd that every time I change the shell file, it won't take effect until I restart PI system. So, could you please tell me whether there is way to avoid this or give a solution of this?
    It is relaly very very yrgent for me.
    Waiting for positive replies.
    Regards,
    Prakash.

    Dear Prakash,
    Even you have changed the shell file, but the CPA cache used in runtime
    remains unupdated. Restarting PI system or performing CPA cache refresh
    manually can trigger CPA cache refresh, but you can try a simple way:
    You can do dummy change in communication channel configuration in
    Integration Directory(for example, add a space mark in description field
    in channel configuration and activate the change list), then a cache
    refresh is triggered.
    Please try.
    Regards,
    Tulika Bhatt

  • 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

Maybe you are looking for

  • Apple tv purchase and imac

    hi all purchased a show on apple tv 3rd gen, it does not appear in my purchased or tv shows in iTunes on iMac , i have logged out of iTunes on iMac 2 or 3 times to no avail, i check for downloads and it tells me all d/loads are complete or something

  • Verizon DSL, Westell & Airport Extreme Base Station

    Last year I posted a desire to hook up my AEBS and AEX to a Westell wireless network. After much discussion and many suggestions I created a network that worked but was occasionally flaky. Since that time our family has replaced two old G3 laptops wi

  • Menu Bar Icons no longer showing, not able to switch on in control panel

    I had sleep problems with my MBP (http://discussions.apple.com/thread.jspa?threadID=2449728&tstart=0) and as such I did a combo update as this could possibly solve it. However, now all the control panel icons in the menu bar have gone (like the clock

  • NOT ABLE TO PLAY YOUTUBE VIDEOS

    I have installed latest flash player latest Firefox and all the necessary add ones but not able to play you tube videos it shows a error message(An error occurred please try again later) but I can play videos from all the other sites like yahoo and F

  • Programmatically Suppressing Report Sections?

    Can someone please tell me if there is a way to suppress sections of a report at runtime? I am giving the user the option to output to excel or pdf. If excel, I want to suppress the page headers and footers so I donu2019t end up with a bunch of blank