How to exit from method if there is any Error message

Hi All,
I have one button (Retrieve) and on that button I am calling a method(OnRetrive) and in that method i am calling func module and in that i am getting some messages.
<b>Now If that FM gives Error message then i have to exit from that method without processing further code.</b>
How can i do this? Help!!!
Expecting your reply ASAP.

Use the RETURN statement. It will get out of your method.
Regards
Nithya

Similar Messages

  • Exiting from sqlplus when there is any errors while compiling pl/sql progra

    I am connecting to sqlplus from unix and I am executing a pl/sql script . Now if I get some error while compiling a procedure, package, function or any sql statement I want to exit sqlplus.
    whenever sqlerror works only for sql statements but not for plsql
    I dont want to query user_errors table and then throw some exception depending on the same .
    Is there any command available or any easier way to solve this problem ?

    Those errors we get only when there is conflict in same etc.
    Now consider the example here
    sample.sql
    whenever sqlerror exit failure ;
    declare
            s1 long;
    begin
            s1 := 'create or replace procedure proc1 as '||
              'declare '||
              'begin '||
                  'end; '||
              'end;';
            execute immediate s1;
    end;
    select 1 from dual;When I run the script
    SQL> @sample.sql
    ERROR:
    ORA-24344: success with compilation error
    ORA-06512: at line 9
    Warning: PL/SQL compilation errors.
             1
             1Actually I want to get out before it executes select means once it throws error in pl/sql.

  • How to use the VBS MoveFolder methode in DIAdem without any error message?

    Hi,
    I want to move folders with the VBS MoveFolder methode, but in DIAdem I run in problems. When I use the following comman    fso.MoveFolder(project_folder & test_folder, project_folder & test_folder & "\" & test_ & " " & test_count) 
    I get error message
    "During call a sub routine no parentheses are allowed!"
    When I remove the brackets and use    fso.MoveFolder project_folder & test_folder, project_folder & test_folder & "\" & test_ & " " & test_count 
    I get the error message
    "Invalid sub routine call."
    How I have to use the command right?
    (the text of error messages is free translated from German Version of DIAdem 11.0! Take only the sense, not the exact wording!)
    Thanks for help.
    Regards
    Sven

    Hello Sven!
    Just add a 'Call' at the beginning of your first line will solve the syntatic error. I recommend always to use 'Call' and parenthesis.
    But there is a fundamental problem in your code: MoveFolder moves a folder from a source to a new destination and the old source folder will be deleted. You try to move a folder to a location below the same folder. If the MoveFolder wouldn't recognize these situtation and throws an error all of your data would be deleted!
    Just print out your paths in a Messagebox to clearify the situation.
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • How to exit from a WebDynpro ABAP application and open another url

    Hi Friends,
    How to exit from a WebDynpro ABAP application and open another url like (www.yahoo.com) in the same window of the WD4 application on click of a Button?
    Regards,
    Xavier

    Hi,
    First of all you should create outbound plug in the window you are trying to exit with plufg type "Exit"
    Then create method handler in the view with this code
            data lo_view_cntr type ref to if_wd_view_controller.
            data lo_win_cntr type ref to if_wd_window_controller.
            data: l_parameter_list type wdr_event_parameter_list,
                  l_parameter type wdr_event_parameter,
                  l_val type ref to data,
                  l_val_url type REF TO data.
            field-symbols: <fs> type any,
                           <fs_url> type any.
            lo_view_cntr  = wd_this->wd_get_api( ).
            lo_win_cntr = lo_view_cntr->get_embedding_window_ctlr( ).
            CREATE DATA l_val type c.
            CREATE DATA l_val_url type string.
            ASSIGN l_val->* to <fs>.
            ASSIGN l_val_url->* to <fs_url>.
            <fs> = 'X'.
            <fs_url> = 'http://your-link.com'.     
            l_parameter-name = 'URL'.
            l_parameter-value = l_val_url.
            INSERT l_parameter INTO TABLE l_parameter_list.
            lo_win_cntr->if_wd_view_controller~fire_plug( EXPORTING plug_name = 'EXIT_PLUG'
                                                                    parameters = l_parameter_list ).
          You can easily change this logic to exit application instead of redirecting to the site
           just changing to
           l_parameter-name = 'CLOSE_WINDOW'.

  • How to exit from whileloop with Timing Delay

    Hello;
    How to exit from forwhile with timing wait (10s) before finish 10s by stop botem;
    exemple ; first impulsion to start a while loop with 10 s wait ,before finsh a 10s second impulsion to stop the while loop; in labview 2010
    best regrds
    Forza Juventus

    Show us the code you currently have.  Just repeating your specification word-for-word is not going to help us to understand you problem.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to exit from a loop on 2 different conditions

    Hello Experts
    I’m trying to write a procedure in which I’m taking PROVINCE as an input parameter. All the provinces are stores in a table. I’m using a cursor and rowtype variable to check the province. After I finds province I displays province and its code. Everything works fine expect when I don’t find the province. I’m not sure how to exit from loop if I don’t find the province. I already uses exit when condition. I was expecting else condition should work and should exit from the loop but it doesn’t. Can please somebody show me how to exit if I don’t find province in the table through cursor.
    Here is my code
    set serveroutput on
    variable G_TAX varchar2(10)
    CREATE OR REPLACE PROCEDURE p_create(i_state VARCHAR2)is
    CURSOR cur_bb_tax is
    select * from bb_tax;
    bb_tax_details bb_tax%rowtype;
    begin
    if not cur_bb_tax%isopen then
    open cur_bb_tax;
    end if;
    loop
    fetch cur_bb_tax into bb_tax_details;
    if (bb_tax_details.state = i_state) then
    dbms_output.put_line(bb_tax_details.state || bb_tax_details.idstate);
    end if;
    exit when bb_tax_details.state = i_state;
    end loop;
    close cur_bb_tax;
    exception
    when others then
    dbms_output.put_line(SQLERRM);
    end;
    Thanks in advance

    Hello,
    Why don't you use dbms_output.Put_line and print output to find why logic is not able to execute? Maybe upper case/lower case/whitespace. *Also put your code between \ to preserve formatting*.
    Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to exit from the button test in diagnostic mode

    Hi,
    I am having some trouble with my ipod 7th gen.
    First my lightning cable wont be recognize. show the error Accesory incompatible.
    I try to solve the problem cleaning the golden pins in the cable and in the ipod. Don't work
    I enter in diagnostic mode in my ipod and I get stucked in the button counter test..
    In the screen appear a mesage 'Please reset the unit to end'. I don't know how to reset the unit
    I press any button and only increase the counter for every button.
    First how acan exit from the button counter test and how can fix the issue with the lightning cable

    Your problem is that you are trapped inside an event case. It is not a good idea to run extended code inside event cases, else the event structure cannot service other events.
    Why don't you use the outer loop for everything? Now things don't step on each others toes. What good is an event structure if it cannot react at all times???
    Message Edited by altenbach on 07-25-2008 12:26 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    event_problemMOD.vi ‏17 KB

  • How to exit from the loop

    loop at itab.
    if <CONDITION>
    <EXIT LOOP>
    endif
    endloop.
    this ths condition , pz tel how to exit from loop

    Hi
    Loop
       statements
    EXIT
    Endloop.
    Will comes out of the loop.
    Regards,
    Sreeram Kumar.Madisetty

  • How to exit from loop after 3  time

    hi
    how to exit from loop after 3  time
    loop at itab.
    <exit after 3 time>
    endloop.
    thanks

    Hi,
    You can check the value of SY_TABIX inside loop,
    For Example:
    Loop at itab.
    if sy-tabix  = 3.
    Exit.
    endif.
    Endloop.
    Hope it helps
    Regrds
    Mansi

  • How to Exit from Session by executing program

    How to Exit from Session by executing program

    Hi,
    Try the following
    CALL the function module HLP_MODE_CREATE and pass '/nex' to tcode import parameter.
    Regards,
    Sesh
    Message was edited by: Seshatalpasai Madala

  • How to exit from recovery mode?

    how to exit from recovery mode?

    You could try a hard reset
    - hold the home button and the sleep/wake button down at the same time
    - the phone will turn off, when the apple logo appears release both buttons
    More than likely after this you will still be in recovery mode. If so then you would need to restore the phone through itunes on a pc/mac.
    Hope this helps

  • How do I check if there is an error message?

    WIth
    <h:message for="something"/>
    I can display the (error) message for "something".
    How do I check if there is a error message fomr "something" in a JSF page?
    I am asking cause I want to use an other styleClass for an h:inputText field.
    Can there be something like:
    <h:inputText styleClass="${messages.something.error ? errorstyle : normalstyle} ...
    Thnaks for any answers

    Here you can find the code of my solution to the question.
    Hope it can be useful...
    Note: The existence of the nested class the names of the attributes
    have been chosen only to make the Faces JSP more "human readable"...
    in the faces-config.xml
    <managed-bean>
      <managed-bean-name>decorate</managed-bean-name>
      <managed-bean-class>package.Decorate</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    at the end of your jsp page (as last component in the page)
    <h:inputHidden value="#{decorate.inputs.onerror}" />
    the "decorator"
    public class Decorate {
         * @return Returns the inputs.
        public Input getInputs() {
            return new Input();
         * @param inputs
         *            The inputs to set.
        public void setInputs(Input inputs) {
        public class Input {
             * Decorates all the components of the Faces JSP that have at least one
             * associated message.
            public String getOnerror() {
                FacesContext context = FacesContext.getCurrentInstance();
                UIComponent root = context.getViewRoot();
                decorate(context, root);
                return "";
             * Decorates the specify components and all its children recursively.
             * @param context
             *            the current <code>FacesContext.</code>
             * @param node
             *            the component to decorate.
            private void decorate(FacesContext context, UIComponent node) {
                Iterator it = context.getMessages(node.getClientId(context));
                if (it.hasNext()) {
                    try {
                        Method getStyleClass = node.getClass().getMethod(
                                "getStyleClass", new Class[] {});
                        String style = (String) getStyleClass.invoke(node,
                                new Object[] {});
                        style = (style != null) ? style + " message" : "message";
                        Method setStyleClass = node.getClass().getMethod(
                                "setStyleClass", new Class[] { String.class });
                        setStyleClass.invoke(node, new Object[] { style });
                    } catch (Exception e) {
                        e.printStackTrace();
                for (Iterator iter = node.getChildren().iterator(); iter.hasNext();) {
                    decorate(context, (UIComponent) iter.next());
             * This method has been exposed only to comply to the <i>JavaBeans
             * architecture </i>.
             * @param onerror
            public void setOnerror(String onerror) {
    how it works:
    The core of the class is the decorate(FacesContext, UIComponent) method:
    for each component on the current view I simply test whether the component
    has got a setStyleClass method, therefore I don't care about the actual
    components library! It can be tomahawk, standard JSF, whatever! and
    I don't need to create my own components
    ( or to extend all existing components!)
    only to manage the task of the "on error stlye class".
    If all the "stylable" components had implemented an interface, it would have
    been better, but its not like that therefore this is the only way I could think of.
    Any idea would be appreciated.
    Then, if there exists a message associated to the component, I simply
    extend its style class adding the CSS style class message.

  • How to restrict the Save of a Campaign if any error messages are raised/there?

    Hi All,
        How to restrice the save of the Campaign if any error messages are called/raised.
    Now, I am using conditions in the Save method but it is not working now.
    find the Attachment for the error message.
    I am assuming this error is calling from some where not from my code.
    Please suggest me any Badi or other way to restrict the save of the Campaign.
    Thanks in Advance....
    Regards
    vam's

    Hi I am actually trying to prevent the saving by using the BADI and putting
    ev_reject_save = abap_true.
    Nevertheless the campaign is saved with errors...any idea how to prevent this ?

  • I must re-install HDD, when tried to install application DVD with iPhoto,there was a error message, could not instal it again, I have LION 10.7.3. How can install application DVD again?

    I must re-install HDD, but when tried to install application DVD with iPhoto,there was a error message, could not instal it again,
    I have LION 10.7.3.
    How can install application DVD again?
    thanks
    Dimitar

    I've asked the hosts to move this post to Lion.
    Here is a better place for you Lion posts.
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion?view=discussi ons
    What is HDD?
    How to install most applications from DVD.
    Place dvd in dvd drive.
    Double click on dvd image if a folder didn't appear.
    Double click on application icon in drive folder.
    follow instructions.
    Robert

  • I'm trying to burn a dvd from idvd but I keep getting error message, broken assets, but when I check my drop zones and their content there's no error messages on any of them?

    I'm trying to burn a dvd from idvd but I keep getting error message, broken assets, but when I check my drop zones and their content there's no error messages on any of them?

    Hi
    And if You change view - in main "window/view field" so that You see the box-plot structure.
    No exclamation marks there either ?
    and non at the front page ?
    iDVD do not copy Your material - only points to where it is stored. So if on any external hard disks, USB-memories, CDs or DVDs are missing - assetts are broken.
    Or if You changed location of any material or directed iPhoto or iTunes or GarageBand to a new Library - Then iMovie/iDVD also get's lost.
    Yours Bengt W

Maybe you are looking for

  • 2nd monitor W2072a suddenly has no signal

    2nd monitor W2072a suddenly has no signal, tried switching cables & rebooting but box comes up states Scanning then No Signal.  I desperately need help since the only way I can use a computer is with 2 monitors due to a disability

  • 10.4.11 problems

    Hey there, the new upgrade really knocked my computers for a loop. I have two separate issues that I need some ideas on how to handle. 1. My wife's laptop (G4 Powerbook) no longer sees the airport card - I only get the 'No AirPort hardware found' mes

  • How to get full screen caller pic in ios 7.1

    How to get full screen caller pic in ios 7.1.Please help me

  • PE51 convert amount into words and concatenate the value with cents

    Hi gurus, I'm facing a problem in PE51... I have this amount: 655.690,32 And it should appear in the form like this Example: Six hundred and fifty five thousand six hundred and ninety Dollars and Thirty-two cents. In PE51 I have two options: - Number

  • In JSF, how to make a menu with access control?

    In JSF, how to make a menu with access control? The access control can be guided by programming, database or other means if possible? Thanks