Call System Command

I am executing the following command from a abap program to execute a Unix Script. The script executes successfully but it comes back to the program with a sy-subrc return code of -1????? Anyone have any ideas? We are on 4.6c
Thank You
*&      Form  EXECUTE_UNIX_COMMAND                                     *
form execute_unix_command.
CALL 'SYSTEM' ID 'COMMAND' FIELD app_script
               ID 'TAB'     FIELD TABL-SYS.

Hi Joe,
Check the Below program, you will get this program in latest versions from 4.6c...
RSBDCOS0---->subroutine EXEC
look OSS Note 9391 for more info
Regards,
Srinivas

Similar Messages

  • How to call systems commands

    Hello guys,
    I will like to know if there is a way of calling system command and shell commands in windows without making use of the Runtime Class in java.
    Also when ever i call a system command or shells commands from my java application using the runtime class, it open the a new shell(Command Prompt) before executing the command.
    I await your response. Thanks in advance.
    Joe.

    How about this? http://onesearch.sun.com/ClickThru?qt=without+command+window&url=http%3A%2F%2Fforum.java.sun.com%2Fthread.jsp%3Fforum%3D31%26thread%3D440546&pathInfo=%2Fsearch%2Fdevelopers%2Findex.jsp&hitNum=2&col=devforums

  • How to call system command in vc++?

    i wish to call the netsend command in the program but i dont know how to do it? can you please show me the actually of calling net send command in the way of mfc?

    Take a look at the Win32 CreateProcess, ShellExecute, and ShellExecuteEx functions.
    - Elton

  • How to call system command to launch Windows Explorer

    Hello,
    I'd like to open the windows explorer from java.... anyone know how this is done?
    thanks

    thanks for ur reply.
    i get the following exception when i run the code provided...
    java.io.IOException: CreateProcess: iexplore.exe error=2
         at java.lang.Win32Process.create(Native Method)
         at java.lang.Win32Process.<init>(Win32Process.java:66)
         at java.lang.Runtime.execInternal(Native Method)
         at java.lang.Runtime.exec(Runtime.java:566)
         at java.lang.Runtime.exec(Runtime.java:428)
         at java.lang.Runtime.exec(Runtime.java:364)
         at java.lang.Runtime.exec(Runtime.java:326)
         at Run.main(Run.java:5)
    Exception in thread "main" also, i needed a way to open exploerer to a preset directory. do i just append the directory location before the iexplore.exe ? anyone? thanks

  • Executing call system from sqr

    We've got a number of SQRs executing a Call System command, but this one (actually 2) won't execute.
    let $sender_cmd = '/usr/bin/sudo /usr/sbin/usermod -c "Human Resources Administration " appuser'
    call system using $sender_cmd #sender_status WAIT
    #sender_status is returned with a value of 1
    This is supposed to allow "appuser" to change the server email sender to "Human Resources Administration ". When the sqr is about to end, it changes it back to the original value.
    I've tried putting the string in a shell script and executing it, but it fails that way too.
    Any suggestions?

    BTW the command runs fine from the command line (Linux 5.0)

  • Calling the system commands in Java

    Hi All,
    How to call the system commands in java other than using
    exec() function.For eg, in my linux machine i have used p.exec("exit") to exit from a cshell to the prompt but it is not working.Is there any other solution for this one. Pls. do provide a solution for this.It is quite Urgent.
    Thanks,
    m.ananthu

    Why not SEARCH THE F*ING FORUMS!! This has been answered SO MANY TIMES

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

  • 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

  • Experts call a operating system command

    Hello,
    I have following question about experts.
    It is possible with OMBPLus or experts call a operating system command e.g svn checkout?
    It would great if you give me a example!
    goodbye

    Hi
    You should be able to use the tcl exec command to call svn command....
    for example;
    exec C:\\Program\ Files\\Subversion\\bin\\svn help
    Cheers
    David

  • How to execute a system command with call executable in teststand 4.2.1?

    Hi All,
          how to execute a system command with "call executable" step in teststand 4.2.1?
          example as i want to quit a application.using "taskkill /f /im xxx.exe".And execute other system command(DOS).
    BR
    Johnny

    Hi, 
    I want to run netstat -an | find "8080" command from command prompt using call executable in test stand. after that i would like take the std output to local variable. 
    Attachments:
    callsettings.jpg ‏404 KB

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

  • Call a linux or a system command

    How can I call a system command from a javabean?
    I need to check if a link to store server is mounted in a linux system, and
    a I wrote an sh file to create the mount back.
    How can i call this sh file from a javabean?
    Thank's a lot

    Look at Runtime.getRuntime.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html

  • CALL 'SYSTEM' ID 'COMMAND'

    hi:
    constants:comm(90) value 'sh /usr/rvs/export/TNT2K7F/script/FRC12K7F.sh'.
      call 'SYSTEM' id 'COMMAND' field comm.
    can you tell me the  role of the sentence ,ths
    regards
    sophia

    Hi,
    'sh /usr/rvs/export/TNT2K7F/script/FRC12K7F.sh' is a unix command to run a unix script, and normally you would have to log on to the operating system to run this.
    call 'SYSTEM' id 'COMMAND' field comm calls this command from ABAP, meaning your SAP user can run a report which also runs the unix script.
    Regards,
    Nick

  • Call 'SYSTEM' id 'COMMAND' field w_runstring

    Hi All,
    This system command is throwing error , filling sy-subrc with value 1-.
    Can anyone tell why?
    Thanks,
    Shaily

    Was the file actually moved?  In certain releases Call 'SYSTEM' id 'COMMAND' .... returns -1 even though the command was issued successfully.
    If you want to apply error handling take a look at SAP note 677435 which explains the supported methods for calling o/s commands.  As Call 'system'... is not actually supported it can do unpredictable things.
    Regards,
    Nick

  • CALL 'SYSTEM' ID 'COMMAND'  cannot be used

    Hello,
    We were just told that with the latest kernal we are going to apply, we can no longer use the following command:
    CALL 'SYSTEM' ID 'COMMAND' FIELD CMD(250)
    We are thinking of using this function to replace it:
    CALL FUNCTION 'SXPG_CALL_SYSTEM'
    Does anyone have any other suggestions on other options we might have?
    Thanks!

    Bill,
    We are using function module SXPG_CALL_SYSTEM in our 4.7 system and it works fine.

Maybe you are looking for