Raising Exceptions and Assistance classes

Hi everyone. I know that the WDA framwork will not let me declare a raising clause in the method signature. However, during checks in the component i usually declare some code like this which is not pretty:
The methods below were declared in the view controller.
*---this method is called from DOBEFOREACTION method
METHOD validate_view_fields .
  DATA: l_returncode TYPE sysubrc.
  CALL METHOD validate_required_fields(
    IMPORTING
      e_returncode = l_returncode ).
  IF l_returncode <> 0.
    e_returncode = l_returncode.
  ENDIF.
-more code down here-
ENDMETHOD.
I would like the framework to call a method and if something goes wrong I do not want to proceed further down the code or navigate. If I could declare exceptions I could handle this pretty easily.
If assistance classes or model classes are the answer then would I be able to read the context from those classes? I've also read that passing references of the web dynpro controllers to the assistance class could produce some problems.
What's the best way to check the view fields and to prevent going further with the subsequent code if an exception condition is found?
Thanks! Generous points will be awarded!

Hi Alexander,
The best way to check the input fields and prevent the framework from calling further methods is this:
Check the values in WDDOBEFOREACTION. In this method you can check the name of the action, if it is an action of the same view. Maybe you want to skip testing, if the user pressed the CANCEL button or something similar.
Report the message as an error message attached to an attribute. Then the next methods (e.g. event handler) will not be called, and therefore no navigation will take place.
If this does not work as described here, you should check your basis support package. It should be SP11 or higher.
Ciao, Regina

Similar Messages

  • Checked Exception and Anonymous classes

    Hi I am refering to java certification book that says : If a checked exception is thrown during the execution of initializer expression, then it has to be caught and handled. This restriction does not apply to instance initializer expressions in anonymous classes.
    I have codes for the above statement but failed to get the correct result. Is there some problem with the code :
    class RoomOccupancyTooHighException extends RuntimeException {} // (1) Unchecked Exception
    class TooManyHotelsException extends Exception {}           // (2) Checked Exception
    class base
         public void fun()
              System.out.println("base");
    class derived
         public static base funtion()
              return new base()
                                       int a = fu();
                                       int fu()
                                            if(a==1)
                                            throw new TooManyHotelsException();
                                            return 100;
                                       public void fun()
                                            System.out.println("derived");
         public static void main(String str[])
              base b = funtion();
              b.fun();
    }

    In anonynous class initialisation you don't need to declare the exception but you still need to handle it in the calling code.
    The code you provided does not compile for that reason.

  • RAISING EXCEPTION AND SHOWING TO USERS IN FORM BASED ON STORED PROCEDURE

    I have a form based on stored procedure.
    I want to handle exceptions in the stored procedure and show it to users.
    Here is what i want to do.
    I have a sku# field in the form and i want to validate it(against the database
    table) in the procedure before inserting into the database.
    I want to give a message to users when the validation fails.
    How is this possible with the forms based on stored procedure?
    Can i use javascript to do the same?
    Thanks in Advance

    I have a form based on stored procedure.
    I want to handle exceptions in the stored procedure and show it to users.
    Here is what i want to do.
    I have a sku# field in the form and i want to validate it(against the database
    table) in the procedure before inserting into the database.
    I want to give a message to users when the validation fails.
    How is this possible with the forms based on stored procedure?
    Can i use javascript to do the same?
    Thanks in Advance

  • MakePersistent exception and second class object value

    1. When makePersistent is called on an object with application id that
    already exists in the database, a JDOFatalDataStoreException is thrown.
    The JDO specification calls for a JDOUserException (17.1.4).
    2. If there are stray data for a second class field (e.g. Hashtable)
    before the object is created, the stray data will become part of the value
    of the second class object.
    Suggestion: Delete statements should be issued to delete stray values for
    second class fields.
    ---------- Program output -------------
    After makePersistent: Persistent-Dirty-New
    After add inside transaction: Persistent-Dirty-New
    [ C:9; S:58; T:5; D:11/29/02 9:47 PM ] INSERT INTO PORTFOLIOX(JDOLOCKX,
    JDOCLASSX, NAMEX) VALUES (0, 'quocp.ent.Portfolio', 'TESTPF')
    [ C:9; T:5; D:11/29/02 9:47 PM ] roll back data store transaction
    javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    PORTFOLIOX(JDOLOCKX, JDOCLASSX, NAMEX) VALUES (0, 'quocp.ent.Portfolio',
    'TESTPF')] Invalid argument value: Duplicate entry 'TESTPF' for key 1
    [code=1062;state=S1009]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper: [SQL=INSERT INTO
    PORTFOLIOX(JDOLOCKX, JDOCLASSX, NAMEX) VALUES (0, 'quocp.ent.Portfolio',
    'TESTPF')] Invalid argument value: Duplicate entry 'TESTPF' for key 1
    end trans[11/29 21:47:28:913]

    Well, you can always do this type of cleanup manually if you so desire.
    Having Kodo automatically guess about what constitutes valid data seems
    pretty dangerous though.
    I'd suggest that you put the appropriate deferred referential integrity
    checks on your schema instead. This will let the database guarantee the
    consistency of the data.
    -Patrick
    Quoc Pham wrote:
    If the data for the second class member somehow are there in the table
    (maybe someone deleted the owning instance without cleaning up the owned
    data), then it woul be picked up. It would be safer to have an option to
    issue an SQL statement to clean up the data.
    "Patrick Linskey" wrote in message
    news:asegfu$9r0$[email protected]..
    Quoc Pham wrote:
    2. If there are stray data for a second class field (e.g. Hashtable)
    before the object is created, the stray data will become part of the
    value
    of the second class object.What do you mean by 'stray data?'
    -Patrick
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Re: Raising Exceptions Vs returning erro[Ref:C809787]

    Hi Steve !
    Probably the following explanation might help in resolving the issue raised by
    you:
    At a more abstract level, there is only one thing, i.e. the EVENT. According to
    it's definition, an event is a relatively infrequent occurrence in one portion (lets
    call it event raiser) of the application, which some other portion (or portions,
    lets call them event handlers) (of the same application) are interested to respond
    to it. Now there are two scenarios:
    (A) Event raiser and Event handler(s) are being executed under different threads
    of control (Asynchronous) and
    (B) Event raiser and Event Handler(s) are being executed under same thread of
    control (Synchronous).
    So, Exception Handling belongs to scenario B where the method raising the
    exception (Event Raiser or exception raiser) and the method handling it (Event
    Handler or exception block) are under the same thread of control. More ever it has
    to be insured that at a time only one handler (first the inner most one) receives
    the message.
    Fort&eacute; provides a generic Event handling mechanism (Post Event and Event Loop) to
    handle the scenario A (which is the more generic one). But it also provides a
    specialized Event Handling mechanism (Raise Exception and Exception block) to
    efficiently handle the relatively simple scenario B. Why I am saying that the later
    is efficient because it won't be needing to register the event queue address of the
    interested task (after all there is only one task involved) and put the event
    message in queue.
    Finally let me mentioned that it is just my view based on the understanding I
    have and it may not be true. Only a person from fort&eacute; can confirm it. I will really
    appreciate if somebody correct and or refine it.
    Wish a Very Very Happy New Year to all Fort&eacute; Users
    Regard,
    Kailash.
    [email protected] wrote:
    I would agree with Eric entirely. Exceptions seem to me to be a much more
    complete solution to the problem of error handling. A little bit of effort up
    front in making clear the strategy for exception handling and specifying the
    exceptions that can be raised by a class\method will provide an excellent method
    for error handling.
    In the case of ensuring exceptions are always handled, a top level handler for
    GenericException will usually do the job, allowing you to write error
    information out to logs, screen, etc, and then shut down gracefully.
    The only issue I would raise with exceptions is that they are not propagated
    outside an asynchronous task. If an exception is not handled within an
    asynchronous, it will not propagate to the task that started that asynchronous
    task. Forte provides return and exception events when starting asynchronous
    tasks to cope with this, but it seems a shame to have one method of dealing with
    errors (exceptions) for synchronous behaviour, and another (events) for
    asynchronous behaviour.
    Steve Elvin
    Systems Developer
    Frontline Ltd.
    UK
    Mark,
    The problem with return codes is that there is an underlying assumption
    that the receiver will always catch and interpret that error code. This
    may or may not be good thing, depending on how you architect your
    application. If, on the other hand, you want to ensure that an error is
    always handled, if not by the receiver then by the Forte, Exceptions are
    the way to go. To extend this mechanism further, I would subclass
    GenericException and created my own error code attribute on that
    subclass. That way the receiver has the choice of interpreting the
    exception based on that error code, and wrapping it in a
    MessageDialog/window or do the usual 'errormgr.showerrors()'.
    Exceptions seem a more flexible approach to me. That is, if you can live
    with the fact that by using it, you're violating the 'exceptions for
    behavioral anomalies' software engineering principle !
    Best wishes.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Kallambella, Ajith" <[email protected]>
    To: "'Mark Sundsten'" <[email protected]>, [email protected]
    Cc: [email protected]
    Subject: RE: Raising Exceptions Vs returning error codes
    Date: Wed, 30 Dec 1998 08:52:39 -0500
    Reply-To: "Kallambella, Ajith" <[email protected]>
    Mark,
    Identifying conditions where you would rather use an exception
    to an error_code ( and vice-versa ) normally depends on
    your application design. Usually exceptions
    are used to handle behavioral anomalies which are
    not expected during the normal course of execution of
    the program, and which would affect the continuity of
    your algorithm if ignored. Examples would be a fatal
    error, a semantically invalid( but syntactically-valid
    token ) etc.
    Error_codes and return status's can be used to handle
    anticipated and recoverable errors. Example would
    be presentation layer validations. In any normal
    UI system, the user is expected to make errors and it
    would be annoying to throw an exception( and to handle
    it ), every time user enters wrong data. A well
    modeled client layer should not only handle
    data-validation errors , but should be smart enough
    to encourage users to input correct or
    "near-correct" data. Examples could be
    making use of look-up windows etc. Interestingly,
    Express uses exceptions to handle data-validations.
    As you see, exceptions fit well into your processing
    logic where severity of damage caused by an error
    is more. Where as error_codes fit well into presentation
    logic( and some not-so-critical processing logic ) where
    errors are usually recoverable and normal path of
    execution can be easily restored.
    Hope this helps. I would be very interested to hear
    what others have to say.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Mark Sundsten [mailto:[email protected]]
    Sent: Tuesday, December 29, 1998 2:10 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Raising Exceptions vs returning error codes
    When dealing with error handling, I find myself struggling with the
    choice
    of
    raising exceptions (and handling them) from the caller
    vs returning an error code of somekind.
    When would you want to use one over the other?
    Should you always use exception handling?
    Any discussion would be appreciated.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Steve !
    Probably the following explanation might help in resolving the issue raised by
    you:
    At a more abstract level, there is only one thing, i.e. the EVENT. According to
    it's definition, an event is a relatively infrequent occurrence in one portion (lets
    call it event raiser) of the application, which some other portion (or portions,
    lets call them event handlers) (of the same application) are interested to respond
    to it. Now there are two scenarios:
    (A) Event raiser and Event handler(s) are being executed under different threads
    of control (Asynchronous) and
    (B) Event raiser and Event Handler(s) are being executed under same thread of
    control (Synchronous).
    So, Exception Handling belongs to scenario B where the method raising the
    exception (Event Raiser or exception raiser) and the method handling it (Event
    Handler or exception block) are under the same thread of control. More ever it has
    to be insured that at a time only one handler (first the inner most one) receives
    the message.
    Fort&eacute; provides a generic Event handling mechanism (Post Event and Event Loop) to
    handle the scenario A (which is the more generic one). But it also provides a
    specialized Event Handling mechanism (Raise Exception and Exception block) to
    efficiently handle the relatively simple scenario B. Why I am saying that the later
    is efficient because it won't be needing to register the event queue address of the
    interested task (after all there is only one task involved) and put the event
    message in queue.
    Finally let me mentioned that it is just my view based on the understanding I
    have and it may not be true. Only a person from fort&eacute; can confirm it. I will really
    appreciate if somebody correct and or refine it.
    Wish a Very Very Happy New Year to all Fort&eacute; Users
    Regard,
    Kailash.
    [email protected] wrote:
    I would agree with Eric entirely. Exceptions seem to me to be a much more
    complete solution to the problem of error handling. A little bit of effort up
    front in making clear the strategy for exception handling and specifying the
    exceptions that can be raised by a class\method will provide an excellent method
    for error handling.
    In the case of ensuring exceptions are always handled, a top level handler for
    GenericException will usually do the job, allowing you to write error
    information out to logs, screen, etc, and then shut down gracefully.
    The only issue I would raise with exceptions is that they are not propagated
    outside an asynchronous task. If an exception is not handled within an
    asynchronous, it will not propagate to the task that started that asynchronous
    task. Forte provides return and exception events when starting asynchronous
    tasks to cope with this, but it seems a shame to have one method of dealing with
    errors (exceptions) for synchronous behaviour, and another (events) for
    asynchronous behaviour.
    Steve Elvin
    Systems Developer
    Frontline Ltd.
    UK
    Mark,
    The problem with return codes is that there is an underlying assumption
    that the receiver will always catch and interpret that error code. This
    may or may not be good thing, depending on how you architect your
    application. If, on the other hand, you want to ensure that an error is
    always handled, if not by the receiver then by the Forte, Exceptions are
    the way to go. To extend this mechanism further, I would subclass
    GenericException and created my own error code attribute on that
    subclass. That way the receiver has the choice of interpreting the
    exception based on that error code, and wrapping it in a
    MessageDialog/window or do the usual 'errormgr.showerrors()'.
    Exceptions seem a more flexible approach to me. That is, if you can live
    with the fact that by using it, you're violating the 'exceptions for
    behavioral anomalies' software engineering principle !
    Best wishes.
    Eric Pereira
    Forte Consultant
    ----Original Message Follows----
    From: "Kallambella, Ajith" <[email protected]>
    To: "'Mark Sundsten'" <[email protected]>, [email protected]
    Cc: [email protected]
    Subject: RE: Raising Exceptions Vs returning error codes
    Date: Wed, 30 Dec 1998 08:52:39 -0500
    Reply-To: "Kallambella, Ajith" <[email protected]>
    Mark,
    Identifying conditions where you would rather use an exception
    to an error_code ( and vice-versa ) normally depends on
    your application design. Usually exceptions
    are used to handle behavioral anomalies which are
    not expected during the normal course of execution of
    the program, and which would affect the continuity of
    your algorithm if ignored. Examples would be a fatal
    error, a semantically invalid( but syntactically-valid
    token ) etc.
    Error_codes and return status's can be used to handle
    anticipated and recoverable errors. Example would
    be presentation layer validations. In any normal
    UI system, the user is expected to make errors and it
    would be annoying to throw an exception( and to handle
    it ), every time user enters wrong data. A well
    modeled client layer should not only handle
    data-validation errors , but should be smart enough
    to encourage users to input correct or
    "near-correct" data. Examples could be
    making use of look-up windows etc. Interestingly,
    Express uses exceptions to handle data-validations.
    As you see, exceptions fit well into your processing
    logic where severity of damage caused by an error
    is more. Where as error_codes fit well into presentation
    logic( and some not-so-critical processing logic ) where
    errors are usually recoverable and normal path of
    execution can be easily restored.
    Hope this helps. I would be very interested to hear
    what others have to say.
    Ajith Kallambella. M
    Forte Systems Engineer,
    International Business Corporation.
    -----Original Message-----
    From: Mark Sundsten [mailto:[email protected]]
    Sent: Tuesday, December 29, 1998 2:10 PM
    To: [email protected]
    Cc: [email protected]
    Subject: Raising Exceptions vs returning error codes
    When dealing with error handling, I find myself struggling with the
    choice
    of
    raising exceptions (and handling them) from the caller
    vs returning an error code of somekind.
    When would you want to use one over the other?
    Should you always use exception handling?
    Any discussion would be appreciated.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • UDF to raise exception

    Hi,
    Can anyone help me in providing me the UDF / java code to raise exceptions and fail the mapping.
    I can do it by usinf string out of bound exception to fail the mapping ( which is one of the way).
    But i need to invoke the exception clause to throw the custom message.
    Can anyone please throw some light on this could be helpful..
    Thanks,
    Sneha

    Hi Sneha,
    public String throwexception(String input, Container container) throws StreamTransformationException{
    if(input.equals("ERROR"))
    throw new RuntimeException("Mapping fail");
    else
    return input;
    refer this
    Throwing Custom Exception in SXMB_MONI( Error Node)
    Also see,
    Throwing Smart Exceptions in XI Graphical Mapping
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    XI/PI: Throwing Generic Exceptions from any type of Mapping
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping

  • Few question on raise exception

    hi,
    i got this in the previous post.
    1) i need to define not_found in exception tab in 'string_split' function module right?
    2) what is the type for not_found?
    3) why not_found can equal to 7? how do we know 7 is not success?
    4) why not_found value can same as sy-subrc?
    5) may i know the difference for FM raise exception and bapi bapiret2.
    thanks
    FUNCTION-POOL CSTR.
    FUNCTION STRING_SPLIT.
      IF STRING NA DELIMITER.
        RAISE NOT_FOUND.
      ENDIF.
    ENDFUNCTION.
    The calling program could then include the following code:
    PROGRAM EXAMPLE.
    CALL FUNCTION 'STRING_SPLIT'
         EXCEPTIONS
              NOT_FOUND = 7.
    IF SY-SUBRC = 7.
      WRITE / 'There is a problem.'.
    ELSE.
    ENDIF.

    1) i need to define not_found in exception tab in 'string_split' function module right?
    The exception NOT_FOUND is already there, why do you want to define another?
    Even if you want to include another exception, you cannot simple define in the same function module. You have to copy the fm into a Z function module and then do wahtever you want to do.
    2) what is the type for not_found?
    No need for TYPE. the exceptions tab doesnt have any type.
    3) why not_found can equal to 7? how do we know 7 is not success?
    In general the order in which the exceptions are definned determines the subrc value they represent.
    example
    NOT_FOUND 1
    NOT_VALID 2
    TOO_LONG 3
    TOO_SMALL 4
    4) why not_found value can same as sy-subrc?
    sy-subrc is a system field which would have the value of the exception that is raised
    5) may i know the difference for FM raise exception and bapi bapiret2.
    bapiret2 is a structure like any other structures that we see in the se11.
    a filling the values in the bapiret2 structure wouldn't set the sy-subrc value to non zero.
    thanks
    Regards,
    Ravi

  • Error in Raising exceptions in a method and handling the same in the WF

    Hi All
    I tried to implement Raising exceptions in a method and handling the same in the workflow
    in the same way given in SAPtechnical site .
    1.by adding a error msg in exception parameter .
    2. if the select query fails, to fetch the agent then :exit_return 9001 'ztable name' space space space.
    3.in the Background activity in which this method is called there automatically one outcome appears ,and I hav acitvated that outcome and in that done what need to be done for that error handling - just send a mail to concern person .
    4. in the normal outcome of the activity , the step to be executed are there .
    but its not working , if exception come then the WF stuck there only . it do not follow the exception outcome .
    Kindly help me , How can I do the exception handly in WF.
    thanks & Regards
    Kakoli

    > That is usually the case - you catch an error in the underlying program and pass that back so the workflow can go into error.
    > You're doing it correctly.
    I don't think that's quite right.
    If you define an error/exception in a method, it is automatically mapped to an outcome of the step/task.
    If you activate that outcome, then you can handle the exception in a branch of the workflow.
    For example: 'Remote connection is down, please contact Basis'
    The step should only go into error if an outcome occurs that you have NOT activated.
    So the original question is valid. Please give some more information on what the error message is..
    chrs
    Paul

  • Exception Handling Standards -The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.

    In the current project my exception handling implementation is as follows :
    Exception Handling Layer wise :
    DL layer :
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    BL Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    UI Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    Response.Redirect("ErrorPage.aspx", false);
    We have a tool to check the standards. And tool output is as follows :
    The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
    I need suggestions on how to implement the same according to standards.

    Your tool is wrong if it says to never throw Exception.  This was a common recommendation back in the .NET v1 days but has long since been thrown out.  It is perfectly fine to use Exception when you have a general exception that provides no information
    that an application can use to make an informed opinion.
    The general rules of exception throwing is to throw the most specific exception that makes sense. If there is no specific exception that applies and it would be useful for the caller to handle the exception differently than other exceptions then creating
    a custom exception type is warranted.  Otherwise throwing Exception is reasonable. As an example you might have an application that pulls back product data given an ID. There is no built in exception that says the ID is invalid. However an invalid ID
    is something that an application may want to handle differently than, say, an exception about the product being discontinued.  Therefore it might make sense to create an ItemNotFoundException exception that the application can react to.
    Conversely there is no benefit in having different exception types for disk full and disk quota met. The application will respond the same in either case.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Exception in super and sub class

    when super class method throws an exception then sub class overridden method can throws child exception but when we talk about constructor why we throws parent class exception in derived class constructor????

    tcbhardwaj wrote:
         C() throws Throwable // why here parent of Exception class
         void ok() throws ArithmeticException // why here child of RunTimeException classFirst, you never need to declare a throws clause for unchecked exceptions--RuntimeException, Error, and their descendants.
    However, there are a couple of general rules for checked exceptions (such as IOException, SQLException, etc.). As you're studying these, keep in mind that a throws clause is a contract that promises what the method will not do. In particular, it doesn't promise that the method will throw those exceptions. It promises that it will not throw any other checked exceptions not covered by that throws clause.
    1. A child method that overrides a parent method cannot throw any checked exception outside what's covered by the parent's throws clause. So if the parent method declared throws IOException, the child cannot declare throws Exception, or throws SQLException, because both of those are outside the IOException "sub-hierarchy."
    2. A child method that overrides a parent method can declare to throw less than the parent throws. This is because, if the parent promises not to throw outside of some set, and the child promises not throw outside of a subset of that set, then clearly he's also not throwing outside of the parent's set. If the parent method declares throws SQLException, IOException, then the child can declare no exceptions at all, or just SQLException, or just IOException, or any combination of any of the subclasses of SQLE and IOE.
    Rules 1 and 2 do not apply in the case of constructors, because no constructor can ever override another constructor.
    3. When any method or constructor, A, invokes any other method or constructor, B, then any checked exception declared to be thrown by B must be either caught or declared to be thrown by A. If A catches or throws a parent of an exception thrown by B, then he's also implicitly catching or throwing the one that B mentions.

  • Submit report = raise exception class

    Hello experst,
    i have to call a report from one of my programs. In this report it can happen that an error occors. So there i call
          RAISE EXCEPTION TYPE zcx_exceptionmng
            EXPORTING t100_msgid = 'QY'
                                t100_msgno = '051'.
    The code of the calling program looks like this:
    try.
      submit z_test and return
              with p_backgr = 'X'
              with p_lot = '12312'
    catch zcx_exceptionmng into oref.
    endtry.
    I wonder because the catch doens´t work. I get a system dump  UNCAUGHT_EXCEPTION.
    What´s my mistake?

    Try something this way
    RAISE EXCEPTION TYPE zcx_exceptionmng
            EXPORTING t100_msgid = 'QY'
                                t100_msgno = '051'.
    if SY-SUBRC = 4.
    Exce = 4.
    export exce to memory id 'ZEX'.
    endif.
    then
    submit z_test and return
              with p_backgr = 'X'
              with p_lot = '12312'
    import exce from memory id 'ZEX'.
    if exce is not initial.
    " Do your error handling

  • Oracle BI Scheduler raised exception while exporting report by iBot and cus

    Hi,
    I have the issue. When I export BI report using iBot and Java program(BI Publisher Java API) - Oracle BI Scheduler raised exception.
    Platform:
    OBIEE 10.1.3.4 on aix 5.3.0.0
    See the captured log below and any suggestion to fix this will be greatly appreciated.
    - javahost.out.log
    Sep 23, 2009 2:46:35 AM SchedulerComponentLoad load
    INFO: Loading config ...
    Sep 23, 2009 2:46:35 AM SchedulerComponentLoader load
    WARNING: Scheduler RPC components is disabled due to incorrect configuration.
    Sep 23, 2009 2:46:35 AM ApplicationImpl init
    INFO: Running configuration:
    JVM=IBM J9 VM(2.3)
    Listener.Port=9810
    Listener.PermittedClientList=*
    Listener.Address=null
    JobManager.MinThreads=100
    JobManager.MaxThreads=100
    JobManager.MaxPendingJobs=100
    JobManager.IdleThreadTimeoutMls=300000
    MessageProcessor.SocketTimeoutMls=5000
    Charts.InputStreamLimitInKB=1024
    Charts.RequestResponseLogDirectory=/oracle/oraclebidata/tmp
    Chart.Enabled=true
    Chart.InputStreamLimitInKB=1024
    Chart.ChartRoot=/oracle/oraclebi/corda50/chart_root
    Chart.CordaRoot=/oracle/oraclebi/corda50
    Chart.EnableConsoleOutput=false
    Chart.EnableXmlValidation=true
    Chart.MaxAttributeLength=127
    Batik.InputStreamLimitInKB=1024
    Batik.RequestResponseLogDirectory=/oracle/oraclebidata/tmp
    Batik.EnableXmlValidation=false
    Scheduler.Java.Enabled=false
    Scheduler.Java.DefaultUserJarFilePath=null
    Scheduler.Java.PurgePeriod=0
    Scheduler.Java.TempPath=null
    XMLP.InputStreamLimitInKB=8192
    XMLP.RequestResponseLogDirectory=/oracle/oraclebidata/tmp
    OBISAuthenticatorProxy.InputStreamLimitInKB=128
    OBISAuthenticatorProxy.RequestResponseLogDirectory=/oracle/oraclebidata/tmp
    OBISAuthenticatorProxy.ClassName=oracle.bi.server.customauthenticatorimpl.javahostrpccall.DisabledAuthenticator
    Sep 23, 2009 2:46:35 AM Main main
    INFO: Listening for new connections
    Sep 23, 2009 3:01:56 AM RpcSchedulerJob processMessage
    WARNING: Error
    java.lang.NullPointerException
         at java.io.File.<init>(File.java:220)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.getMaxCount(SchedulerJavaUtil.java:118)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.makeUniqueFileName(SchedulerJavaUtil.java:109)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.readJobInfo(SchedulerJavaUtil.java:68)
         at com.siebel.analytics.scheduler.javahostrpccalls.RpcDisabledSchedulerJob.processMessageInternal(RpcDisabledSchedulerJob.java:36)
         at com.siebel.analytics.javahost.AbstractRpcCall.processMessage(AbstractRpcCall.java:107)
         at com.siebel.analytics.javahost.MessageProcessorImpl.processMessage(MessageProcessorImpl.java:175)
         at com.siebel.analytics.javahost.Listener$Job.run(Listener.java:223)
         at com.siebel.analytics.javahost.standalone.SAJobManagerImpl.threadMain(SAJobManagerImpl.java:205)
         at com.siebel.analytics.javahost.standalone.SAJobManagerImpl$1.run(SAJobManagerImpl.java:153)
         at java.lang.Thread.run(Thread.java:810)
    - nqscheduler.out.log
    [Util Logger] Exception occured:
         Severity:Not set
         Type:const saw::Exception *
    +     File:/net/sdcb80a022/vol1/users/anabuild/views/nightly/Tue/101341/AIX/vobs/090414.1900/analytics_web/main/project/webcomm/rpc.cpp+
         Line:371
         Message:A fatal error occurred while processing the request. The server responded with: Error while executing RpcSchedulerJob.processMessage
    java.lang.NullPointerException
         at java.io.File.<init>(File.java:220)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.getMaxCount(SchedulerJavaUtil.java:118)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.makeUniqueFileName(SchedulerJavaUtil.java:109)
         at com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaUtil.readJobInfo(SchedulerJavaUtil.java:68)
         at com.siebel.analytics.scheduler.javahostrpccalls.RpcDisabledSchedulerJob.processMessageInternal(RpcDisabledSchedulerJob.java:36)
         at com.siebel.analytics.javahost.AbstractRpcCall.processMessage(AbstractRpcCall.java:107)
         at com.siebel.analytics.javahost.MessageProcessorImpl.processMessage(MessageProcessorImpl.java:175)
         at com.siebel.analytics.javahost.Listener$Job.run(Listener.java:223)
         at com.siebel.analytics.javahost.standalone.SAJobManagerImpl.threadMain(SAJobManagerImpl.java:205)
         at com.siebel.analytics.javahost.standalone.SAJobManagerImpl$1.run(SAJobManagerImpl.java:153)
         at java.lang.Thread.run(Thread.java:810)
    Edited by: user8096018 on Sep 23, 2009 5:40 AM

    I am also having the same issue......Can some body help me please? Thanks

  • What are exception class and persistant class?

    hi,
    what are exception class and persistant class?
    how are they different from the normal class?
    Regards,
    Anil

    Hii!
      Persistent Classes
    To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.
      Check out this link
    http://www.sapnet.ru/abap_docu/ABENABAP_EXCEPTION_CLASSES.htm
    Regards
    Abhijeet

  • Assistance Class and Constructor

    Hi,
    I've created an assistance class + a constructor for it. This constructor needs a parameter to initialize the Assistance Class.
    However I'm unable to pass it on since the instantiation of WD_ASSIST is done by the framework.
    How can I achieve this?
    Thanks

    Yes Thomas. I totally agree with you. ideally an assistance class is always instantiated by the WD framework. But I just talked about the technical possibility of having a constructor for an assistance class.
    Apart from the embedded component usage one more possibility which comes to my mind is coverting a normal class ( being used elese where in normal report programs where constructor is necessary for instantiating parameters) into an assistance class. Although the class may be copied into a new class and then by deleting the constructor and creating a method for the purpose which constructor used to do.
    I welcome your thoughts on this scenario.

  • Acheive both Options: BPM restart and Raise Exception.

    Hi All,
    I have a requirement in my current project in BPM design.
    In case of any application errors or system errors the BPM process should fail at the step and the exception hadler should catch the exception and information should reach the end user as an Alert.
    But I am facing problem in acheving both the objectives.
    1.If  an exception is occured an alert will be triggered using the control step and the BPM will be successfull and will not be available for restart.
    2.If I am deliberately not handling the exceptions inside the BPM ,it will fail and the BPM will be avaialble for the restart but this time alert will not be triggered.
    Can any one suggest me an alternaive way out for this requirement?
    Thanks & Regards,
    Sunil.

    Hi Sunil
    n case of any application errors or system errors the BPM process should fail at the step and the exception hadler should catch the exception and information should reach the end user as an Alert.
    But I am facing problem in acheving both the objectives.
    1.If an exception is occured an alert will be triggered using the control step and the BPM will be successfull and will not be available for restart.
    2.If I am deliberately not handling the exceptions inside the BPM ,it will fail and the BPM will be avaialble for the restart but this time alert will not be triggered.
    I have faced similar requirement before.
    I don't know this will help or not.
    What we have done is when we get exception, the generated alert message was passed to a data type that do an RFC call to PI system. Which in turn generated the alert messages as email to the concerned people and generate a response message that creates dummy message. Which fails the BPM. We came to know the error received in so that it can be rectified or restarted. This fulfilled my requirement.
    We used the similar method to get rid of message queue when bulk messages entered and restarted automatically
    Thanks
    Gaurav

Maybe you are looking for

  • Follow-up to earlier question re: lost CS4

    I had a computer crash and lost Photoshop CS4(purchased online).  I was given a website to go to where I could download the software.  I went through the procedures until it asked me for a serial number, which I entered.  It indicated it was an inval

  • Custom File Name

    Hello All, Our requirement is like that. - User select the employee name[First Name & Last Name] from Drop Down [BI Publisher used in Dashboard]. - On clicking "Export Button" the file name should be taken as Selected Employee Name from DropDown[in F

  • Library sharing questions

    Hello there, I have a PM G4, a PB G4 and an XP machine all connected to the same network in my home. I use the XP machine and the PM G4 upstairs in my office and the laptop downstairs (predominantly) and it connects to the network via a Linksys WAP11

  • Select/configure relevant hostname in cluster environment

    The actual situation of my problem is more complex, but I will try to reduce it to the relevant part: I have a web service and a servlet running within a TomCat4 instance, which is controlled by HPServiceGuard. This means: the JVM of TomCat runs with

  • UWL Wizard Not Working - EP7

    Just wondering if anyone else has had this.  Message is out with SAP support too. I'm being lazy and trying to use the wizard in EP7 (SP10) to remove tabs from the UWL.  However, when I go into: Click to Configure Item Types and Customize Views Using