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

Similar Messages

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

  • Run Operating Systems command.

    Hi Experts,
    Please provide information on Run Operating Systems commands for File adapter.
    I have gone through t he below mentioned link already:
    [http://help.sap.com/saphelp_nw04s/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm]
    Also , please provide links for OS commands whch can be used for windows OS.
    thanks,
    Neha

    Hi Neha,
    pls do chk this linkfor windows OS commands
    http://webtools.live2support.com/windows/
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/sapXIFileAdapterOSCommandLine+Feature
    An interesting usage of Variable Substitution in XI
    Solution to the problem encountered using Variable Substitution with XI-SP12
    Copy a file with same filename using XI
    thanx
    Sampath
    Edited by: venkata sampath on Jul 8, 2008 7:20 AM

  • Run Operating System Commands

    Hi,
    There is an urgent requirement, i want to know about Run Operating System Commands in file adapter. What are all possible commands for windows operating system? and how it works? Kindly send me your suggestions and links at the earliest.
    Your help will be appreciated.
    Thanks,
    Sadhna.

    Hi,
    Run Operating System Command Before/After Message Processing
    ●      Command Line
    An operating system command specified here is executed before or after the message processing of a file that was found in a run. The default value is an empty character string (no command).
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    ●        %f (file name)
    ●        %F(absolute file name including path)
    ●      Timeout (secs)
    This specifies the maximum runtime of the executing program in seconds. When this time interval is exceeded, the adapter continues processing. The executing program continues to run in the background.
    ●      Terminate Program After Timeout
    Set this indicator if the adapter is to terminate the executing program when the timeout is exceeded.
    The adapter writes the output (STDOUT and STDERR) for the operating system command in the system trace.
    Regards,
    Phani

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

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

  • 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

  • OS commands in FTP adapter

    Hi Experts,
    we are trying to use the OS command in the sender FTP adapter to compress the huge text files(approx 2 GB) before we pick the file to avoid the server issues.
    for which we are using the OS command,
    ssh -n -l user targetserver "cd /tagetdirectory; compress ExportFile.xml;mv ExportFile.xml.Z ExportFile.xml"
    The above is a single command supplied by the Basis team.
    the above command makes the connection to the target server with  the user ( password not required)and then compresses the file.
    I used the command in the sender FTP adapter as is.
    But the message processing made the XI server unavailable  and the process got failed due to HTTP_TRANSMISSION_ERROR
    Please suggest on the OS command, Is it a right command ? or do I need to add anything to it, to make it work.
    Please note that for the File Adapter transport protocol "FTP", the operating system command is NOT
    executed on the FTP server, but on the server hosting the Adapter Engine ( please refer to
    SAP note: 841704).
    Thanks,
    MK

    Thanks Michal,
    For "FTP" the command will be executed on the but on the server hosting the Adapter Engine, right?
    ssh -n -l user targetserver "cd /targetdirectory; compress ExportFile.xml;mv ExportFile.xml.Z ExportFile.xml"
    the command above is opening a secure channel from the XI host to the FTP host. We have a trusted relationship set up between the xiadm and ftpadm users which will allow this to occur without a password. and then it compress the file.
    Please suggest further to resolve the issue.
    I really appreciate you help.
    Thanks,
    MK

  • 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

  • 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

  • RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESSING

    hi.
    just i want to know what is the purpose of run operating system command before message processing,after message processing under file sender adapter.
    waiting for your great answer.
    bye.
    regards.
    seeta ram.

    Hello Seeta,
    let me see if I give it using a simple scenario that I implamented : i nedd to transfer a very large file from one server to the other by XI.
    to save space and network traffic I use an OS command before picking up the file to run a zip command to zip the file.
    after I transfer the file to the target server I run another OS command after the transfer to unzip the file.
    now to your second question:
    the before Os command on the target server is used mostly for checks (make sure there isn't a file by that name or backing up existing data)
    and the after sender OS command is usualy for backing up or erasing existing files (cause it is done only after the first part was finished succesfully).
    Uri Lifshitz.
    p.s.
    there was a blog obout this titled "XI as a huge file mover"
    and you can see a description and my scripts at https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/03/additionaltipsforusingXIasahugefiletransfer%28withbatchscripts%29&

Maybe you are looking for

  • My ipod touch is fliiping out

    I dont even touch the screen and it will start to type all kinds of things and open apps on its own.

  • Error 0xc00000e9 when installing windows 7 on OSX lion

    I have a mid 2011 model of macbook pro i7 15 inch , and i just upgraded to OSX lion from os leopard . I tried to install windows 7 via bootcamp 4.0 , and the download for the windows support software always hangs at mid point , and must retry several

  • How to use CooCox software(C​oBuilder+C​oDebugger+​CoFlash) to develop applicatio​n program using

    1.Install JAVA platform and GCC compiler. eg: jdk-6u2-windows-i586-p.exe arm-2009q3-68-arm-none-eabi.exe website: https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/​CDS-CDS_Developer-Site/en_US/ -/USD/ViewProductDetail-Start?ProductRef=jre-6u16-​oth-

  • Problem with custom tag

    I have written a custom tag that I am having problems with. It works on some machines, but not on others. I have a page that uses many 'standard' tags. I have correctly set the URI etc, because all of my other tags work. However, on some machines, my

  • Why not autoconnecting "when needed"?

    Hi there, I'm not sure where the best place is to post this question, but, I'll start here and hope for some guidance! I have my network preferences set to have my "built in ethernet pppoe session options" "connect automatically when needed". However