Problem in execution of Operating System Command

Hi
I am trying <b>OS command in Reciever File Adapter</b> but the command is not executing.In my scenario i am creating a file by reciever adapter and then this OS command will delete,rename..etc to this file.For this i had created a <b>Batch file</b> in which i had given OS commands, so once this batch file will execute the command should work.File is getting created but OS command is not executing.I am giving the command in the adapter as follows:
<b>//Server-name/directory/Test.bat</b>
i had tried giving command like this also
<b>D:\directory\Test.bat</b>
but there is no result.i read somewhere that this function works on SP9 or above.We are also working on SP9 but.....
Do i have to make some settings for this function.
If you have some solution then please help me.
Thanx in advance.
Regards
Arpit Seth

Hi,
In help.sap.com (http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm), it is given as
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)
Are you using like this?
rgds,
Sasi

Similar Messages

  • Problem with zip operating system command

    Hello,
    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.zip %F
    The execution is succesful, but i have a small problem. The file name is "file.txt.zip", 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 "file.zip" With a file inside in txt format...
    Thanks,
    Luis

    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 file.txt.zip file.zip
    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.
    Regards,
    Luis

  • CCMS Auto-React: Operating System Commands

    Hi Gurus,
    I want to run an operating system command in the event that an alert is raised in my CEN CCMS system.
    I have set up the operating system command in SCEN (using SM69) and tested it -- no problems. I have used the example given on help.sap.com. It works great from SM69 or SM49.
    I have created a custom MTE Auto-Reaction Method that is a copy of the SAP standard and it points to the logical name of the op system command I created in SM69.
    But, when I assign the Auto-Reaction method to an MTE and kick off the auto-reaction, nothing happens. I have tried assigning it auto-reaction method as a method for a local MTE and also as a central auto-reaction, but I get nothing.
    Please help me see what I am missing.
    Many thanks in advance,
    Nic Doodson

    Hi Michael,
    Thanks for the response, I hope you can help.
    Logical command is called: Z_NI_ALERT_OVO
    It calls the operating system command: /usr/sap/tmp/test.sh
    It allows additional parameters.
    test.sh is :
    #!/usr/bin/sh
    echo $2 alert from $1 Message $5 $4 > /usr/sap/tmp/alert_$3.txt
    I can run this from SM49/SM69 and it works fine.
    Method is: Z_SEND_ALERT_TO_OVO
    Calls function module: SALO_EXECUTE_SYSTEM_COMMAND_V2
    Can be executed on: Any Server
    Execution Method: Periodically in Dialog Process
    Parameters:
    COMMAND : Z_NI_ALERT_OVO
    PARAMATERS : <blank>
    REACT_ON_ALERTS : red
    MTENAME : SID/SEGMENT/CONTEXT/OBJECT/ATTRIBUTE
    PARAMLIST_1: COLOR DATE_TIME MSG
    PARAMLIST_2: ID
    Help!
    I can only think there is something about it being a local/centrally distrubuted auto-reaction method...I'm assigning it as a cenrally distributed auto-reaction method.
    Any input would be great.
    Cheers,
    Nic

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

  • Operating System Command in JDBC Sender

    Hello everybody,
    I'm trying to find some syntax to execute an operating system command on Windows Server 2003, but the commands don't seem to work I'm actually trying to generate a directory, now the problem is that I can't find syntax examples on how to do this I tried something like MKDIR TEST, now is the syntax of the command lines as you write them in Command Prompt, or maybe there is my error, thanks in advance.
    Regards,

    Confirmed.
    JDBC sender also support OS command.
    Refer to note 841704 if you face any issue while executing OS command in JDBC adapter.
    Note: OS Command execute when processing in database executed successfully. It is even independent on OS command Errors.
    Thanks
    Farooq
    Edited by: Farooq Farooqui on Jan 16, 2009 11:36 AM

  • 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

  • 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

  • Vista: use the windows program manager to execute operating system commands

    attempting to run forms 6 on vista... the forms app attempts a call sqlplus using the host builtin to populate some tables before calling the report.
    in windows vista i get a message box indicating "use the windows program manager to execute operating system commands".
    is this windwos vista message? would this have to do with permissions?
    any insight most appreciated and thanks in advance.

    I don't know about the HOST-problem, but..
    the forms app attempts a call sqlplus using the host builtin to populate some tables before calling the report.What about putting the logic from the SQL*Plus-scripts into a database-procedure and call that instead. I think,, with the current approach you will get problems at least when you have to migrate to Web (e.g. Forms 10g).

  • External Operating system Commands -GPG

    Hi Experts,
    Im quite new in SAP and we have a task to encrypt a file generated from SAP for upload to bank. We use  the external operating system commands to call the gpg commands for file encryption. But we encounter an error when we execute the command
    below is the error we encounter
    gpg: [Recptient's ID]: skip : public key not found
    gpg: [Filename] : encryption failed : public key not found
    but when I run the command on OS level it execute properly without any problem.
    hope you guys could me an idea on how to fix the issue i encounter
    Thanks in advance!!

    Louie,
    What is the command that you used? which OS?
    Thank you
    Regards

  • How to use Operating System Commands while using define in sqlplus

    How to use Operating System Commands while using define in sqlplus . The Host OS is Linux
    define report_name=PROD_${host date "+%b"}.html
    The above is not working.
    The output should be 
    define report_name=PROD_JAN.html
    Regards,
    DB

    of course I was talking nonsense: the problem here is the mixing of bind variables and DEFINE variables.
    With the following changes the script should work (the conditions for begin_interval_time are perhaps not what you want):
    variable snap1 number
    variable snap2 number
    variable rptname varchar2(20)
    begin
    SELECT min(snap_id) into :snap1 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    SELECT max(snap_id) into :snap2 FROM dba_hist_snapshot WHERE CAST(begin_interval_time AS DATE) >= SYSDATE-1;
    end;
    col file_name_value new_value report_name noprint
    select 'PROD_'|| to_char(sysdate,'MON') || '_' ||  to_char(sysdate,'DD') file_name_value  from dual;
    define  report_type  = 'html'
    define num_days=2
    define begin_snap=:snap1
    define end_snap=:snap2
    @@?/rdbms/admin/awrrpt.sql

  • How to execute operation system commands by using TSQL without enabling xp_cmdshell.

    Hi Experts
    Looking for advise if one can use operation system commands using TSQL without enabling xp_cmdshell. 
    actually using xp_cmdshell requires sysadmin privs which I am unable to provide (directly or using proc) to a user  but the user needs some operating system commands to execute for file manipulation from sql server session. Please share your thought.
    Best Regards 
    khalil

    >but the user needs some operating system commands to execute for file manipulation from sql server session
    See article here
    http://www.mssqltips.com/sqlservertip/2014/replace-xpcmdshell-command-line-use-with-sql-server-agent/:
    "Problem
    I need to run something from the command-line, but based on best practices xp_cmdshell has been disabled. The task that needs to run is an internal process that will originate from within SQL Server. Is there a way to do this without using xp_cmdshell?
    Solution
    The use of xp_cmdshell is generally frowned upon and is now recommended to be disabled, unless it is absolutely necessary.  There is a solution that works around this restriction via the use of SQL Server Agent.
    Wherever SQL Server is installed, SQL Server Agent is installed with it (except for SQL Express). SQL Server Agent has the ability to run job steps which invoke the command shell. And in the case that the job is owned by a member of the sysadmin fixed server
    role, the job will execute as the service account under which the SQL Server Agent is running. "
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • 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

Maybe you are looking for

  • SSO from Non-SAP portal to EP

    Hi. We need SSO from Non-SAP portal to EP. The Non-SAP Portal has publish Form-based authentification. I mean userid&password set to URL. Then the EP can generate SAP Logon ticket to backend system? regards,

  • Memory question

    I have a couple of questions about memory. 1. I have Corsair TwinX XMS PC3200 2x1024mb. settings at corsair are 2.5-3-3-6 It shows up in speedfan as:         FSB-DRAM................. CPU/14  CAS# Latency............. 3.0 clocks  RAS#to CAS# Delay...

  • IMic and OS X

    I picked up an iMic a couple of weeks ago. And set up was a snap. Shows up in System Prefs / Sound, with the level control. And sound was fine. I haven't used it in about a week and half. And couple of days ago, it no longer works properly (used it w

  • Can you help me, i try to import video from my gopro to final cut pro but when i play the video he become very slow and i lose qualiter

    can you help me, i try to import video from my gopro to final cut pro but when i play the video he become very slow and i lose qualiter ???

  • Creating HELP in application

    I have a form where certain fields are required. These fields appear as links. When I place the mouse over the name of the required field, a question mark appears. When I click on the label, another window opens and says there is no help for this fie