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&

Similar Messages

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

  • How to Run Operating System Command Before/After Message Processing SAP PI

    Hi,
    We are trying to execute multiple commands via "Operating System Command Before/After Message Processing".
    When we use single command say for example cp or mv (copy or move) the commands get executed fine.
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt 
    /this works fine/
    when we club commands together or try to redirect the outputs of commands, none of the commands get executed.
    eg:
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    or
    wc -l %F > /var/opt/data/outbound/Test/Dummy.txt
    Is it possible to execute multiple commands or redirect the output  of commands without using a shell script? The PI server we are working on iis hosted on UNIX environment.

    Hi Harleen,
    try like this
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    instead of semicolon try this
    (1) &
    command1 & command2
    Execute Command1 and then execute Command2
    (2) &&
    command1 && command2
    Runs the command2 only when command1 doesn't Complete successfully
    (3) ||
    command1 || command2
    Runs the second command if the first command had an error
    (4) ()
    (command1 || command2) || (command3 & command4)
    Defines the order in which commands are to be executed
    Regards
    Suraj

  • File-FTP command before message processing

    Hi experts,
    my requirement is as follow :
    i have 5 files on my FTP server. All are named FILE_hhssmm.xml
    In the configuration of my CC out, i have put as specific file name to get picked 1*.xml
    I need a command line in the 'run operating system command before message processing' that renames one of the files as 1FILE_hhssmm.xml so that the files get picked one by one.
    I can not manage to do that, i only managed to write a batch file but i only can run it locally...
    please, any help would be greatly appreciated...
    Kindly,
    Jamal

    Hi
    I have been following this for a while (from other posts as well), you are trying quite hard to get this done
    I have couple of ideas...
    If you think that this is not going to work, then you can try another solution,
    - let the .bat file be scheduled by the scheduler of your OS (this is quite simple) say every 30 mins
    - make the .bat file move your input files from your current folder to a child folder
    - let XI poll the child folder, every 5 secs or so... anyway your scheduler will send the file only after every 30 mins
    - Now you need not rely on the OS command from the Fileadpater of XI
    My suspicion (though it is not documented anywhere in help, as far as I know) is that the OS command executes only if there is proper reading of the file (or its presence as per the configuration in adapter settings) & not per polling of the adapter. I infer this from your previous post. but your requirement is peculiar that though the file is present that itself has to have a different name - to be read by adapter...some kind of clashes ??!!.
    The problem could be something else also, but the above is a possibility as well..
    all the best
    Regards
    Vishnu

  • Runtime OS command before Message processing

    Hi all,
    I have a scenario where the input file from a particular FTP server has to be moved to XI server and then process the message from there. For this I am trying to use "Runtime OS command before Message processing" My problem is that how do I define it in the normal adapter configuration i.e. File access parameters for the sender.
    My Query is:
    Now should I use the NFS protocol or the FTP protocol ie.in the File access parameters should I specify the directory from which the file needs to be processed after movement to the XI server or should I specify the FTP server details choosing the FTP protocols.
    Also provide me some links on how to configure using OS commands.
    Thanks & Regards,
    Nithiyanandam

    Hi,
    U can use NFS ...also for RUN Operating sysyrm command
    Try using RUN OPERATING SYSTEM COMMAND AFTER MESSAGE PROCESING and RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESING.
    You just post ur output file in some folder(Target) , lets say /usr/sap/sapout/test/.and the shell script in this path /usr/sap/bin/convert.sh (use ur Rename logic here).
    Inside the File access parameters put target directory and filename scehme and for shell script give processing parameters as File construction mode , File type and OS Command and use a space after the shell script name and the %F.
    And for input can use it directly.
    For the shell script (which u will use to rename the file after processing) you can put anywhere inside /INTERFACE/XI/ but athe time you provide the pat it will be exactly matching as from where you are using the Shell Script and the file at the coressponding places. It shud be in XI. Thats it and u r done.
    Check out these links. First one will help you in acheiving want you want.
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    I hope this will solve your problem
    thanq
    krishna
    Edited by: krishnachitanya siddavattam on Mar 10, 2008 5:38 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

  • 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

  • OS level command before message processing

    Hello
    I am getting the files from the SFTP server through the shell script and expecting to be processed by my File sender adapter.
    I have configured my File adapter which will poll the directory into which the shell script gets the file and it is scheduled at say 60 sec duration and i had configured OS level command before message processing.
    But when i monitored my communication channel and also my directory I found out that its not executing the OS level command. I tried dropping the dummy file into the directory. This time when checked in comm channel monitoring, it executes the OS  level command and gets the file from the SFTP server and adapter polls the SFTP file as well. But i don't want to use dummy file each time.
    Is there any way by which we can always make adapter to execute OS level command. I tried various options like Process Empty files etc etc but no luck.
    Thanks in advance.
    regards
    rajeev

    Rajeev
    How about placing a dummy file of 0 bytes, setting up the 'Handling of Empty Files = Don't create message', Processing mode = 'Test' and then writing a post operating command script as well, to move all the files to archive directory except the dummy file.
    Not a clean solution but just a thought.
    http://help.sap.com/saphelp_nw70/helpdata/en/e1/69a740aa053a13e10000000a155106/frameset.htm

  • FTP Adapter with Runtime OS Command before Message Processing

    Hi PI Techies,
    I have a confusion in using Sender FTP Adapter with Runtime OS Command before Message Processing.
    Scenario is like this:
    Ftp Adapter has to pick a file from FTP server after it checks that a Blank Marker file exists on PI server AL11 directory say "tmp directory".
    For this I am using Runtime OS Command before Message Processing where a shell script will check the existence of Blank Marker file on PI server AL11 and if found , it exits the script and FTP Adpater will then pick the Actual Data File and Process it.
    Now Confusion:
    I am confused in technical execution of steps by FTP Adapter..
    Whether FTP Adapter polling initiates the Interface or Runtime OS command checking the File existence will initiate the Interface?
    May be its follish to you guys... but please answer ..
    Regards,
    Anurag

    Hi,
    I will take it other way as we need to process the Data File not Marker File ( its just for checking the Data File is completely written on FTP server).
    Other way mean " Will Poll for Data.txt File and if  found then Runtime OS Command will do connect to FTP and check if Marker File exists, if yes then delete the marker file and read the actual Data File for processing.
    Please let me know, if Marker File does not exists on FTP folder, will it still read the Data File or will it exit the Adapter execution?
    Your help is much appreciated.
    Regards,
    Anurag

  • 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

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

  • Operating command before message processing

    Hi experts,
    i have a file to jdbc scenario.
    My problem is that i want to send files that are generated on a ftp seperately.
    To do so, i wrote a .bat script to rename the files the way I want, and then the CC takes the file under the specific name I specified.
    My script works locally, it renames correctly the files.
    But how do i execute my script before the message processing on the files of the FTP ?
    I entered the name of the script in the command line, but doesnt work, looks like nothing is launched.
    Can i launch my script on the FTP ?
    Kind regards,
    Jamal

    Hi
    Check these blogs
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    /people/santhosh.kumarv/blog/2008/07/27/glimpse-at-os-command-yet-another-scenario
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/sap%252bxi%252bfile%252badapter%252bos%252bcommand%252bline%252bfeature
    Regards
    Vishnu

  • Regarding Run operating system command

    Hi experts,
    I have a requirement of creating an empty file onto the same folder where my reciever file adapter writes the result file. Is it possible in case of FTP as well or is just supported for NFS?
    Regards,
    Amol

    Hi Amol,
    I have no experience with scripts. But if my understanding is correct, you can achieve this. The script file to be called should be placed in your XI server. The script file will have commands to do the FTP and create file in the remote FTP server. Although I have never worked on scripts to be 100% sure. May be a person familar with scripts can give the cirrect info.
    Regards,
    Jai Shankar

  • 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

  • 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

Maybe you are looking for

  • ITunes library contents at several HDs, how to move location?

    I have a problem with having iTunes recognise that some of my iTunes library contents are being moved into another HD. I have only some most used music files at the internal HD of my PowerBook G4, and a huge video collection at an external HD, and no

  • Is there an easy way to arrange apps?

    I just had to restore my phone from backup because of an error in updating the software and now I have an empty phone!  I chose the option to restore from backup and the backup I used was from 45 minutes prior.  After running this restore, there were

  • I want to know when I am eligible for an upgrade?

    I want to know when I am eligible for an upgrade?

  • Material Description to be overwritten in PR/PO from material master

    Hi, when we create a PO/PR from ME51n and ME21n the material description field is mandatory hence inspite of making setting as display only  in SPRO the inital screen will except any description and will save it. Is there any thing else by which the

  • Exchange Server 2010: Convert Mailbox to MailUser

    Dear All, I plan to cutover migration exchange on-premises to exchange online with single-sign-on. http://community.office365.com/en-us/w/exchange/835.cutover-exchange-migration-and-single-sign-on.aspx In Step 2: It need to Convert on-premises mailbo