Shortdump while calling UNIX command

Hi all,
I have a problem while trying to remove a file in UNIX platform in ABAP program.
It is working fine in the development and quality server, but not in production server.
Based on the debug result, the shortdump was thrown while executing "CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command".
Below are the message return in the program shortdump
How to correct the error                                  
    You can check the authorization beforehand with the   
    function module AUTHORITY_CHECK_C_FUNCTION.           
Short text                                            
    No authorization to call the C function "SYSTEM". 
DATA: lv_command(100) TYPE C,
        client_path LIKE RCGFILETR-FTAPPL,
        server_path LIKE RCGFILETR-FTAPPL.
  DATA: wa_files  TYPE rsfillst,
        it_files  LIKE TABLE OF wa_files.
  CALL FUNCTION 'SUBST_GET_FILE_LIST'
    EXPORTING
      dirname      = gv_unix
      filenm       = '*'
    TABLES
      file_list    = it_files
    EXCEPTIONS
      access_error = 1
      OTHERS       = 2.
  IF  sy-subrc = 0.
    LOOP AT it_files INTO wa_files WHERE TYPE <> 'directory'.
      CONCATENATE wa_files-dirname wa_files-name INTO server_path.
      CONCATENATE p_fname wa_files-name          INTO client_path.
      CALL FUNCTION 'C13Z_FILE_DOWNLOAD_ASCII'
        EXPORTING
          i_file_front_end    = client_path
          i_file_appl         = server_path
          I_FILE_OVERWRITE    = 'X'
        EXCEPTIONS
          FE_FILE_OPEN_ERROR  = 1
          FE_FILE_EXISTS      = 2
          FE_FILE_WRITE_ERROR = 3
          AP_NO_AUTHORITY     = 4
          AP_FILE_OPEN_ERROR  = 5
          AP_FILE_EMPTY       = 6
        OTHERS                = 7.
      IF sy-subrc = 0.
        concatenate 'rm -f' server_path into lv_command separated by space.
        condense lv_command.
        CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command.
        CLEAR: lv_command.
      ENDIF.
    ENDLOOP.
  ENDIF.
Anyone knows why and how to resolve this?
Kindly provide your feedback and input. Thanks in advance.

You don't have authorisation in PRD to remove files. If it is really required for you.
Take SU53 screen shot  immediately once you get short dump and follow up with Basis Folks for required authorisation.
Thanks,
Raj

Similar Messages

  • ASAP:stored proc calling Unix commands

    i want an Oracle stored procedure to call unix commands as well as do sqlldr ... opern.
    requirement is :
    the stored procedure needs to do :
    for all files in a Directory:
    do
    { .. use sqlldr to insert data in tbls
    .. move the processed file into another directory
    so,for ls &mv commands i need the Command/way out.
    null

    Hi Jorma,
    It's been a while since I did it, but I successfully did what you
    are trying to do. All I did was "load" the remote interface and
    "stub" class into the database using the "loadjava" utility. My
    environment was Oracle 8.1.7 on SUN (Sparc) Solaris 7.
    Although I haven't tried it, you may be able to invoke a servlet
    from your java stored procedure. The advantage over RMI is that
    you don't need to generate and load a "stub" class. Naturally, you
    would use the "java.net.URLConnection" class to invoke a servlet
    on some web-server/servlet engine which you can communicate with
    using "streams" -- java.io.InputStream and java.io.OutputStream
    Also, I understand that there is now a "oc4jclient.jar" (not 100%
    sure of the name) file that can be "loaded" into the database,
    which allows you to contact EJB's in Oracle's OC4J product. I
    think you can either do this directly, or indirectly using JMS
    over Oracle AQ.
    [JMS = Java Messaging Service]
    [AQ = Advanced Queueing]
    Good Luck,
    Avi.

  • Call unix command in sqlplus script

    Hello, I wanna to know how to call a unix command in the sqlplus script.
    For exemple,
    I've a sqlplus script to lauch a oracle report, after the report is generated, I wanne to replace the output file in an other directory.
    So that, I have to call the unix command mv here in the sqlplus script
    How can I do it?**
    I completed my situation:
    I don't have dbms_scheduler untility in my database.
    Thanks a lot for your help
    Edited by: user11930885 on 17 janv. 2010 14:53

    Yes, at the begining, I'll tried the unix shell by calling SQL.
    I've the problem of passing the parameters through.
    It seems to me
    we can use
    Host in the SQLPLUS to run the unix command.
    but I've written it in my sqlplus script, it doesn't work. so I wanna to find an exemple how to use HOST in sqlplus script?
    I would have loved to give you an example..but its not unix on my laptop.
    But what i can tell you is...u should be doing otherway round.
    Not calling Unix commands from SQL but calling SQL's form unix.
    You got shell scripts for that.
    Write a shell script. Login to SQL execute your code.
    exit from sql and then move your file with MV. That's it.
    Do post how far you get after trying this.

  • Call Unix Command From Reports Using Java

    Hi,
    Could somebody please show me a sample coding to call Unix command from 10g report using java?
    In metalink doc id 361857.1 does not show much.
    Thanks,
    neemin

    Hi,
    I have a problem with synchronization of the java commands.
    In the Before Parammeter Form trigger, I have:
    function BeforePForm return boolean is
    rt ORA_JAVA.JOBJECT;
    proc ORA_JAVA.JOBJECT;
    v_txt varchar2(32000);
    i integer := 0;
    v_cd_modulo int;
    v_arqlog text_io.file_type;
    cursor c_evento is
    select codigo,
    nome
    from
    (select e.cd_evento || e.cd_edicao codigo
    ,nm_evento nome
    from grh_ev_evento e
    where e.CD_GRUPO in (select cd_grupo
    from grh_ev_adm
    where cd_usuario = (select cd_usuario
    from usuario
    where login_usuario = :AUTHID)))
    order by substr(nome, 11);
    begin
    -- Create the context for logged user
    if instr(upper(nvl(:AUTHID,'RWCLIENT')),'RWCLIENT') > 0 then
    :AUTHID := :SSO_USUARIO;
    end if ;
    TCEENV.SET_TCEENV(:AUTHID);
    if PK_SCA.SCA_GET_USER_RIGHTS(:sca_module_name, :AUTHID) IS NULL then
    srw.message(100, 'Access denided!');
    return (FALSE);
    end if;
    -- Create file in Report Server (UNIX)
    v_txt := '<BR>' || htf.formSelectOpen('P_EV_EDICAO', 'Evento: ');
    :p_file := '/u03/SCAWEB/repout/' || :sca_module_name || '_' ||
    pk_sca.sca_encrypt(:AUTHID || to_char(systimestamp, 'ss.ff'));
    v_arqlog := text_io.fopen (:p_file, 'A');
    text_io.put_line (v_arqlog, v_txt);
    for reg in c_evento loop
    i := i + 1;
    if i = 1 then
    v_txt := '<OPTION SELECTED VALUE="' || reg.codigo || '">' || reg.nome;
    else
    v_txt := '<OPTION VALUE="' || reg.codigo || '">' || reg.nome;
    end if;
    text_io.put_line (v_arqlog, v_txt);
    end loop;
    v_txt := '</SELECT></CENTER></form></BODY> </HTML>';
    text_io.put_line (v_arqlog, v_txt);
    text_io.fclose (v_arqlog);
    SRW.SET_AFTER_FORM_HTML(SRW.FILE_ESCAPE, :p_file);
    rt := RUNTIME.GetRuntime();
    proc := RUNTIME.exec(rt,'rm ' || :p_file);
    return (TRUE);
    end;
    The problem is that there isn't a "synchronize" command, and the
    RUNTIME.exec(rt,'rm ' || :p_file) don't works (it does nothing) because
    the SRW.SET_AFTER_FORM_HTML has a large delay and the following
    command is ignored.
    How can I solve it?
    thanks,
    lmprestes

  • Call unix commands from stored procedures

    My stored procedure requires to call unix commands HOW DO I DO IT?
    null

    i do not know pl sql but in java you can use:
    Runtime.getRuntime().exec("YOUR UNIX COMMAND");
    real example:
    Runtime.getRuntime().exec("ls");
    but you must be careful with using that...
    especially if you want to wait till the process finishes..
    rgds,

  • Calling unix command in Apex Window

    I am working on a small project where in; it would be handy to run an external plsql in oracle database which calls for unix command such as tail -f alert.log or tail -1000 alert.log when a button is pressed in the application.
    I know the client and server aspect and very difficult to forward the server output to Application specially web based but still thought of trying my luck to get some insights from this forum .
    Is this possible in Apex ?
    UK

    Don't see why not. All the building blocks are there (assuming a recent version of the database, and that 1000 is a realistic metric of the data volume):
    1. A script to run the required UN*X commands.
    2. An initial log extract file created manually using the script.
    3. An external table on the log extract file.
    4. An external scheduler job to rerun the log extract script to refresh the log extract.
    5. An APEX page with a report based on the external table, and a button that calls the external job.
    Note that providing relevant information when asking a question is helpful in determining a solution:
    - APEX version
    - DB version and edition
    - Web server architecture (EPG, OHS or APEX listener)
    - Browser(s) used
    - Theme used
    - Templates used

  • Calling UNIX command from PL/SQL Procedure

    Is there a way to call a UNIX command (exa. ls) from within a PL/SQL stored procedure? Looking through the various packages, I didn't see anything that would give me this ability.
    I also looked through all the previous questions and nothing looked encouraging.
    Thanks in advance,
    Russ

    Russ,
    I thought I'd read a similar question awhile ago and did a search on the word host in this forum and found the following from July 9th that might help you:
    http://technet.oracle.com:89/ubb/Forum88/HTML/001611.html
    In that post I think the link listed by Barbara Boehmer in has changed to:
    ]http://asktom.oracle.com/pls/ask/f?p=4950:8:24579::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:16212348050,{host}
    It looks like they give solutions for Oracle 7, 8 and 8i.
    Good site Barbara, I've added it to my bookmarks.
    Hope this helps.

  • Calling unix commands

    is it possible to execute UNIX commands from database procedures, say i'm trying to call the logger utility of unix? this procedure is not called from forms it runs at the backend only.
    thanks,
    victor

    Check it out at : http://www.dbasupport.com/forums/showthread.php?threadid=3703
    http://www.dbasupport.com/forums/showthread.php?threadid=2688
    null

  • Problem while executing unix command having \&\& symbol

    Hi All,
    Please check the below program while is not executing, when the unix command's having \&\& is used.
    The following command copies the src folder to dest folder with out data loss ...
    import java.io.*;
    import java.util.*;
    public class Sample
      public static void main(String[] args)
         try {
              String ExCmd     =     "ssh [email protected] cd /u01/11510/devdb/9.2.0/slax \\&\\& /bin/tar cf - . | ssh [email protected] cd /d01/AppsTest/testappl2 \\&\\& /bin/tar -xf - > test.log";
              System.out.println("Command to execute : "+ExCmd);
              Process SshProc = (Runtime.getRuntime()).exec(ExCmd);
            // any error message?
              StreamReader errorStream = new StreamReader(SshProc.getErrorStream(), "DEBUG");           
            // any output?
              StreamReader outputStream = new StreamReader(SshProc.getInputStream(), "OUTPUT");
            // kick them off
              errorStream.start();
              outputStream.start();
              int pp =SshProc.waitFor();
              System.out.println("command execution value: "+pp);
         }catch(Exception e) {
              e.printStackTrace();
    class StreamReader extends Thread
        InputStream is;
        String type;
        StreamReader(InputStream is, String type)
            this.is = is;
            this.type = type;
        public void run()
            try
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null) {
                    System.out.println(type + ">" + line);   
            } catch (IOException ioe)
                ioe.printStackTrace(); 
    }When this is executed iam getting process value as "0".
    But nothing is copying to target ..
    So to resolve this i have created a script .. and passed arguments to that script and chaged command as follows :
    String ExCmd = "sh /home/juser/movedir.sh [email protected] /u01/11510/devdb/9.2.0/slax /bin/tar [email protected] /d01/AppsTest/testappl2 /bin/tar /home/juser/test";
    Then it is executing fine. But in my scenario iam restricted to use scripts.
    So plz can any body have a solution for this.
    Thanks, SN

    Iam unable to execute command with &&, it's executing fine only from \&\& ... Can any body tell me how can we make below code as generic, depending on UNIX Shell environment?
    String[] ExCmd     = {"sh", "-c", "ssh [email protected] cd /u01/11510/devdb/9.2.0/slax \\&\\& /bin/tar cf - . | ssh [email protected] cd /d01/AppsTest/testappl2 \\&\\& /bin/tar -xf - > test.log"};
    Process SshProc = Runtime.getRuntime().exec(ExCmd);"sh" should be changed here depending on UNIX Environment, because previously i found that in some unix environment's "sh" is not working ..
    So can any one help...
    Thank in advance.

  • Calling Unix command from the plsql

    Hi ,
    I am executing java code from the UNIX Shell script. Before executing this command i want to write plsql code to and pass the files to java command.
    In the plsql code i want to select request id's using the cursor and find the .out files for each request id in the outfile path. once the file is found i want to copy that .out file to the current directory where the java command is going to execute.
    Please suggest me how to use UNIX Command (in my case "cp") to copy the .out file from the outfile path to current directory after opening the cursor.

    If I understand you correctly, you want to generate a log of request id's from the database and send this to the operating system whereby you will execute the following:
    <p>
       <font face="courier">java org.apache.xalan.xslt.Process -XSL combinedfsg.xsl -OUT output.xml</font>
    <p>
    If that is correct, then you should be able to perform all of this w/ PL/SQL by generating the log from the database and write it to the O/S w/ UTIL_FILE. If you want to execute the java code at this point, you should be able to utilize Tom's method with the following:
    <p>
       <font face="courier">exec rc('java org.apache.xalan.xslt.Process -XSL combinedfsg.xsl -OUT output.xml');</font><p>

  • Newbie: how to handle pipes and semicolons while launching UNIX commands?

    Good afternoon,
    I am trying to write a Java class that can launch UNIX commands.
    Launching simple commands (date, ps -ef) works fine, but when I start using pipes and semicolons, it goes wrong:
    Java code (pipe example):
            String command = "ps -ef | grep config";
            Process child = Runtime.getRuntime().exec(command);Result:
    usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
            [ -u userlist ] [ -U userlist ] [ -G grouplist ]
            [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
      'format' is one or more of:
            user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
            pri opri pcpu pmem vsz rss osz nice class time etime stime
            f s c lwp nlwp psr tty addr wchan fname comm args projid projectJava code (semicolon example):
            String command = "date;ps -ef";
            Process child = Runtime.getRuntime().exec(command);Result:
    date;ps: not foundClearly the pipes and the semicolons are handled by the UNIX shell and cannot be put in the Java source code as such.
    Does anybody know a way around this?
    Thanks
    Dominique

    Pipes and semicolons are interpreted by a shell (bash, csh etc) and when one executes as you are doing no shell is involved. This is easy to solve by using the alternate version of exec() which takes an array as an argument and to use your shell of choice. For example :-
    String[] command = {"bash", "-c", "date;ps -ef"};Note that the third argument is the whole of the command to be interpreted.
    Two points to consider. First you should read, digest and implement all the recommendations in http://www.javaworld.com/jw-12-2000/jw-1229-traps.html; failure to do so will at some point lead to significant loss of hair. Second you should probably use ProcessBuilder rather than Runtime.exec(). Behind the scenes Runtime.exec() uses ProcessBuilder but ProcessBuilder provides a better interface with more features.

  • How to Move file / call UNIX command using ABAP Program

    Hi, ABAP Guru.
    I need to Cut & Paste file (Move file from one location to another location) on Network Shared Drive using ABAP program.
    But I can't figured out how to do this and what ABAP Command / FM / Method (and maybe UNIX command) that being used.
    Please give me the advice.
    Best regard and Thank you all.
    Nattapash C.

    all methods for your requirements should be in class CL_GUI_FRONTEND_SERVICES

  • Calling UNIX Command from another server using ODIOScommand utility

    Hi,
    My unix script 'runmanger'  is on another server say 'St23456wer' under  /u10/DV2/ofsaa/fic/xxx/bin. I want to call this 'runmanager' using ODIOSCommand. My ODI agent is installed on different server. I can ping 'St23456wer' server from ODI server. How can I call this unix script.

    My only experience with this is connecting to source files on a remote linux server and the two options I was presented with were 1) creating a mount to make the files 'local', or 2) set up a new agent on the remote server.
    One of the gurus may have a better answer for you.

  • ASAP: How a stored proc calls OS(unix)Commands

    urgent!!
    My stored procedure requires to call unix commands HOW DO I DO IT?
    my rqrmnt is :
    stored proc is :-
    1.for each file in a directory($ls)
    do
    2.sql stmnts of insert etc
    /OR
    use sqlldr for the same.
    done.
    ** how do i do both the operations 1&2 in the same Oracle procedure?

    I know HOST can be used in form for OS command but I never thought about doing OS command in the stored procedure.
    Hmm...........
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected] ... ([email protected]):
    urgent!!
    My stored procedure requires to call unix commands HOW DO I DO IT?
    my rqrmnt is :
    stored proc is :-
    1.for each file in a directory($ls)
    do
    2.sql stmnts of insert etc
    /OR
    use sqlldr for the same.
    done.
    ** how do i do both the operations 1&2 in the same Oracle procedure?
    <HR></BLOCKQUOTE>
    null

  • Call an interactive UNIX command from java

    Hi,
    I want to call a UNIX command from java. When issue the command 'htpasswd -c filename username' on UNIX terminal, it asks for the new password and the then confirmation password again (yeah, unfortunately the htpasswd installed on our system does not allow you proivde the password on the command line. So have to work interactively ). Now, I have written a simple java program RunCommand.java. I am hardcoding the password for the htpasswd command in the file (in the real situation, password will be generated dynamically). I want to issue 'java RunCommand' on the UNIX command line and get back the command prompt without being asked for the password twice. The code is below, but the Outputstream does not work as expected. It always asks for inputs. Any idea? Many thanks.
    import java.io.*;
    public class RunCommand {
    public static void main(String args[]) throws Exception {
    String s = null;
    try {
    String cmd = "htpasswd -c filename username ";
    // run a Unix command
    Process p = Runtime.getRuntime().exec(cmd);
    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    OutputStream stdOut = p.getOutputStream();
    String pswd = "mypassword";
    while ((s = stdInput.readLine()) != null) {
         s = stdInput.readLine();
         stdOut.write(pswd.getBytes());          
         stdOut.flush();
    System.out.println("Here is the standard error of the command (if any):\n");
    while ((s = stdError.readLine()) != null) {
    System.out.println(s);
    stdOut.close();
    stdInput.close();
    stdError.close();
    System.exit(0);
    catch (IOException e) {
    System.out.println("exceptions caught: ");
    e.printStackTrace();
    System.exit(-1);

    There are only about 9 billion responses a day on how to do this. Use the search feature.

Maybe you are looking for

  • Where are the shortcuts?

    Is there a place I can go to get a comprehensive list of Windows shortcuts for Photoshop CS5?  If so where? tex

  • OS Migration from AIX to SUSE Linux

    Hi All, We are having a scenario in which we want to change our OS. First we have AIX with oracle 10.2.0.4 and SAP ECC 6.00 which we want to change into new hardware with SUSE Linux with same Oracle and ECC 6.00 So we are planning to do Oracle Offlin

  • How do I create a script to crop the channels within specific limits defined by me?

    Hi, I am trying to automate processing of my channels, but as a first step I need to crop them within specific boundaries (all data at once). Kindly let me know any specific script commands which would help me in doing the same. Solved! Go to Solutio

  • Can you drag photos/elements into PSE 9.0 on Mac

    hello, I just switched to a Mac and am using PSE 9.0. Can you drag photos or elements into the project bin? I can't seem to figure it out and it's frustrating me, I could just open my files in my computer on my PC and drag what I wanted in. How do yo

  • ++ Type, brush, crop, lasso etc tools broken on Leopard ++

    Apple released OS 10.5.2, which resolves the known issue that numeric values to set sizes for the brush, crop, marquee, lasso, type, and other Photoshop CS3 tools, revert to previously entered values when you try to apply them. Go to Apple's knowledg