STOP Program Execution

Hiii Everyone,
How to stop execution of a program depending on a condition.
Depending on a condition given in program, i want to stop the rest program execution. Program execution should be stopped at BADI.
Thanks in advance.
Regards
Sunil

Hi,
   I think the best is to put a break-point inside the method and check if it's executed or not
I think the best is to put a break-point inside the method and check if it's executed or not
Regards
Kiran Sure

Similar Messages

  • How can I stop the execution on a JSP page and start it again

    Hi
    I am making a program that simulates how to manage transactions when accessing a database by using locks. I have run into a problem and I hope someone has the time to help me.
    When a user does an update the transaction commits and releases its locks when the program executes
    <%stmt.executeUpdate("commit!"); %>
    I need to put a break in to stop the program executing this statement, to illustrate the lock is set correctly.
    I have tried to put in an alert box but this does not prevent the rest of the java code being executed.
    I have tried to use prompt boxes, JavaScript functions, but these functions cannot have any java code in them.
    I have tried using the java.swing JOptionPane boxes but this didn?t work either
    I have tried to get input from the user but I don?t know how to retrieve this data on the same page. (As far as I know you have to use submit and even refresh the page or retrieve it on the next page).
    Does anyone know how I can stop the execution on a JSP page and start it again (on same page)
    Mette

    I already have another client (Tomcat jsp application) running and it throws a SQLException correctly when I don�t put in a commit=true statement and don't close the database connection.
    But the problem is how to get the code above to stop to illustrate I have set this lock.
    I have tried to use the JOptionPane but because my program is running in a web browser I cannot use the JOptionPane dialog box.
    I have tired using an alert box but it executes the commit statement before the alert box is dispayed. So this does not work
    While (i < 2)
    if( i==1)
    %>alert(�The transactions commits when you press Ok�); <% //what it to stop execution here
    else
    stmt.executeUpdate(�commit�);
    I am not using threads so I cannot use the sleep function.
    I am using mysql and have already configured it to detect deadlocks and how long to wait for locks.
    Thanks for your help
    Mette

  • How do I pinpoint the program execution?

    Hi all,
    I am wondering how to pinpoint the program's execution point?  I have a problem with all of the loops not stopping properly.  I hit the "Hilight Program execution" and it went to one loop, that is, it appeared greyed out, but I can't figure out which case it's stuck in.  Is there a way to find the exact *point* of execution?
    Thanks,
    Jason

    You can use breakpoints. The program will pause as soon as it hit the breakpoint. To add breakpoints, right-click in the place where you want it and set it. You can also set probes. The probes activate as soon as the information is available. Then you can be creative with the highlight execution, breakpoints and probes. You can have a fairly good idea on how your program is executing.
    Otherwise, try posting your code or an image of your code so we can try to figure out what is going on.
    www.vartortech.com

  • How to stop program excecution...

    Hi..
    I would like to know how I can stop the execution of a program, not using System.out.exit(..). I do not want the application be closed.
    Let me be more specific..
    My program reads text from a file and depending a condition (ie. if the length of the string is > 10 , a counter is incremented , errors++ ) and I want that when errors > 20 the program stops... I use a Class that inherits from Exception class and I use it to catch when errors > 20, but the program does not stop until the end of file in reached...
    just a message is shown (ie. Too many errors...)
    This is a very general idea of my program...
    /*class constructors and call to starts method*/
    public void starts(){
    int errors;
    String line;
       /* another declarations */ 
      while (!myFile.eof()){
        readString();
    public void readString(){
        /* code...
        line=myFile.readLine();
        if(line.length()>10){
           try{
             countErrors();
           }catch(MyException e){
             System.out.println("Too many errors " + e);
    public void countErrors()throws MyException{
        if((++errors)>20)           
           throw new MyException(errors);   
    class MyException extends Exception{
    int error;
         public MyException(int e){
              error=e;
         public String toString() {
             return "MyException[" + error+ "]";
    }An also, I use recursion in another calls to other methods so, I need solve this problem...
    Any help will be useful...thanks
    carrillomx

    instead of throwing an exception you could just check amount of erros in the while loop and ...
    if(errors > maxerrors)break;
    this will exit your while loop and stop the reading of the file.. so it wud look like :
    public void starts(){
    int errors;
    String line;
    /* another declarations */
    while (!myFile.eof()){   
    readString();
    if(errors > 20) break; checks to c amount of errors and then breaks
    // the break will then quit the while loop and cancel the file
    // being read without quiting the program
    public void readString(){   
    /* code...
    line=myFile.readLine();
    if(line.length()>10) errors++;

  • How to stop an execution from a method and thread?

    1,
    public void method(){
    if( something is true)
    //I want to stop this method
    //or if something is false, go on
    blablablablabla
    }Does any one know how to solve the above??
    2,
    Thread t = new Thread(){
    public void run(){
    if( something is true)
    //I want to stop and kill this Thread
    //or if something is false, go on
    blablablablabla
    }Again, how do I solve the above??
    I know this is very simple, but I just hit a wall when I encounter this on making a program for my project.
    please help
    thanks alot

    warnerja, for the method, I have tried "return" but
    it does not work... will it work on the run method of
    thread object??
    Secondly, doesn't "break" keyword only stops the
    execution of a loop/condition, but not the method's
    scope??yes. break breaks the loop. I thought your method doesnt have any other code except the condition.
    use return with thread.

  • Error out the ABAP program execution

    I have an ABAP program which transfers data from a file to a database table thru function module in packages of 50,000 records.
    Upon the successful completion of this ABAP program, I start dependent processes.
    Sometimes the function module does not transfer the data and returns the exception back to the ABAP program - which is an expected scenario. Currently when ever an exception is received in the function module, I stop the ABAP program with a STOP statement.
    The ABAP program stops, which meets my first objective. But what happens is, if you look at the job log --> it is Completed in terms of program execution and the dependent processes automatically start - which is not meeting my second objective.
    My second objective is to force the ABAP program to error out in such a way that .........
    1) The program execution is stopped
    2) If I look at the job log it should not be Completed (I am looking for something like Cancelled so that the dependent process do not get started automatically)
    Is it possible to error out the ABAP program execution by raising an exception or something, so that when i look at the job log - it shows Cancelled and not Completed?
    Let me know if you have any questions.
    Thanks,
    RK.

    Adrian,
    Thanks - This is exactly what I was looking for, it works.
    For some reason Messages skipped my mind and I was looking at raising Exceptions
    Solution:
    if sy-subrc NE 0.
      message id 'abc' type 'E' number 000.
    endif.
    Thanks,
    RK.
    Edited by: RK on Jan 17, 2010 7:47 PM
    Edited by: RK on Jan 17, 2010 7:50 PM
    Edited by: RK on Jan 17, 2010 7:52 PM

  • How to pause program execution?

    I'm developing a board game. It has the Board class, Coin class and Dice class.
    The dice class has an animation to show the dice rolling. The coin class also has an animation to show the coin moving from start square to end square.
    When user clicks on the dice the sequence of steps that take place are -
    getRandomNumber();
    dice.roll();
    coin.move();
    But the problem I'm facing is even before the dice rolling animation stops, the coin moving animation begins.
    How can I pause the program execution so I can move to next line in program only when the animation in the previous is stopped?
    or How can I change the logic so that it goes as desired.

    Timelines (well, actually KeyFrames) have an action variable, where you can put a function doing whatever you need to do at the end of the key frame.
    So, you can make your coin to move at the end of the dice animation (ie. calling coinAnimation.play() in the action of the last key frame of diceAnimation).

  • Stop the execution of main for 2 more seconds

    hi,
    I would like to stop the execution of the main program for few seconds and resume again.
    i tried
    try
                        this.wait(90000000);
                   catch(Exception e)
    but did not work
    could some give any other suggestions
    thanks
    jag

    Also, it's better to catch the specific Exception that the Thread.sleep method throws.
    (InterruptedException)
    And it's usually good to output any exception messages, so you can see what's going on.
    Instead of empty catch brackets, it's better to write e.printStackTrace();
    (where e is the name of your caught Exception...)
    cheers!
    lutha

  • Interrupting program execution

    Hello, I want to interrupt/stop my program execution when a certain button is clicked. I want to implement the cancellation button in another GUI which is independent of the parent GUI that contains my running thread. However, when i invoke "Thread.currentThread().interrupt()" to cancel, it doesn't seem to work, and neither does "Thread.currentThread().stop()" of which I understand stop is deprecated. Any help will be appreciated.

    call setEnabled(false) on the enclosing window. Maybe I'm over-simplifying things, but it could work in certain situations. For e.g.,
    import java.awt.BorderLayout;
    import java.awt.Window;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    public class SetEnabledTest {
      private static void createAndShowUI() {
        final WindowOne winOne = new WindowOne();
        JFrame frame = new JFrame("SetEnabledTest");
        frame.getContentPane().add(winOne.getMainPanel());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
            createAndShowUI();
    class WindowOne {
      private static final String DISABLED = "Disabled";
      private static final String DISABLE = "Disable for 5 seconds";
      protected static final int DISABLE_TIME = 5000;
      private JPanel mainPanel = new JPanel();
      private JButton controllerBtn = new JButton(DISABLE);
      public WindowOne() {
        controllerBtn.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            final Window win = SwingUtilities.getWindowAncestor(mainPanel);
            if (controllerBtn.getText().equals(DISABLE)) {
              controllerBtn.setText(DISABLED);
              win.setEnabled(false);
              new Timer(DISABLE_TIME, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                  win.setEnabled(true);
                  controllerBtn.setText(DISABLE);
                  ((Timer)e.getSource()).stop();
              }).start();
        JPanel bottomPanel = new JPanel();
        bottomPanel.add(controllerBtn);
        JPanel topPanel = new JPanel();
        topPanel.add(new JTextField(10));
        topPanel.add(new JButton("Button"));
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(topPanel, BorderLayout.NORTH);
        mainPanel.add(bottomPanel, BorderLayout.SOUTH);
      public void setEnabled(boolean enabled) {
        Window win = SwingUtilities.getWindowAncestor(mainPanel);
        win.setEnabled(enabled);
      public JPanel getMainPanel() {
        return mainPanel;
    }Edited by: Encephalopathic on Mar 12, 2010 3:11 PM

  • Stopping programs (multiple loops)

    i have a statemachine that includes some while loops in given
    states.  these states sit there 'looping' untill defined
    conditions are met, like a certain time is reached, and then execute
    some more code, before changing to next appropriate state. what i want
    to be able to do is stop the program execution (from front panel
    button), regardless of it's current state, i.e not having to wait for
    loop to finish before stop button is picked up on and program actually
    stops. this delayed stop is the only one i've managed to get to work,
    and even then i end up introducing some error messages depending on how
    i do it. any pointers much appreciated.
    cheers in advance.

    VeeJay wrote:
    Effectively, is the structure polling every 100ms for an event to occur vis'-a-vis' STOP, if not, the code executes?
    This old example is somewhat unusual because both event structures have a timeout event to do something at regular intervals. This is often not needed. You can have an event structure with all real events and it will just be sitting there unless one of the events is triggered.
    Typically only zero or one of all event structures has a timeout event. An event loop without a timeout will do nothing at all unless an associated event is triggered. There is no polling.
    For example you could have a small event loop that only reacts when a cursor is moved in order to synchronize the cursor of another graph. An example can be found here. There could be a small event loop that monitors key presses. All these indepdendent event loops need to stop when the stop button in your main interactive loop is pressed. All they need is a stop event, they don't even need the terminal (or local variable) of the stop button.
    LabVIEW Champion . Do more with less code and in less time .

  • Is there anyway to reset the GPIB driver during program execution?

    Is there anyway to reset the GPIB driver during program execution?

    The issue at hand is that a thread is executing a series of tests which may or may not be making GPIB calls at any given time. The thread may be killed at any time with the function CmtTerminateThreadPoolThread (due to the user pressing the stop button on the GUI). Cooperative thread termination is not an option since a test may cause the thread of execution to lock up the system. The problem is that there may be outstanding GPIB calls at the time that the thread is stopped. These calls time out and generate run-time errors usually via the GPIB function ibrd. The motivation is to completely stop the GPIB driver while the thread is being killed, after which it can be re-initialized. Ideally.

  • I am trying to stop programs from opening automatically when I turn my computer on.  I tried system preferences users and groups login items...then I deleted them from the list but it did nothing.

    I am trying to stop programs from opening automatically when I turn my computer on.  I tried system preferences>users and groups>login items...then I deleted them itunes and emial from the list but it did nothing.  They continue to open up every time I turn on my Macbook Pro.

    Hi r,
    It sounds like you're running Lion?
    Have you tried running Verify and/or Repair Disk?
    Have you tried running Repair Permissions?
    Do you have at least 15% free space available on your HD?

  • Concurrent program execution Error

    i have genrated a simple report and copied to linux server,could any on help me how to resolve the error.Eventhough I was Getting the output.
    ERROR:
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 4349601.
    Review your concurrent request log and/or report output file for more detailed information.

    I have copied the message from the logfile itself for complete reference,plz look in to the following error
    ERROR
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    APPLLCSP Environment Variable set to :
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.UTF8
    Enter Password:
    Report Builder: Release 10.1.2.0.2 - Production on Wed Jun 4 16:36:01 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 4349601.
    Review your concurrent request log and/or report output file for more detailed information.
    Executing request completion options...
    Output is not being printed because:
    The print option has been disabled for this report.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 04-JUN-2008 16:36:02
    ---------------------------------------------------------------------------

  • Date format changes in the middle of a program execution

    In my C code I have a series of select statements.
    When I first get a session to the database I use the following command to set the date format
    alter session set nls_date_format = 'MM/DD/YYYY HH24:MI:SS'
    It works fine for a few queries. After a while during the program execution I see that the date format changes to 'DD-MON-YY' format. This results in a series of error in my code because I expect the date format to always be in the 'MM/DD/YYYY HH24:MI:SS' format.
    Any idea why the date format should change all of a sudden in the middle of the program execution.

    I second the idea that you should always use TO_DATE and TO_CHAR if you want to reliably convert between dates and strings.
    Without seeing your code, it is hard to say why your date format is changing, but the most likely reason is that you are changing users somewhere in the code. For example:
    SQL> show user
    USER is "OPS$ORACLE"
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-JUL-2003
    SQL> ALTER SESSION SET nls_date_format='dd-Mon-yyyy hh24:mi:ss';
    Session altered.
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-Jul-2003 10:15:12
    SQL> connect jtest/test
    Connected.
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-JUL-2003TTFN
    John

  • Program execution during RIMODAC2..will it  always reach to cif user exit

    Hello ,
    We are implementing cif user exit for Purchase Order at R3 side to capture additional date field. So logic to capture additional date field is put in user exit CIFPUR01. We have  RIMODAC2  background job for Purchase order running on daily basis.
    if there is no change in standard Purchase Order objects. When RIMODAC2 is executed  for purchase order Integration models ..will  program execution still always reach to R3  user exit part of the program irrespective of if  any change in standard purchase order object has happened or not.
    Will appreciate your answer.
    Thank you
    Best Regards
    Nilesh Patil

    Nilesh,
    I am no longer sure I understand the question.
    RIMODAC2 activates the model.  Once a model is activated, if someone changes certain specific fields in an R/3 object, then these changes are sent to SCM, either immediately or via change pointers.  All this happens irrespective of IM userexits.
    If this same field in this same object is changed in R/3, and a userexit also has been implemented, the  userexit will execute according to its design,  performing whatever task it has been programmed to do.
    If you create and implement a userexit, it begins working at that moment in time that it is installed.  Data that flowed across 'yesterday' to SCM is not affected.  Data that flows across 'tomorrow' will be affected.  Data in R/3 will usually only flow across to SCM if there is some kind of triggering event, usually a database 'change' transaction (e.g., ME22N for POs) The mere act of installing a userexit will not generally affect existing data on either side.  The userexit only affects data that flows across the IM. Unchanged records in the R/3 database will generally not be sent to SCM by the IM, and will not be subject to userexit processing.
    It is not generally the responsibility of a functional consultant to explain the workings of a userexit to a technical consultant.  It is enough that the functional identifies the userexit, and specifies the business requirement in as much detail as possible.  The developer is then responsible for carrying out the coding.  Technicals are generally expected to be competent enough to determine from the userexit docs, and from the surrounding code, how a userexit works.  They can also raise a message to SAP.  In the end, it is all just ABAP, although userexit implementations can be quite challenging. SAP seldom provides enough details in their documentation.   Once the Technical has finalized the code, Functional and Technical together then perform unit testing, before passing the mods to users for integration testing.
    If your client's coders are unable to manage the task, perhaps they should engage your company to provide technical expertise, as well as functional expertise.
    Best Regards,
    DB49

Maybe you are looking for

  • Email size issue in SAP

    How we need to send bigger file size than configured. Recieved part of document, not more than 2 MB. Please asses the issue here and tell me solution to fix the issue please.

  • Error while using .jar file instead of class file.

    Hello friends, I created a java class which are referred and called from other jsp\xml and java files. I compiled this java class and everything is working properly. However, I do not want to use class files but want to use jar files instead. So, I c

  • Project wise Inventory Management

    Hello My client is in construction business. Following is the existing business process he follows : 1. Material is procured from the vendor and receive in inventory and then o demand it is released from the inventory to site of the project.  (this s

  • My apple id has been disabled how i can enable it??

    my apples id has been disbled how i can enable it ?

  • Online comments

    Hey guys, I would like more information regarding the 'online comments' feature available in Acrobat version 5 and above. This online commenting appears to be achieved by WebDAV. I want to know the server side implementation details - what configurat