File adapter operating system command exit code

Hello,
If you call an operating system command in the file adapter, how is the exit code of the command handled? The documentation says nothing about this.
If I call 'true', I expect the file adapter to succeed.
If I call 'false', I expect the file adapter to fail.
Hope someone can calrify.
Best regards
/Otto Frost

Hi, Yes, you are rigth, it spawns a subprocess, that runs without control.
In java you use Runtime.exec().
It returns a process.
process.exitValue() returns an int.
The process is already used to terminate the process after timeout I suppose.
You would like to be able to have the fileadapter succeed or fail depending on this exitValue.
Depending on the command you execute, the exit code is different. RTFM on unix.
You would like to define which codes should be treated as success, and which ones that should be treated as failure.
true typically returns 0 and false not 0
However, a comparison command could for example return 0 for equal, -1 if the frist argument is smaller and 1 if the first argument is larger.
For the diff command, Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
Thanks
/Otto

Similar Messages

  • Unzip file using operating system command in file/ftp receiver adapter

    Hi,
    I'm wonderdering how to unzip a zip-file in the receiver file/ftp adapter. I know it is possible to do it using the 'Operating system command' feature, but somehow the command I use seems to be ignored! (I'm using SP14, unix).
    The command I entered is quite simple: unzip %F (also tried the %f, but i guess it doesn't really matter wich on I use).
    Is it possible that I'm unzipping to another directory than the one i expect? the unzip should be performed to/in the current directory, and assumingly current directory is the one stated in the 'Target Directory', right?
    Hope someone can clearify this issue for me.
    Best regards,
    Daniel

    Hi Daniel,
    It seems to me also, that the files are being unzipped to a different location than what you are expecting. The OS command might getting executed in some default location(i am trying to fnd that out)on the server and not in the target directory of the channel(It seems logical to me)....
    If you have time...pls try this out & see whether this would help...
    Have a shell script written with the following commands in them
    cd <path to target directory>
    unzip $1(filename from the channel)
    and in the OS command in the Channel give....
    <absolute path to the .sh file> %F
    Thanks,
    Renjith.

  • Unable to run a Batch File Operating System Command

    Using XI 3.0, I am unable to run a Batch File Operating System Command After Message Processing.
    My Batch file:
    gpg -se -r BOA3RSKY --armor --passphrase-fd 0 %1 < C:\Progra~1\GNU\GnuPG\gpgin
    My Command Line (ID scenario)
    exec "cmd.exe /c C:\Progra~1\GNU\GnuPG\boagpg.bat %F"
    If I execute
    exec "cmd.exe /c type C:\Progra~1\GNU\GnuPG\boagpg.bat >xis.txt"
    It displays the contents of boagpg.bat file in xis.txt.
    I just don't understand why when I run the batch file, I would expect an %F.asc encrypted file in the same directory as the %F unencrypted file.
    Any ideas?
    or will I need Basis to create commands that will allow me to run GPG from XI Command Line?

    Check this links if its helpful
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/c7423347dc488097ab705f7185c88f/frameset.htm
    /people/sap.user72/blog/2004/01/30/command-line-help-utility
    Check this thread a similar problem
    Process Integration (PI) & SOA Middleware
    Note 841704 - XI File & JDBC Adapter: Operating system command
    http://service.sap.com/sap/support/notes/841704
    Try to see the below links
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    OS Command on FTP
    OS command line script - Need help
    FTP - Run OS Command before file processing
    Note: reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • Operating system command in file adaptor

    Hi,
    I am doing file to Idoc scenario, can i use the Operating system command in file adaptor to compress the file at FTP server and decompress the file at IE. I don’t know is it possible and if yes then how or is there any other way to handle the big files as the network speed is very low.
    Any clues!!!!!!!!!!!
    Thanks in advance
    Regards
    Swatantra

    Have a look into these threads - they seem to have the solution u need (i havnt tried it though)
    Unzip file using operating system command in file/ftp receiver adapter
    How to zip and unzip xml files dynamically by XI

  • Operating system command in file receiver adapter

    Hi,
    How to use the Run Operating system command after message processing option in the parameters tab of the file receiver adapter.
    I am working on a scenario wherein a batch file needs to be invoked after the file is written on the file system.
    So how do i invoke this batch file from the file reciever adapter ( Run Operating system command after message processing ).

    Hi,
    did you see this page?
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/556cb799c93677e10000000a114a6b/content.htm
    it shows all you need to know
    Regards,
    Michal KRawczyk

  • File Adapter 7.11 - set operating system command line dynamically

    Hi,
    is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    I need to set  a command line exec depending on some XSL mapping values.
    thx
    holger

    hi,
    >>>is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    >>>I need to set a command line exec depending on some XSL mapping values.
    think about this approach:
    you put the XSL values into the filename after the real name of the file
    in the batch script you use those values in order to execute a dynamic exe command
    after processing you just change the name of the file in the script by removing the xsl values
    simple ? I think so
    Regards,
    Michal Krawczyk

  • File Receiver Adapter:Run Operating System COmmand after message Processig:

    Dear All,
    I have gone through this link
    [http://help.sap.com/saphelp_nw2004s/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm]
    But i have a problem.
    In the scenario which we have, File name is DYNAMICALLY GENERATED by a UDF
    I want to call the file at run time after message processing via Command Line and execute some os commands.
    But since the file name is Dynamic....How will i call the file at run time in Command Line:
    SYNTAX: %f(FileName)
    How will i specify the file name in the above syntax as the file name is Dynamic and not constatnt.
    Please Advice.
    Senthilprakash.

    Dear All,
    Yes just now i got the answer from this thread[OS command line script - Need help;
    Actually i have another doubt now
    In REVEIVER FILE ADAPTER:
    when we give Run Operating system Command After Message processing
    does the OS command get executed after the output file is placed in the Receiver folder/server or before its placed in the receiver folder?
    Regards,
    Senthilprakash.

  • Operating System Command After File Processing in Sender File Adapter

    Hello guys,
    actually we have different interfaces, and the client to take all the files from only one directory, for example D:/DPI.
    Unitl now we had one adapter for every file with the content conversion, so we didn't have problems with that. Now we have the problem that we sould maintain an order processing files.
    We thougth that an idea could be to execute one file pointing to D:/DPI and at the Operating System Command put like: copy D:/DPI/file.txt D:/DPI/outbound/file.txt, so when file is executed, we move the next file to another directory where is pointing the adapter. Doing this we have an error on the adapter giving us the message: Could not process due to error: java.lang.NullPointerException
    We are using a Windows.
    There is anyway to do in our way, or there is a better solution to resolve this problem?
    Any other idea to do this?
    Many thanks in advance.
    Regards,
    Xavi.

    Helo Guys,
    maybe I haven't explained well.
    We have one directory with different files. We have one adapter for every file( we need for the content conversion ) using NFS and all the adapters are pointing to the same directory.
    The problem is that if we have files A.txt, B.txt and C.txt we need to process in an order.
    And the problem we see is that for every file we have one adapter, so for example if we process file A.txt with one adapter, when this part is finished, we want to process file B.txt with another adapter, and the same for the rest of the files.
    So the idea we had is to create another directories, and when A.txt has finished move file B.txt to another directory.
    However this way is not running, if we log on the PI machine and execute cmd, we can do a copy of one file from one directory to another, but when we put this sentence in the adapter in OS command if we see the adapter log we see an error executing the OS command, but we don't know what is the error, there is no more information.
    There is any way to do this or maybe we have to manage in a different way?
    Many thanks in advance.
    Regards,
    Xavi.

  • Run operating system command for sender File adpter (NFS)

    Hi All,
    iam doing a file to RFC scenario, using 'Run operating system command' in sender file adapter to change the file name while archiving (after processing completed).
    I mention OS command like this:
    sample_server\scripts\Test\Rename.bat"
    Rename.bat file calls a 'perl script' code.
    when i run interface, could see below statement in adapter log ->
    "Execute OS command "
    sample_server\scripts\Test\Rename.bat"
    but the script was not run and file name was not changed.
    Please advice what could be the problem?
    Does this mean script executed successfully?
    Do i need install perl software on XI server, even perl script (.bat file) is executing on sample_server?
    Thanks in advance..
    Regards,
    Rajesh

    Hi,
    Just check the following URL and give it a try again :-
    Executing Unix shell script using Operating System Command in XI
    Hope this info Helps..
    Regards,
    Aditya

  • Re: Error while Execute External Operating System Command using T.code SM49

    Dear Experts,
    I Have uploaded one .exe file in the application server (eg: sum.exe) and created the OS command in SM69 transaction .
    And maintained the application server path in the 'operating system command' field in SM69 t.code.
    Our SAP system, oprating system is UNIX.
    After I have executed the external command using transaction SM49 , but I got the below error.
    Can not execute external program (permission denied) , External program terminated with exit code 1
    Immediately I run the SU53 transaction code to check the authorization, but Authorization was successful.
    Could any one please help on this error.
    Thanks in advance.

    >>Can not execute external program (permission denied) , External program terminated with exit code 1
    You need to give the permission as 755 to your file.
    >>I Have uploaded one .exe file in the application server (eg: sum.exe)
    You are on UNIX and do not expect to any result of .exe file as UNIX doesn't know about this.

  • Operating  System commands in FTP adapter

    Hi
    I have a requirement to use "Operating System Command" option in the Sender/Receiver side File Adapter.
    And in help.sap.com they have brief notes on this.
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    When I tried to execute some valid DOS commands like MKDIR,RENAME etc it didn't work at all.
    But process has been sucessfully completed without any error!!!
    System : XI 3.0 SP 11
    Can anyone has any inputs on this ? Pls share me some ideas with example. Is there is any limitations on this feature?
    Note: When I tried to give invalid commands hfjkhfkasdjfh,asdjdhas etc, still it is not giving any error!!. Still my File Adapter as well as entire process is successfully completed.

    Hi,
    A couple of cautionary notes.
    The OS command is executed after the file has been processed, e.g. read successfully by a sender adapter or created successfully by a receiver adapter.
    The file name processed can be accessed using %f in the OS command.
    The OS command must include the full directory path, or XI will assume the current directory which may not be where your command resides.
    Regards,
    Bill

  • File system checking exit code 8

    Hi guys ... after done a filesystem checking I've got:
    +0100: Incorrect number of file hard links
    +0100: Checking catalog hierarchy.
    +0100: Checking extended attributes file.
    +0100: Checking volume bitmap.
    +0100: Checking volume information.
    +0100: The volume Macintosh HD was found corrupt and needs to be repaired.
    +0100: File system check exit code is 8.
    +0100: Error: This disk needs to be repaired using the Recovery HD. Restart your computer, holding down the Command key and the R key until you see the Apple logo. When the OS X Utilities window appears, choose Disk Utility.
    After restart the machine as suggested, my filesystem check exit without finding any problem, so ... what is the problem in fact? ...
    By the way: I do not have any strange behaviour on my mac, I normally run filesystem and permissions repairs in order to keep "him" clean and healthy. 
    Thanks in advanced,
    Jorge

    This seems to be a bug. You may be able to work around it by starting up from another physical device. Make sure you have a current backup before doing anything.
    If you have a "clone" backup on another drive—not a partition on the same drive—start up from it by holding down the option key at the startup chime and selecting its icon in the Startup Manager display. Launch Disk Utility and repair your primary startup volume—not the one you started from.
    If you have a Time Machine backup on a locally-attached storage device—not a network device such as a Time Capsule—there should already be a Recovery system on that device. Start up from it and repair in the same way as above.
    Otherwise, use Recovery Disk Assistant to create a Recovery system on a spare storage device, such as a USB flash drive, and start up from that device. All existing data on the Recovery device will be permanently erased.

  • Is it possible to call operating system command after file receive?

    Hi expert,
    I'm trying to call operating system command after file receive comm.channel receive a txt file.
    operating system command uses txt file name as parameter.
    Is it possible? How?
    Thanks.

    Hi,
    It should be possible, actually we have two options that are
    1.RUN OS command before message processing
    2.RUN OS command after message processing.
    So you can give the commands in the RUN OS command after message processing.
    Check this links for more info
    http://wiki.sdn.sap.com/wiki/display/XI/SAP%20XI%20File%20Adapter%20OS%20Command%20Line%20Feature
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/556cb799c93677e10000000a114a6b/content.htm
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417200)ID1690747750DB11724434094963199241End?blog=/pub/wlg/10392
    Regards
    Ramesh

  • Operating system command to zip the file

    Hi Experts,
    I got proxy to file scenario, i can place the text file successfully in reciever side, i want to zip the file in reciever side using operating system command option in reciever Communication Channel.
    Can anyone please give me the operating system command to create the zip file in reciever side.
    Kind Regards,
    Praveen.

    Hi Praveen,
    >>Can anyone please give me the operating system command to create the zip file in reciever side.
    Why OS commands and not the PayloadZipModule?
    If you need OS commands check this blog of Michal /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    Update
    You can try this command too
    cmd /C "jar cMf \\<folderpath>test1.zip \\<folderpath>*.*"
    Regards
    Suraj

  • What is Operating System commands in Adapter Configuration??

    Hi Frnds,
    When we will use Operating system commands Option in Adapter Configuration??
    Regards,
    Raj

    Hi,
    Go through this blogs..
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    When we will use Operating system commands Option in Adapter Configuration??
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/00453c91f37151e10000000a11402f/content.htm
    Go through this link some experts discussions:
    Run Operating System Commands
    How to run Operating system command in receiver JDBC Adapter
    Hope this info is useful to you..
    Thanks,
    Satya Kumar..

Maybe you are looking for

  • [4.0] Junk characters in TNS list

    Hi All, first of all let me thank all the developers that worked on SQL Developer (especially the fourth version), because it is a great product, improving continuously! The (small) problem I have on SQL Developer 4.0 is that it shows me junk charact

  • ADF UIX JAAS

    Have any one out there came accross a good example on how to set up authentication for Oracle ADF Business Components UIX Clients

  • CS5prints too dark.

    I am using CS5 on a Mac printing to an Epson artisan50 but prints turn out too dark.  The image on the monitor is correct in all applications including CS5.  The prints are correct in other applications but only in CS5 are they too dark. 

  • Installer can not initialising when i setup starting of photoshop CS6

    When i start the setup of Photoshop ,there is a interupt and a messsage is " Installer can not inizialising " ?! what can i do ? My system is win 8.1  64bit             leothon

  • About inter-relation B/W MM-PP-SD and Fico module

    Hi to all Plz describe me interrelation b/w  MM-PP-SD and Fico module . If possible send me work-flow of these modules which is required to know for an ABAPER. Also tell me how a n ABAPER interact with a functional consultant . Thanks & Regards Anubh