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

Similar Messages

  • 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

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

  • Using operating system command on file receiver comm.channel

    Hi,
    I pepared a XI 3.0 message generating .txt file.
    I must append content of this file to the and of the file with same name but different extension(.bak extension).
    I know it is achieved with copy name.bak+name.txt it appends txt file to the .bak file.
    My problem is: How can i supply name of .txt file to use as name of .bak file?
    How can i do that?
    Thanks.

    /usr/sap/SID......./../../../Server0
    Put the java program there.
    Regards
    Ravi Raman

  • How to call Operating System commands / external programs from within APEX

    Hi,
    Can someone please suggest how to call Operating Systems commands / external programs from within APEX?
    E.g. say I need to run a SQL script on a particular database. SQL script, database name, userid & password everything is available in a table in Oracle. I want to build a utility in APEX where by when I click a button APEX should run the following
    c:\oracle\bin\sqlplusw.exe userud/password@database @script_name.sql
    Any pointers will be greatly appreciated.
    Thanks & Regards,

    Hi Guys,
    I have reviewed the option of using scheduler and javascript and they do satisfy my requirements PARTIALLY. Any calls to operating system commands through these features will be made on the server where APEX is installed.
    However, here what I am looking at is to call operating systems programs on client machine. For example in my APEX application I have constructed the following strings of commands that needs to be run to execute a change request.
    sqlplusw.exe user/password@database @script1.sql
    sqlplusw.exe user/password@database @script2.sql
    sqlplusw.exe user/password@database @script3.sql
    sqlplusw.exe user/password@database @script4.sql
    What I want is to have a button/link on the APEX screen along with these lines so that when I click that link/button this entire line of command gets executed in the same way it would get executed if I copy and paste this command in the command window of windows.
    Believe me, if I am able to achieve what I intend to do, it is going to save a lot of our DBAs time and effort.
    Any help will be greatly appreciated.
    Thanks & Regards,

  • Calling Operating System Commands from PL/SQL using java

    Calling Operating System Commands from PL/SQL - The Java Way
    wlth help of given thread link,
    Calling OS Commands from Plsql
    but i had user privilege problem
    Declare
    x Varchar2(2000);
    Begin
    x := OSCommand_Run('/tmp/sri/GROUP_ho.sh');
    DBMS_OUTPUT.Put_Line(x);
    End;
    o/p;
    can't exec: /tmp/sri/GROUP_ho.sh lacks user privilege
    i done the grant privillage also
    part
    dbms_java.grant_permission('abcd', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    dbms_java.grant_permission('abcd', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    dbms_java.grant_permission('
    abcd', 'SYS:java.io.FilePermission','<<ALL FILES>>', 'execute');
    again
    get
    can't exec: /tmp/sri/GROUP_ho.sh lacks user privilege
    same error;

    Process management at the OS level should prevent execution continuing in the calling code until the command has completed (either successfully or with error).
    If the low level java code were to spawn child process threads then execution could continue, but I'm guessing the Java function your talking about doesn't do that and just calls the operating system to execute the command and waits for the returning code to come back.

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

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

  • File Adaptor....... system command after file processing

    i am creating 2 files with file adaptors..
    lest say a1.txt and a2.txt..
    in the file adaptor i am specifying the path of a batch file which is located at the same location where these 2 files are created......this batch file should run after message processing
    i am using this .bat file to create a file by combining these 2 files and delete these 2 files after that...
    but nothing seems to be happening..after the 2 files are created.
    seems like the command is not getting triggered which it is suppose to after message processing.
    please help

    Hi Tarun,
    Check this blog, Might give u some idea as well...
    <a href="/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions: Command line sample functions</a> By Michal Krawczyk
    <a href="/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi Command - Executing Unix SHELL scripting</a> By Sameer Shadab
    Regards
    San
    Where there is a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/weblogs/topic/16">blog</a> there is a Way.

  • How to call operating system commands?

    Can we call OS commands from JAVA?
    I am trying to call lpr/lp commands from JAVA.
    Can anybody guide me where to search for this information.
    Thanks in advance
    Srini

    Thanks for you all for this information. I will try this....Your information greatly helped me to go forward...

  • Calling  Operating system command  from PL/SQL programs

    Hi
    Is there any way we call the unix shell script from PL/SQL procedure/functions

    In 10g, it is possible.
    BEGIN
    dbms_scheduler.create_job(job_name => 'myjob',
    job_type => 'executable',
    job_action => '/app/oracle/x.sh',
    enabled => TRUE,
    auto_drop => TRUE);
    END;
    SQL> exec dbms_scheduler.run_job('myjob');
    Documentation:
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#sthref6596
    -aijaz

  • 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
    &#9679;      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:
    &#9679;        %f (file name)
    &#9679;        %F(absolute file name including path)
    &#9679;      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.
    &#9679;      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

  • Exeecuting Operating System Commands in Weblogic

    Hi,
    as part of an offline process every time my database gets updated
    I have to call a tool ( Verity ) to create a collection. This is done
    from a Servlet where the Administrator simply clicks on a link and the
    verity collection is built and updated. Hence, whenever the database
    changes I need to call a system command 'mkvdk' to build a collection
    ( a flat file ).
    My servlet is running in Weblogic 4.5. Is it possible to
    execute operating system commands in java running in weblogic ? I know
    it is possible in java using
    Process runProcess =
    Runtime.getRuntime().exec(systemcommand);
    is it possible under weblogic ? because I have tried it and I get an
    I/O error .....
    Thanks,
    Gavin

    Hi.
    Please post the error you are seeing. Also, what JDK version are you
    running, and OS/platform.
    Thanks,
    Michael
    Gavin wrote:
    Hi,
    as part of an offline process every time my database gets updated
    I have to call a tool ( Verity ) to create a collection. This is done
    from a Servlet where the Administrator simply clicks on a link and the
    verity collection is built and updated. Hence, whenever the database
    changes I need to call a system command 'mkvdk' to build a collection
    ( a flat file ).
    My servlet is running in Weblogic 4.5. Is it possible to
    execute operating system commands in java running in weblogic ? I know
    it is possible in java using
    Process runProcess =
    Runtime.getRuntime().exec(systemcommand);
    is it possible under weblogic ? because I have tried it and I get an
    I/O error .....
    Thanks,
    Gavin--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Execute external operating system command

    Hi Friends,
    I have a requirement to run a script file with extention '.PL' on the application server using ABAP.
    i have sample how to run it in XI.
    XI3.0 provides a very simple way of handling this using the "Operating System Command" in the File Adapter.
    I post my output file in the following folder,
    /usr/sap/sapout/test/
    The shell script is available in the following path,
    /usr/sap/bin/convert.pl
    The figure below explains as to how we call the shell script using "Operating System Command".
    File Acess parameters
          Target Directory      = /usr/sap/sapout/test/
          File Name Scheme = TestOutput.txt
    Processing Parameters
         File Construction Mode          = Add Time Stamp
         File Type                              = Binary
         Operating System Command = /usr/sap/bin/convert.pl %F
    I have to do the same thing in ABAP as it has been done for XI as mentioned in the above example.
    My operating system is UNIX.
    If any one can give me a sample it would be really helpful to me.
    Thanks in advance,
    Arundhathi.

    Hi Arundhati,
    You can run operating system commands from ABAP.
    e.g. If you want to change UNIX right for any file, you can use following code.
    lv_ucomm  = 'chmod a+rwx 123.txt'.
    CALL 'SYSTEM' ID 'COMMAND' FIELD lv_ucomm.
    whatever command you provide in Field parameter ( lv_ucomm in the above case ), ABAP run that command at operating system level.
    In your case, you can provide command in lv_ucomm to run script at operating system level.
    Hope it will help you.
    Regards,
    Naren

Maybe you are looking for

  • Can no longer see 2nd computer

    I have Home Sharing set up on two separate computers (MacBook Pro and iMac). Both have separate iTunes accounts. When I first bought the Apple TV this weekend I could see both computers on the Apple TV. Now I can only see the MacBook Pro. I do not kn

  • Variable Selection Screen - Text issue

    Hi, In BEx Query, I have a variable in the Var.selection screen and I cannot have the text displaying corresponding to one of the Variable after providing the value and click the button "Check". - I have checked "Provider-Specific Properties" in RSA1

  • RoboHelp 7 - Most Images Missing of Word 2003 Output

    Does anyone know why my images would stop being displayed 100 pages into a 500-page Word 2003 document? Instead of images (after this point), all I see are tiny green squares. This is after waiting for images to load and formatting the document.

  • How can i syncronize flagged messages from outlook in icloud

    How can i syncronize flagged messages from outlook in icloud?

  • Safari won't start in a particular user.

    Hi. About 2 weeks ago all of the sudden I couldn't run safari on this particular user (other users in my mac work well), when I launched (either form the dock or directly from the app folder) I got the spinning color ball and the safari icon jumping