Raising exceptions in PL/SQL

Hi Friends
I have the following code:
declare
var1....
var2....
cursor c1
begin
insert stmt;
update stmt;
update stmt;
for r1 in c1 loop
end loop;
end;
I will be having about 6-7 million rows every month to process. To raise exceptions, I am thinking of either of the following options:
Option 1_
declare
var1....
var2....
var3 exception;
var4 exception;
var5 exception;
cursor c1
begin
insert stmt;
update stmt;
IF SQL%NOTFOUND then
var3;
end if;
update stmt;
IF SQL%NOTFOUND then
var4;
end if;
for r1 in c1 loop
end loop;
IF SQL%NOTFOUND then
var5;
end if;
Exception
when var3 then blah blah
when var4 then blah blah
when var5 then blah blah
end;
Option 2_
declare
var1....
var2....
cursor c1
begin
insert stmt;
update stmt;
update stmt;
for r1 in c1 loop
end loop;
Exception
when others then blah blah
end;
In terms of performance, which option is better? And is there any better option?
Thanks....

In terms of performance, which option is better? And is there any better option?If you consider in terms of performance i think you cant find any difference in both ways.
But your both code does not do the same thing. They are entirely different. They are not the same.
For example, If your UPDATE statement fails with a Too many rows error what will happen.
In the first procedure the procedure will raise the error to the client. But in the second case the error is caught by the WHEN OTHERS block.
So now here the real thing is what you do in the WHEN OTHERS block. Do you suppress the error? Do you return NULL? What do you do, That is what matters.
Your Bla..Bla..Bla.. part in the EXCEPTION is very important. Most of them do mistake there.
WHEN OTHERS is a great feature. But it must be used properly. Its like a very sharp knife. If you dont use it properly there will be blood.

Similar Messages

  • Raise Exception when Executing Native SQL

    Hi ALL,
                 when i am executing native sql, it raises following exception:
    CX_SY_NATIVE_SQL_ERROR
    code as shown below:
    REPORT  ZABC2.
    data:begin of ty_final occurs 0,
    vkorg type vbrk-vkorg,
    vtweg type vbrk-vtweg,
    spart type vbrp-spart,
    werks type vbrp-werks,
    fkart type vbrk-fkart,
    vbeln_invoice type vbrk-vbeln,
    matnr type vbrp-matnr,
    arktx type vbrp-arktx,
    fkimg type vbrp-fkimg,
    ntgew type vbrp-ntgew,
    mwsbp type vbrp-mwsbp,
    posnr type vbrp-posnr,
    vbeln type likp-vbeln,
    bldat type likp-bldat,
    erdat type likp-erdat,
    traid type likp-traid,
    ernam type likp-ernam,
    posnr_do type lips-posnr,
    vbeln_so type vbak-vbeln,
    audat_so type vbak-audat,
    erdat_so type vbak-erdat,
    ernam_so type vbak-ernam,
    posnr_so type vbap-posnr,
    vbeln_contract type vbak-vbeln,
    audat_contract type vbak-audat,
    erdat_contract type vbak-erdat,
    ernam_contract type vbak-ernam,
    vbtyp_contract type vbak-vbtyp,
    posnr_contract type vbap-posnr,
    end of ty_final.
    TRY.
    break-point.
    EXEC SQL .
    select
           i1.inv_vkorg,
           i1.inv_vtweg,
           i1.inv_spart,
           i1.inv_werks,
           i1.inv_fkart,
           i1.inv_vbeln,
           i1.inv_matnr,
           i1.inv_arktx,
           i1.inv_fkimg,
           i1.inv_ntgew,
           i1.inv_mwsbp
           i1.inv_posnr,
           d.do_vbeln,
           d.do_bldat,
           d.do_erdat,
           d.do_traid,
           d.do_ernam,
           d.do_posnr,
           s.so_vbeln,
           s.so_audat,
           s.so_erdat,
           s.so_ernam,
           s.so_posnr,
           c.co_vbeln,
           c.co_audat,
           c.co_erdat,
           c.co_ernam,
           c.co_vbtyp,
           c.co_posnr
    into :ty_final
    from (SELECT
    VBAK.VBELN co_vbeln,
    VBAK.AUDAT co_audat,
    VBAK.ERDAT co_erdat,
    VBAK.ERNAM co_ernam,
    VBAK.VBTYP co_vbtyp,
    VBAP.POSNR CO_POSNR
    FROM VBAK , VBAP
    WHERE VBAK.VBELN=vbap.vbeln
    and vbak.vbtyp='G') c,
    (SELECT
    vbak.vbeln so_vbeln,
    vbak.audat so_audat,
    vbak.erdat so_erdat,
    vbak.ernam so_ernam,
    vbap.posnr so_posnr
    FROM VBAK ,VBAP
    WHERE vbak.VBELN=vbap.vbeln
    and vbak.vbtyp='C') s,
    (SELECT
    likp.vbeln do_vbeln,
    likp.bldat do_bldat,
    likp.erdat do_erdat,
    likp.traid do_traid,
    likp.ernam do_ernam,
    lips.posnr do_posnr
    FROM    LIKP , LIPS
    WHERE likp.VBELN=lips.vbeln
    and likp.vbtyp='J'.
    ) d,
    (SELECT
    vbrk.vkorg  inv_vkorg,
    vbrk.vtweg  inv_vtweg,
    vbrp.spart  inv_spart,
    vbrp.werks  inv_werks,
    vbrk.fkart  inv_fkart,
    vbrk.vbeln  inv_vbeln,
    vbrp.matnr  inv_matnr,
    vbrp.arktx  inv_arktx,
    vbrp.fkimg  inv_fkimg,
    vbrp.ntgew  inv_ntgew,
    vbrp.mwsbp  inv_mwsbp,
    vbrp.posnr  inv_posnr
    FROM VBRK , VBRP
    WHERE vbrk.VBELN=vbrp.vbeln
    AND vbrk.VBTYP='M'
    AND vbrk.FKART NOT IN ('S1','S2','S3')
    AND vbrk.FKSTO<>'X') i1,
    (SELECT
           vbelv,
           POSNV,
          vbtyp_v,
           vbeln,
           POSNN,
          vbtyp_n
    FROM   VBFA
    where VBTYP_V='G'
    AND VBTYP_N='C'
    ) f1,
    (SELECT
           vbelv,
           POSNV,
          vbtyp_v,
           vbeln,
           POSNN,
          vbtyp_n
    FROM   VBFA
    where VBTYP_V='C'
    AND VBTYP_N='J'
    ) f2,
    (SELECT
           vbelv,
           POSNV,
          vbtyp_v,
           vbeln,
           POSNN,
          vbtyp_n
    FROM   VBFA
    where VBTYP_V='J'
    AND VBTYP_N='M'
    ) f3
    where c.vbeln=f1.vbelv(+)
    and f1.vbeln=f2.vbelv(+)
    and s.vbeln=f2.vbelv(+)
    and f2.vbeln=f3.vbelv(+)
    and d.vbeln=f3.vbelv(+)
    and i1.vbeln=f3.vbeln(+)
    ENDEXEC.
    **and c.vbeln=f3.vbelv(+)
    **and i1.vbeln=d.vbeln(+)
    *if sy-subrc <> 0.
    CATCH CX_SY_NATIVE_SQL_ERROR.
    ENDTRY.
    *ENDIF.
    break-point.

    Hi,
    Try using this ..
    data ref1 type ref to CX_SY_NATIVE_SQL_EROR.
    try.
    exec sql.
    endexec.
    catch CX_SY_NATIVE_SQL_EROR.
    write 'Error ', ref1->SQL_ERROR.
    RAISE EXCEPTION myref.
    endtry.
    Edited by: Vasavi Kotha on Jan 6, 2009 11:26 AM

  • 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/>

  • ECL Viewer 5 raise exceptions viewing tif drawings

    Hello all,
    Bit of a strange one here that hopefully someone may be able to help me with...
    We are (still) running 4.6C, on Ora 9.2.0.7 over Windows.
    We are running 640 Gui patched to 24
    We have deployed (in a failed attempt to stop the error I will describe below) ECL viewer 5.1.3.
    Client machines are running XP with SP2
    Error:
    after entering MM03 and choosing Additional Data > Document Data we click on an attchment (doc type DRG) and choose to view via the display (glasses) icon.  The tif file (which is copied into C:\temp) opens.  many of the tif files (scanned drawings) have multiple pages so we move to the next page by clicking 'Navigation' > 'next'. 
    The problem is that after a seemingly random amount of clicks on to next pages a raise exception occurs.  After the short dump it is no longer possible to view the document again as we get the error 'file c:\temp\xxxxx.tif cannot be created' and so the only way to view the drawing is either to access the file from the temp directory or completly log out of SAP and relog back in.
    i have searched for notes and we were advised to deploy the 5.1.3 viewer which only seems to have made it worse because before the 5.1.3 deployment we were getting many short dumps but the user oddly didn't see the short dump on their screens - now 5.1.3 is in place the user now sees the short dump and calls the support desk very often.
    Has anyone been unfortunate enough to have experienced this before or anyone got any brain waves????
    yours thankful in advance and loosing the will to live,
    Andy
    ps here is the short dump extract:
                                                                                    Error analysis                                                                               
    A RAISE statement in the program "CL_GUI_CFW====================CP " raised the
    exception                                                                    
    condition "CNTL_ERROR".                                                       
    Since the exception was not intercepted by a superior program                 
    in the hierarchy, processing was terminated.                                                                               
    Short description of exception condition:                                                                               
    For detailed documentation of the exception condition, use                    
    Transaction SE37 (Function Library). You can take the called                  
    function module from the display of active calls.                             
    How to correct the error                                                                               
    If the error occurred in a non-modified SAP program, you may be               
    able to find a solution in the SAP note system.                               
    If you have access to the note system yourself, use the following             
    search criteria:                                                                               
    "RAISE_EXCEPTION"                                                            
    "CL_GUI_CFW====================CP " or "CL_GUI_CFW====================CM00P "
    "UPDATE_VIEW"                                                                
    or                                                                               
    "CL_GUI_CFW====================CP " "CNTL_ERROR"                                                                               
    or                                                                               
    "SAPMMG01 " "CNTL_ERROR"                                                      
    If you cannot solve the problem yourself, please send the                     
    following documents to SAP:                                                                               
    1. A hard copy print describing the problem.                                  
       To obtain this, select the "Print" function on the current screen.         
    2. A suitable hardcopy prinout of the system log.                             
       To obtain this, call the system log with Transaction SM21                  
       and select the "Print" function to print out the relevant                  
       part.                                                                               
    3. If the programs are your own programs or modified SAP programs,            
       supply the source code.                                                    
       To do this, you can either use the "PRINT" command in the editor or        
       print the programs using the report RSINCL00.

    Hi Andy,
    I would recommend you to upgrade to the latest available ECL Viewer version 6.
    Please see SAP note 1083901.
    Further please upgrade also your SAPGUI to the latest patch level as explained in note 164203. After this upgrade please un-install your ECL Viewer 5.1.3 by using one of the following mehtods:
    Search for WebViewer2d.dll file. If it is present at more than one place then it means ECL Viewer is installed more than once without uninstalling the previous version (You can check the folders and should be able to see all the dll's for ECL Viewer such WebViewer3d.dll/Printing.dll etc to make sure that there is not only single file but the whole installation).
    In this case:
    A) Uninstall the version integrated with SAP GUI by using SAP Installation scripts. You need to uncheck the 'EAI Viewer' component in 'General Add-on' option.
    B) Check add/remove program and if there is an entry like SAP Viewer, uninstall it.
    After this search again, and you should not get WebViewer2d.dll file on machine. Now reinstall the latest Viewer. This should solve most of the issue related to inconsistencies.
    Then install the latest ECL Viewer 6 and the issue should be solved.
    Best regards,
    Christoph

  • Error text missing in  raising exception (In ABAP mapping)

    Hi,
    iam using ABAP Mapping for 1 interface.
    Based on some condition  i am raising exception with error text. When i executed this in SXI_Mapping_test it's showing the Error text. But when i execute the interface directly error text is missing in the Error details.
    can any one figure out y its not coming..
    regards
    Kishore

    Hi,
    I think you need to write the error to mapping trace.
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    Regards
    Vijaya

  • 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

  • Raising Exceptions in WDA?

    Hi,
       I want to know about raising exception in wda. Please explain in details.
    Scenario: I have one input field as mandatory. if i click the button without filling that input field, self defined exception should raise. How to do this?
    Thanks,
    Gopi.

    hi ,
    place a UI message area in the RootElement Containeru cn make use of control wizard ( CONTROL + F7) to generate error or exception messages
    select the radio button , generate messages and choose the method report_error_message
    this code wud be automatically generated thru code wizard
    * get message manager
    DATA lo_api_controller     TYPE REF TO if_wd_controller.
    DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
    lo_api_controller ?= wd_this->wd_get_api( ).
    CALL METHOD lo_api_controller->get_message_manager
      RECEIVING
        message_manager = lo_message_manager
    * report message
    CALL METHOD lo_message_manager->report_error_message
      EXPORTING
        message_text              =   'Error_Text' " Give your error text here.
    regards,
    amit

  • Raising exceptions in event handlers?

    Hi
    Is it possible to raise exceptions in event handler? As an example, I added a listener to a UnitOfWork, and implemented the preCommitUnitOfWork() method. In the method, I'm performing some operations, and if something goes wrong, I need to roll back the entire UnitOfWork. Is this possible to raison an exception, or is there some other way to acheive this?
    Thanks
    Regards
    Eric

    Hi
    Is it possible to raise exceptions in event handler? As an example, I added a listener to a UnitOfWork, and implemented the preCommitUnitOfWork() method. In the method, I'm performing some operations, and if something goes wrong, I need to roll back the entire UnitOfWork. Is this possible to raison an exception, or is there some other way to acheive this?Eric,
    I tried this and had some success with a simple test case. I created an exception that extends the oracle.toplink.exceptions.TopLinkException class. Then I added the throws clause to the preCommitUnitOfWork event handler. Throwing my custom exception (that extends TopLinkException) from the event handler works fine and should allow you to retry your update, etc. Note that as long as the exception is thrown at "preCommit" time you should not need to roll anything back as the updates were not applied to the cache or DB. Also, if you applied updates to your registered clones instead of the original objects, the original objects state should be unchanged.
    Hope this helps,
    Pete Farkas

  • Raise exception in function module call from SAP owned program

    I need to raise an exception in a function module to terminate a transaction, display a error message and return to to previous selection screen so the user can fix the error before moving forward.......  
    How do you do this when the program using the function module is SAP owned?
    Thank You!
    Jeff

    Hi,
    After calling the function module, you can do something like this.
    IF SY-SUBRC <> 0.
      RAISE EXCEPTION.
    ENDIF.
    Regards,
    Ferry Lianto

  • Catching errors in Web Dynpro for Java when thrown from RFC Raise Exception

    Hello Developers,
    I'm looking for information that explains how a Web Dynpro for Java application responds and processes errors that are thrown from a Raise Exception event within an RFC.
    The Exceptions do not appear to be part of the Model and I can't identify how they get processed.
    When rfc HRXSS_CAT_WD_RECORD raises exception PERNR_NOT_LOCKED this exception is passed back to the calling webdynpro CAT DC that displays the exception on the web page along with the log. 
    I would like to display a friendlier message and without the log.  Any information on how to customize the handling of this error would be greatly appreciated.
    Thank you,
    Terry

    [see here|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fuser-interface-technology%2fwdJava%2FHowtoHandleExceptionsEffectivelyWhileWorkingwithWebDynproJava%28WDJ%29.pdf]

  • Could not create pool connection. The DBMS driver exception was:java.sql.SQLException: ORA-01017: invalid username/password

    Could not create pool connection.The DBMS driver exception was:java.sql.SQLException:
    ORA-01017: invalid username/password
    Even though I could able to connect to Oracle database using correct userid,password
    and HostString using OracleClient, I couldnt able to do with connectionpool. Here
    is the error message..
    <Jan 21, 2003 2:27:50 AM PST> <Notice> <WebLogicServer> <Starting WebLogic Admin
    Server "examplesServer" for domain "examples">
    Starting Loading jDriver/Oracle .....
    ---------- LOGIN ERROR CODE: 1017
    ---------- LOGIN ERROR CODE: 1017
    <Jan 21, 2003 2:28:06 AM PST> <Error> <JDBC> <Cannot startup connection pool "or
    aclePool" weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied - (Obj
    ectel/********@ora8i)
    at weblogic.db.oci.OciConnection.getLDAException(OciConnection.java:164)
    at weblogic.jdbc.oci.Driver.connect(Driver.java:112)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:193)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:698)
    at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:623)
    at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy45.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2761)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:370)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy64.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:480)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1180)
    at weblogic.management.Admin.finish(Admin.java:590)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:518)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
    at weblogic.Server.main(Server.java:35)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:209)
    at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:698)
    at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:623)
    at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy45.updateDeployments(Unknown Source)
    at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2761)
    at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:370)
    at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    .java:621)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy64.start(Unknown Source)
    at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
    .start(ApplicationManagerMBean_CachingStub.java:480)
    at weblogic.management.Admin.startApplicationManager(Admin.java:1180)
    at weblogic.management.Admin.finish(Admin.java:590)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:518)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
    at weblogic.Server.main(Server.java:35)
    >
    <Jan 21, 2003 2:28:14 AM PST> <Notice> <Management> <Application Poller started
    for development server.>
    <Jan 21, 2003 2:28:19 AM PST> <Notice> <WebLogicServer> <ListenThread listening
    on port 7001>
    <Jan 21, 2003 2:28:19 AM PST> <Notice> <WebLogicServer> <SSLListenThread listeni
    ng on port 7002>
    <Jan 21, 2003 2:28:20 AM PST> <Notice> <Management> <Starting discovery of Manag
    ed Server... This feature is on by default, you may turn this off by passing -Dw
    eblogic.management.discover=false>
    <Jan 21, 2003 2:28:20 AM PST> <Notice> <WebLogicServer> <Started WebLogic Admin
    Server "examplesServer" for domain "examples" running in Development Mode>

    URL=jdbc:weblogic:oracle:oracle8i(server)
    Driver Classname=weblogic.jdbc.oci.Driver
    AClname=weblogic.jdbc.connectionPool.oraclePool
    intialcapacity=1
    MaximumCapacity=10
    Capacity Increment=2
    Login Delay Seconds=1sec
    Refresh Period=15 Minutes
    Supports Local Transaction=No
    Allow Shrinking=No
    Shrink Period=15
    Prepared Statement Cache Size=10
    TargetServer=ExamplesServer
    Properties
    user=Objectel
    password=superman
    Test table=yes
    Test Reserved Connections=yes
    Test Released Connections=Yes
    I could able to connect to oracledataBase if I use
    user=scott
    password=tiger
    with any other database user Iam getting the following error
    Could not create pool connection. The DBMS driver exception was:java.sql.SQLException:
    ORA-01017: invalid username/password
    "Neo Gigs" <[email protected]> wrote:
    By end of the error you shown:
    <Jan 21, 2003 2:28:20 AM PST> <Notice> <WebLogicServer> <Started WebLogicAdmin
    Server "examplesServer" for domain "examples" running in DevelopmentMode>
    You are running the Examples application shipped with WLS, which I guest
    the
    correct DB to connect with is Cloudscape yet to Oracle, unless you make
    changes to the original ConnectionPool in the examples. Anyhow, please
    show
    us your configuration of the ConnectionPool used when this error pops.
    "Raj" <[email protected]> wrote in message
    news:[email protected]...
    Could not create pool connection.The DBMS driver exceptionwas:java.sql.SQLException:
    ORA-01017: invalid username/password
    Even though I could able to connect to Oracle database using correctuserid,password
    and HostString using OracleClient, I couldnt able to do withconnectionpool. Here
    is the error message..
    <Jan 21, 2003 2:27:50 AM PST> <Notice> <WebLogicServer> <Starting WebLogicAdmin
    Server "examplesServer" for domain "examples">
    Starting Loading jDriver/Oracle .....
    ---------- LOGIN ERROR CODE: 1017
    ---------- LOGIN ERROR CODE: 1017
    <Jan 21, 2003 2:28:06 AM PST> <Error> <JDBC> <Cannot startup connectionpool "or
    aclePool" weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: ORA-01017: invalid username/password; logondenied - (Obj
    ectel/********@ora8i)
    atweblogic.db.oci.OciConnection.getLDAException(OciConnection.java:164)
    at weblogic.jdbc.oci.Driver.connect(Driver.java:112)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:193)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    atweblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:698)
    atweblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    atweblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:623)
    atweblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    atweblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    atweblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    atweblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    atweblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    atweblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    atweblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    java:621)
    atweblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy45.updateDeployments(Unknown Source)
    atweblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2761)
    atweblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:370)
    atweblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    atweblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    atweblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    java:621)
    atweblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy64.start(Unknown Source)
    atweblogic.management.configuration.ApplicationManagerMBean_CachingStub
    start(ApplicationManagerMBean_CachingStub.java:480)
    atweblogic.management.Admin.startApplicationManager(Admin.java:1180)
    at weblogic.management.Admin.finish(Admin.java:590)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:518)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
    at weblogic.Server.main(Server.java:35)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
    nectionEnvFactory.java:209)
    atweblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
    nectionEnvFactory.java:134)
    atweblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
    cator.java:698)
    atweblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
    ava:282)
    atweblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
    ava:623)
    atweblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
    atweblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
    oymentTarget.java:329)
    atweblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
    loymentTarget.java:279)
    atweblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
    ments(DeploymentTarget.java:233)
    atweblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
    DeploymentTarget.java:193)
    at java.lang.reflect.Method.invoke(Native Method)
    atweblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    atweblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    java:621)
    atweblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy45.updateDeployments(Unknown Source)
    atweblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
    yments(ServerMBean_CachingStub.java:2761)
    atweblogic.management.mbeans.custom.ApplicationManager.startConfigManag
    er(ApplicationManager.java:370)
    atweblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
    nManager.java:160)
    at java.lang.reflect.Method.invoke(Native Method)
    atweblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
    eanImpl.java:636)
    atweblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
    java:621)
    atweblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
    ionMBeanImpl.java:359)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    55)
    atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
    23)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
    atweblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
    at $Proxy64.start(Unknown Source)
    atweblogic.management.configuration.ApplicationManagerMBean_CachingStub
    start(ApplicationManagerMBean_CachingStub.java:480)
    atweblogic.management.Admin.startApplicationManager(Admin.java:1180)
    at weblogic.management.Admin.finish(Admin.java:590)
    at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:518)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:203)
    at weblogic.Server.main(Server.java:35)
    >
    <Jan 21, 2003 2:28:14 AM PST> <Notice> <Management> <Application Pollerstarted
    for development server.>
    <Jan 21, 2003 2:28:19 AM PST> <Notice> <WebLogicServer> <ListenThreadlistening
    on port 7001>
    <Jan 21, 2003 2:28:19 AM PST> <Notice> <WebLogicServer> <SSLListenThreadlisteni
    ng on port 7002>
    <Jan 21, 2003 2:28:20 AM PST> <Notice> <Management> <Starting discoveryof
    Manag
    ed Server... This feature is on by default, you may turn this off bypassing -Dw
    eblogic.management.discover=false>
    <Jan 21, 2003 2:28:20 AM PST> <Notice> <WebLogicServer> <Started WebLogicAdmin
    Server "examplesServer" for domain "examples" running in DevelopmentMode>

  • Raising exceptions at Application Module

    Hi there;
        For this simple example;
            public void autenticateUser(String pUser, String pPassw) {
            StringBuffer wStatement = new StringBuffer("Begin");
                                     wStatement.append("  PackUser.autenticate(:1, :2);");
                                     wStatement.append("End;");
            try
              CallableStatement cllS = getDBTransaction().createCallableStatement(wStatement.toString(),DBTransaction.DEFAULT);
              cllS.setString(1,pUser);
              cllS.setString(2,pPassw);
              cllS.execute();
            catch (Exception e)
              throw new JboException(e);
           PackUser.autenticate will run into an No_data_found exception when user is not found , and the " catch " will throw an jboException;
       In authenticate bounded  adf task flow, i posted the login page fragment (whose will run into an region)   , the doAutenticate flow control , the am' binding authenticate user setting the parameters for enviromentBean (userName, passWord and so one ... ) and finally the errorPage configured as exception handler.
       Finally
                My jboException was raised, but my errorPage never was called ? as a meter of fact i received the " no_data_found error " inside one popup window.
                Does adf-task-flow not recognize Am's jboExceptions's interface (class errors)  to re-route errors page ?
                _Or Maybe it's not an best practice to raise exceptions into an Application's data modules to "annunciate"  BI constraints !_
        Many thanks ...
    Marcos Ortega
      Brazil

    Hi,
    I'ts almost always best practice to return a result to the UI when calling an AM or VO method.
    If you want to get a bit more fancy, you can return a String array containg a result and a message. Eg.
        // AM Method
        public String[] addLocation(Number locationId, String locationCode) {
                     try  {
                        // Do some stuff
                    } catch (Exception ex)  {
                        ex.printStackTrace();
                        return new String[] {"Error", ex.getMessage()};
            return new String[] {"Success", "This location has been added."};     
        }Drag the method onto the page to create a parameter form and page bindings.
    You can then access the method results on the page declaratively like this:
           <af:panelHorizontal rendered="#{bindings.addLocation.result[0] == \'Error\'}"  partialTriggers="add">
                    <af:objectIcon name="error" rendered="#{bindings.addLocation.result[0] == \'Error\'}"/>
                    <af:objectSpacer width="5" height="10"/>
                    <af:outputText value="#{bindings.addLocation.result[0]} : #{bindings.addLocation.result[1]}"
                                   styleClass="x3s"
                                   inlineStyle="font-size:smaller;"/>
                </af:panelHorizontal>Brenden

  • Raising Exception-Proxy

    Hi Group,
    Can any body suggest how to raise exception in ABAP proxy with custom message and I want to fail message in SXMB_MONI .
    -Rajiv

    Hi Rajiv
    In addition to the code provided by Jorg's link above, you can also use the RAISE static method in class CL_PROXY_FAULT. This is useful if you already have error messages in the common BAPI return table.
      cl_proxy_fault=>raise( exception_class_name = 'ZCL_YOUR_EXCEPTION_CLASS'
                                              bapireturn_tab                 = t_bapiret2 ).
    Do note that as mentioned by Jorg, you still need to define the fault message, which then causes your error to appear as an "Application Error" in the monitor. ZCL_YOUR_EXCEPTION_CLASS is subclass of CX_AI_APPLICATION_FAULT, and would be automatically generated from the fault message when you generate your proxy.
    Rgds
    Eng Swee

  • 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

  • Numeric Overflow; nested exception is java.sql.SQLException: Numeric Overfl

    Dear Team,
    We are getting below errors in java,
    SQL state [99999]; error code [17026]; Numeric Overflow; nested exception is java.sql.SQLException: Numeric Overflow
    java.sql.SQLException: Numeric Overflow
    at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4380)
    at oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:214)
    at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:896)
    at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:434)
    Thanks,
    selva
    Edited by: SELVAPA on Apr 25, 2013 4:05 PM

    >
    at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:434)
    >
    That 'getInt' method returns a Java 'int'. It will attempt to convert the actual data value in the result set column to an int.
    If the value is too large, too small or isn't even numeric you will get an exception.
    Isolate the problem (e.g. by debugging) to the row giving the exception and then examine the actual data value. If you are using NetBeans (or other) you can use the 'getString' method to see what the value is that is causing the problem.
    The actual 'solution' to the problem depends on your database, the table column definition and the business rules being implemented.
    You table could contain 'dirty' data and contain values larger than you want to be stored.
    Or your actual data could be correct and you are just using 'getInt' instead of 'getBigDecimal' or other method to get the value.
    Don't apply a 'solution' until you actually know what the problem is and the proper solution to implement.

Maybe you are looking for

  • We can't install Solaris 8 - IBM PC SERVER 315

    Hello: We are trying to install Solaris 8 (Intel) (02/02) in an IBM PC Server 315. Some words about it: - 128 Mb RAM - Pentium Pro 200 Mhz - Adaptec AHA-2940U/2940UW Ultra SCSI in PCI bus1,Slot 4 (Info from Solaris install) (Target 7) - Hard Disk IBM

  • LSMW No logical path has been specified

    Dear All, I am trying to create characteristic through LSMW. in the Specify file step i am geeing this error"No logical path has been specified". Any body can have idea about the error? Regards Dhiren

  • [SD] Third party with Ship-to different to Sold-to

    Dear all, >> In sales order third-party, I change the partner Ship-to different to Sold-to. When making good receipts for the relavant Purchase order (created for this sales order), the system outputs the Error Message no. KE396: Inconsistency betwee

  • How do I get analog hi 8 video into FCE?

    I am trying to get hi 8 video into FCE (or iMovie HD). I have the hi 8 tape in a Hitachi D.S.P. III (digital signal processor) camcorder. This is connected to my Sony mini-DV digital camcorder. My camcorder has A/V>DV option. I have my camera connect

  • Using UCM data controls in ADF application

    Using *.6 Jdeveloper/UCM/Protal Application/UCM Calling all the experts in Webcenter/Spaces/UCM/ADF. We have a requirement to design search inteface for Documents stored in UCM for Webcenter Portal and Spaces application. Our approach is Design simpl