Get return code in command line

Hi,
Is possible modify or get return code diferent 0 or 1 when start scenario using command line?

i use control+M, and result with erros in E$, send to "hospital" whit this

Similar Messages

  • Return Code after Command Line (File Adapter)

    Hello all,
    i execute in the File Receiver Channel a Shell Script.
    Now i need a solution, when an error happens. The script returns an error code and i want that the Adapter Monitor is showing this information/error.
    How can i enable this?
    Or is there an other possibility to monitor this??
    many thanks for your help
    ilka

    Hi IIka,
    I have not tried this but I think
      The return code of the script cannot be shown in monitor, because the call ends (does not expect a response) once the file adapter is called.
    May be you can capture the errors in a seperate file and
    use that as a log.
    I am not sure if there is anyother way
    also check this blog /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Regards
    Vishnu

  • Error Getting return code while FTPing file through JAVA

    Hello experts
    My requirement is to send file to Mainframe server in a JOBQ.I used a socket to connect to server. A designated FTP ID is provided for authentication.
    I tried to FTP file to mainframe sever, but while getting return code from server, i m recieving Junk values.I am reading return code through BufferReader.readline().
    I have set up the connection mode to ASCII mode.I tried to set up the connection mode to EBSIDIC mode too, but i revieve the same error.
    Any one have tried to FTP file to mainframe in got the same error.What could be the possible reason.
    Here is the error looks like :-
    Inside SocketClient() class, in connect(String hostname, int port) socket = Socket[addr=xxx.xx.xx.com/xx.xxx.xx.xx,port=21,localport=2500]
    Inside SocketClient() class, in connectAction() method (InputStream) input = java.net.SocketInputStream@696fc610
    Inside SocketClient() class, in connectAction() method (OutputStream) output = java.net.SocketOutputStream@695b8610
    Inside FTP class, in __getReply() method _controlInput = java.io.BufferedReader@15370617
    Inside FTP class, in __getReply() method Line = ��&�&#63641;����(��&����/������<�������<&#63641;��|(?>
    Any help in this topic is appriciated
    Regards
    Samit

    This is the third party API's i have used
    http://www.enterprisedt.com/downloads/ftp.html
    download this.
    Version 1.2.1 (Jan 29, 2003). Download here. (tar.gz format. WinZip will unpack this). Compiled/tested for JDK1.4.x. Will work for 1.3.x etc

  • Error in LSMW getting return code 6

    Hi all,
                 i Am getting a  Error in LSMW getting return code 6 , after asign a file , in the read data step i am getting the error , please help me it is very urgent,
    sridhar

    Hi,
    If the Sy-Subrc is 0 then Success, if the Sy-SUBRC is 4 then failure, if the Sy-SUBRC = 6 then the user might be not access to read the file
    AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the necessary authorization, otherwise 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause
    Regards
    Sudheer

  • Getting return code as 1 for SD_SHIPMENT_PROCESS_HU

    Hi All,
    Could you please tell me what is the use of SD_SHIPMENT_PROCESS_HU function module.
    I am debugging one standard program in that after processing  this FM in  SD_SHIPMENT_PROCESS Function module getting return code is 1.
    Could you please tell me,what might be the reason.
    Thanks in Advance.
    Regards,
    Rama.

    Hi Rama,
    if you will look into the specified function module
    CALL FUNCTION 'SD_SHIPMENT_PROCESS_HU'
      IMPORTING
        e_logfile =                 " v56e_logfile
      CHANGING
        c_activities =              " v56e_shipment_activities
        c_shipment =                " v56e_shipment
      EXCEPTIONS
        ERROR = 1                   "
    so if you are getting returned code as 1, it means there is any error.

  • Sending commands through Telnet - possible to get return code?

    I have gotten a little program working that will telnet to another server and run commands using Jakarta Commons net (which underneath it all uses a socket). I was wondering if I run a perl script remotely on the other machine, and the perl script returns a code (0, 1, etc) , is it possible to capture that return code? So far it is just sending commands back and forth through text...

    Write yourself a script that invokes those commands and either echo's the exit code to the command line or saves the exit codes to a file.

  • *"Wrong process return code"* Unix Command

    Hi,
    I have created Package with Procedure having Unix command.Unix command is only to cp data file from one folder to another archive folder.
    we are defining variable FilePath and FileName.
    cp #FILE_PATH/#FILE_NAME.tag #FILE_PATH/archive/;
    But while running this we are getting following erorr.
    *"Wrong process return code"*
    Plz suggest.
    Thanks
    Ashwini

    Hi Aswini-
    You should not use # symbol for your variable pointers, it will take as a comment line. Please use the below syntax:
    FILE_PATH=c:\temp
    FILE_NAME=test.txt
    cp $FILE_PATH/$FILE_NAME.tag $FILE_PATH/archive/
    And also you can check the exact error by executing the script file in your unix command prompt like this:
    /home/test/test.sh
    Hope this will work for you.
    Thanks,
    Saravanan Rajavel

  • Getting return code from remote script after Unix rsh call

    I hope one of you guys can help me with this issue. I think I've gotten the 'rsh' command to work from the CES application so that the sqr report generation can execute on a remote machine (instead of the app server machine). I'm actually doing this by having the app still execute the ces_sqr script, however, now the ces_sqr script will just have an 'rsh' command in it which will cause the actual real sqr processing to occur remotely.
    I am executing a Unix script which does a remote shell call to another script on a remote machine. The remote script sends a return code when run locally, however, how can I get the calling rsh script to get that return code?
    If I do the following in the rsh script:
    rsh -l resdev morph "/dev/bin/remote_script"
    rc=$?
    echo "$rc\n"
    then the return code that I get is not actually the return code from the remote_scrpit, but it is the return code from the rsh command that is 0 (success) because the rsh command actually executed successfully even though the remote_script could've returned something other than success. How can I get the return code from the remote_script passed back to the rsh calling script?
    Jan Miller
    [email protected]
    202-237-9584

    Please ignore the first paragraph of my previous post.

  • Code for command line

    Hello everyone,
    I have a SQL SSIS package that I would like to trigger
    through Cold fusion. I looked into SQL help, it said that using
    "dtexec" at command line will work. My question is: how do I get
    Cold Fusion do a command line job? What is the sytext/code for
    that?
    Thanks in advance.

    Lei Hu wrote:
    > Hello everyone,
    > I have a SQL SSIS package that I would like to trigger
    through Cold fusion.
    > I looked into SQL help, it said that using "dtexec" at
    command line will work.
    > My question is: how do I get Cold Fusion do a command
    line job? What is the
    > sytext/code for that?
    >
    > Thanks in advance.
    >
    The <cfexecute...> tag allows ColdFusion to run command
    line code. It
    can take a lot of trial and error to get that to work
    properly. User
    permissions of the ColdFusion server standard output versus
    standard
    error, version of ColdFusion are all potential hickups with
    this type of
    code.
    Take it slow, one step at the time is the best advice I can
    give you for
    using <cfexecute...>.
    Ian

  • Getting return code from subprocess execution

    Hi,
    I am executing a batch file as a subprocess and need to get the return code from it.
    The batch file executes a java class, which exits (System.exits(rc)) with a return code on error and how this can be captured in the calling program.
    i am calling the batch file as follows: (fragment)
    Runtime r;
    process p = r.exec(execCmd, null, mqsiToolFile);
    istr = p.getInputStream();
    br = new BufferedReader(new InputStreamReader(istr));          
    returnCode = p.waitFor();
    System.out.println("exit value: "+p.exitValue());
    This successfully executes the subprocess and always returns with code '0', even though the sub-process exits with a code >0.
    p.waitFor() or p.exitValue() - doesn't giving the exit value of the subprocess.
    How can i capture the exit value (System.exit(rc)) from the sub-process.
    I am running the app on Windows NT4 sp6
    Any help would be greatful.
    Thanks in Advance.

    Peter,
    can u be more explanative on this, i can see the run time result (0, 1). But couldn't get familiar on the sample you have given.
    My code is as follows:
    Process p = null;
    Runtime r = Runtime.getRuntime();
    for loop {
    execSubProcess(.., .., ..)
    public int execSubProcess(String excmd, String[] env, File fileDir) throws Exception {
    int res = 0;
         try {
              System.out.println(excmd);
              p = r.exec(excmd, null, fileDir);
              istr = p.getInputStream();
              br = new BufferedReader(new InputStreamReader(istr));
              line = null;
              while ((line = br.readLine()) != null) {
                   System.out.println(line);
              res = p.waitFor();
         System.out.println("sub-process return code: "+p.waitFor());
              System.out.println("sub-process exitValue: "+p.exitValue());
         } catch (Exception e) {
         throw e;
         return res;
    Here i get all the time 'res=0' , even though the subprocess execCmd exits with a return code > 0.
    Is tehre any environment setup or ..needed to capture the subprocess exit code val (System.exit(rc)) in the calling program.
    Please provide more details as per ur convinience.
    thanks

  • Get multiple values from Command-Line

    Can any body tell how can I do this�
    When I input a number, then I should be able to insert that number of lines (rows). Note that number
    of columns is always 4.
    I.e.: If I put number 3 in command-line, It should be like this & then exit from the program.
    3
    apple 10 20 30
    orange 60 50 70
    grapes 80 120 50
    If I put 5, It should be like this,
    5
    one 54 57 67
    two 78 21 54
    three 89 22 69
    four 78 32 99
    five 89 21 11
    Note that the user should be able to type these values (one 54 57 67) that is after he press enter
    he should go to the next line & able input, Values (two 78 21 54) �like wise...Then after he
    completes 5 row, he should exit from the program.
    Can any-one help!...
    .

    Please stick to your original thread. You're already getting help there.
    http://forum.java.sun.com/thread.jspa?threadID=700811

  • Xjc in code - not command line

    I'm new to java xml, and may be wanting to force a square peg through a round hole but, I would like to create source files using xjc from dtd's and xjs's from datasources or other basically non file based sources. Am I looking at the wrong tool? I don't want to write the dtd's and xjs's to disk and then compile through a command line.
    Thanks
    fj

    Thanks Danny,
    I've read through the pdf's got the example to work as well as many in the java_xml_pack-spring-02-dev. Wipped up a proof of concept database, some JDBC classess, and a servlet. Went through XML Hell with Tomcat 4, then deleted the xerces from the common folder, changed some classpath statements and the example works being triggered from a servlet. Then I gabbed DTD, XJS, and XML content like so
    (1) a couple prepared statements
    first statement to retrieve an xml file from the database
    "SELECT XML_NAM, XML_CNT " +
    "FROM XML_CNT_JAXB "
    second one to retrieve the DTD and XJS content from a database
    "SELECT INFO_DTD_CNT.DTD_CNT, INFO_XJS_CNT.XJS_CNT " +
    "FROM INFO_DTDXJS_BLD " +
    "INNER JOIN " +
    "INFO_DTD_CNT ON INFO_DTDXJS_BLD.DTD_ID = INFO_DTD_CNT.DTD_ID " +
    "INNER JOIN " +
    "INFO_XJS_CNT ON INFO_DTDXJS_BLD.XJS_ID = INFO_XJS_CNT.XJS_ID " +
    "WHERE (INFO_DTDXJS_BLD.DTD_BLD_NM = ?)"
    (2) execute and get results
    ResultSet resultSet = sqlXML_CNT.executeQuery();
    etc..
    (3) place resultset XML strings in an InputStream
    sbin_XML_CNT = new StringBufferInputStream(str_XML_CNT);
    etc..
    (4) now it works fine if you already used xjc to create your java classes and compile... then you can just use the BufferedInputStream to build your trees
    buildTrees(StringBufferInputStream bIn)
    foo = foo.unmarshal(bIn);
    etc...
    (5) what I don' want to do with the DTD and XJS is stream the content write the file to disk and execute commands to build the java files..
    Process myXJC = Runtime.getRuntime().exec("myXJC.bat");
    Again I'm new to Java XML, but if people want to use an XML file that does not have a DTD or XJS within a system, say they are requesting a new content area, the app then gives them a screen to define the DTD or builds a DTD for them or whatever, and then asks them for the content they want to manipulate or reports or whatever, and them creates an XJS, Java classes are then built compiled and someone can test and approve them... etc then save them to disk, database, a distributed server,.. etc
    I'm sure there is a way to compile Java from within a application. what I'm not sure of is if there is a way avoid the Java -jar %JAXB_HOME%\lib\jaxb-xjc-1.0-ea.jar file.dtd file.xjs -d directory from command line.
    If you could point me to any articles or book chapters address this, I'd really appreciate it!
    Thanks
    fj

  • Getting Return Code for cl_gui_frontend_services= execute

    Hey,
    im using the static method cl_gui_frontend_services=>execute  to start a program locally. The program is openens synchronously and i need to get the return code of the program. I mean not the one from the method-call but from the external tool on OS-level.
    Is there a way to get that one ?
    Thanks and regards,
    oliver

    well seems there is no way...solved it now over a result-file which is get written by the called tool and later read by sap.

  • How to execute some code in command line, and read its output?

    I'v found here http://www.sap-advisor.com/abap-coding/how-to-execute-operating-system-commands-from-within-sap/ that I can execute commands from the windows command line for example inside SAP.
    But I want to take it one step further and read its output. is it possible?

    Hi RagnaRock,
    one possible approach can be outputting the results of the command into a text file (i.e. "command >result.txt"), and then read this file from SAP/ABAP.
    I hope this helps. Kind regards,
    Alvaro

  • Getting user name (at command line argument)

    At the beginning of my program I need to prompt for the user name and then follow this with a welcoming message. Please help as I have not yet learnt this in my studies!

    When prgramming java, and surely when learning it, alway use the documentation. You ken find it @ http://java.sun.com/j2se/1.3/docs.html To do input and output with the console you need the java.lang.System (Doc are @ http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html ). The system object has an open inputstream called in wich reads the standard input, normally what users type on the console. So System.in.read() will get you a char that is typed on the console.
    In your case it might be easier to create a BufferedReader.
    BufferedReader input = new BufferedReader(System.in); will create a buffered reader that reads from the console. The advantage is that you can now use input.readLine() to read a complete line (until return key is pressed).
    Succes
    AVee

Maybe you are looking for