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

Dear All,
I have gone through this link
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.

Dear All,
Yes just now i got the answer from this thread[OS command line script - Need help;
Actually i have another doubt now
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?

Similar Messages


    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.
    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.
    there was a blog obout this titled "XI as a huge file mover"
    and you can see a description and my scripts at

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

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

    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;jsessionid=(J2EE3417200)ID1690747750DB11724434094963199241End?blog=/pub/wlg/10392

  • 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:
    Rename.bat file calls a 'perl script' code.
    when i run interface, could see below statement in adapter log ->
    "Execute OS command "
    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..

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

  • Run Operating System Commands

    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.

    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.

  • 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:
    Also , please provide links for OS commands whch can be used for windows OS.

    Hi Neha,
    pls do chk this linkfor windows OS commands
    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
    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.

    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.

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

    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.
    cp %F /var/opt/data/outbound/Test/Dummy.txt ; rm %F
    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

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

    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.
    Jai Shankar

  • Operating system command in file receiver adapter

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

    did you see this page?
    it shows all you need to know
    Michal KRawczyk

  • External command is not working in File Receiver Adapter

       I have tried to copy the file which is mentioned in my File Adapter (Receiver) to 3 different folders thru OS command. The purpose is to save time. I have created one CC for Source(File) and one CC for target(File). After the target file is created, I want to copy this file in 3 folders. For this I have written one batch file in my system.
    File Name: copy1.bat
    COPY %1 C:\TEST1\arch_t1
    COPY %1 C:\TEST2\arch_t2 
    COPY %1 C:\TEST3\arch_t3
    DEL %1
    The command which I entered in the Receiver CC (File Adatper is)
    Run Operating System Command After Message Processing
    Command Line: C:\FILES\copy1.bat %F %f
    Timeout(secs): 60
    Terminate Program After Timeout - Check box is selected.
    But, this external command is not working. (because the target files are not created in those directories C:\TEST1, C:\TEST2, C:\TEST3)
       I did this scenario by refering the Michael'w weblog:
       In this blog, he has also given how to troubleshoot external command. I tried this also. It is not working.
        I use Windows XP OS. XI 3.0 SP 18.
       Friends, Could you kindly tell why this external command is not working? What could be the problem?
    Thanks in advance.
    Kind Regards,
    Jeg P.

    Hi, Jeg.
    As the note says, please check the java Runtime.exec behavior
    with the proper user.
    If in doubt, check if the command can be successfully run through
    the Java Runtime.exec(...) API. Also note that the command is run
    as user "<sid>adm" (Unix) / "SAPService<SID>" (Windows).
    So, Could you check the following(very dirty one!) Java in your
    XI server and check if it works? For simulating %F, create a test
    file C:\FILES\test.txt whatever the content is.
    import java.util.*;
    public class ExecJava {
      public static void main(String args[]) {
        try {           
          Runtime rt = Runtime.getRuntime();
          Process proc = rt.exec("C:/FILES/copy1.bat C:
        } catch (Exception e) {
    Good Luck.

  • 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
    Check this thread a similar problem
    Process Integration (PI) & SOA Middleware
    Note 841704 - XI File & JDBC Adapter: Operating system command
    Try to see the below links
    OS Command on FTP
    OS command line script - Need help
    FTP - Run OS Command before file processing
    Note: reward points if solution found helpfull

  • Check if file exists in file receiver adapter

      we have following scenario -> proxy to file
      before appending to the file, it should be copied/renamed to a "tmp" file
      xi should then append to that tmp file and copy/rename the file back to the normal name
    I tried it with "Run operating system command before message processing" but
    it's not working
    anybody has an example on how to use those settings before/after message processing ?

    Hi Michel,
    little confused,
    1) before message processing do there any file exists?
    2) why should we change file name to 'tmp' and append data to that and again rename that file ?
    con't we directly proceed in append mode with file name?
    When we use single command say for example cp or mv (copy or move) the commands then 
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt 
    when we club commands together or try to redirect the outputs of commands
    eg: cp %F /var/opt/data/outbound/Test/Dummy.txt & mv %F /var/opt/data/outbound/Test/Dummy.txt
          cp %F /var/opt/data/outbound/Test/Dummy.txt
          mv %F /var/opt/data/outbound/Test/Dummy.txt
    Include all ur command in one file and call that file in the OS parameter
    Pradeep A.

  • What is Operating System commands in Adapter Configuration??

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

    Go through this blogs..
    When we will use Operating system commands Option in Adapter Configuration??
    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..
    Satya Kumar..

  • Problem with zip operating system command

    i have the following configuration in the file receiver adapter:
    Directory: /tmp/
    File Name Scheme: %name%.txt
    Variable substitution:
    Variable Name: name                 Reference: payload: record,1,name,1
    Run Operating system command:
    /usr/bin/zip /tmp/ %F
    The execution is succesful, but i have a small problem. The file name is "", the .txt should appear but i dont know how to skip it, I have tried so many ways but it doesnt work, I should receive a file called "" With a file inside in txt format...

    Hi Sriram,
    Thanks, but that wouldnt work out, Im using the %f for my file name, so this move command shouldnt work for me, because my filename changes in every execution, so I cant write something like this: mv
    The only solution I see would would be a command which deals with strings and that could remove the four last characters of "%f"..but I havent found anything for doing it.

Maybe you are looking for

  • Welcome to the Metro Discussion

    Welcome to the Cisco Networking Professionals Connection Service Provider Forum. This conversation will provide you the opportunity to discuss issues surrounding Metro. We encourage everyone to share their knowledge and start conversations on issues

  • How can I know the extact model of burner for my powerbook?

    If I want to buy a new burner for my powerbook, how can do I know the exact specs to order it. My computer is a PowerBook G4 17", Machine Model 5,9 Titanium. And where can I buy one so I can install it myself. Please, it´s urgent. Thankyou.

  • All open PDFs save to RTF

    Wondering if anyone knows a javascript I could run to save all open PDFs as RTF with images. File>Save As> RTF (settings include images) Save to same folder Thanks

  • Two Program Monitors in Premiere Pro CS6?

    Is it possible to have 2 program monitors in Premiere Pro CS6? I'd like to view the composite video and scopes at the same time. Thanks, David

  • CS1 and OS 10.4.3?

    Hi. I have the education version of CS Premium (1) and when my harddrive failed, all my programs got erased. I got a new HD, and upgraded my OS to 10.4.3. When I try to install CS1 again using the 2 Install discs, it asks for the serial number, which