Capturing Oracle Error Messages

Hi when developing some applications, I come across some error messages that I would like to make custom error messages.
for example: ORA-00001: unique constraint (CREATE_USER.IC_ITEM_GENDERS_PK) violated
Is there a way to capture this message and then make a user friendly message. Any info. would be great.
Thanks

If you write your own after-submit processes, you can write an appropriate exception handler, something like
begin
exception when dup_val_on_index -- ORA-0001
then :P1_ERROR := 'Nice error message';
end;Then show some "Error" HTML region with &P1_ERROR. conditional upon P1_ERROR being not null.
AFAIK, there is no way to do this when the error is raised by the wizard-generated automatic DML or MRU processes. For that, you could try to put your error checking code in a Validation (and specify your nice error message). If the validation fails, the after-submit processes are not fired so the "ugly" error messages will not be seen by the user.
Hope this helps.

Similar Messages

  • How to capture Exception error message in Odata ?

    Hi,
      I am new to sap gateway. Currently i am creating a Odata Service through the transaction SEGW. In the query i have mapped a RFC. When i execute the service sometimes the RFC throws exception like 'No data Found'. But i dont know how to capture the exception returned from the RFC.
    I read some threads which says use
    RAISE EXCEPTION TYPE /IWBEP/CX_MGW_BUSI_EXCEPTION
          EXPORTING
            textid            = /iwbep/cx_mgw_busi_exception=>business_error
            message       =  lv_text
            message_container = io_message_container.
    My doubt is since i have not done any code in the DPC method. As said in many threads should i go to DPC_EXT method and redefine the method or how to capture the exception.
    Kindly advise. Thanks in advance

    Hello Velsankar,
    You need not to capture the error messages explicitly by writing custom code in you DPC_EXT if you are using service builder when the return error message table is of type BAPIRET2.
    GW itself will handle and return the error messages.
    If at all the return error message table is of different type , i mean to say if it is not of type BAPIRET2 then you need to capture explicitly.
    The below is the code you need to write in DPC_EXT to capture.
    DATA: LO_MECO TYPE REF TO /IWBEP/IF_MESSAGE_CONTAINER.
    DATA: LX_BUSI_EXC TYPE REF TO /IWBEP/CX_MGW_BUSI_EXCEPTION.
            LO_MECO = MO_CONTEXT->GET_MESSAGE_CONTAINER( ).
             LO_MECO->ADD_MESSAGES_FROM_BAPI( IT_BAPI_MESSAGES = LT_ERR_RET_TAB ).
             CREATE OBJECT LX_BUSI_EXC
               EXPORTING
                 MESSAGE_CONTAINER = LO_MECO.
             RAISE EXCEPTION LX_BUSI_EXC.
    Note : where LT_ERR_RET_TAB is your internal table where you would have captured all the error messages.
    That is it. You will be able to see the messages .
    Regards,
    Ashwin

  • How to capture the error messages from incorrect session?

    Hi SDNs.,
    i am using BDC Session method to update transaction FB01. So my job runs daily. here i want to capture the error messages and i want to send it to mail.  Can i capture the unprocessed records???
    i think FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> used for sending mail? but how to capture mes or records?
    or Is there any other way to Do it???
    Thankning you.,
    Ram

    Hi Ramakrishna,
       Once you create the session, Process the session using
    the report RSBDCSUB using submit statement.
    It would list out the erroneous records.
    Hence, while submitting, just say submit RSBDCSUB in background and export output list to memory.,
    Then you can retrieve the list from memory using the FM LIST_FROM_MEMORY into the internal table and finally send the email by the fm you have already mentioned.
    Regards,
    Ravi

  • Capturing the error messages generated by ALV Grid

    Hi,
    I have a ALV Grid, and a field date of DATS type.
    If i enter wrong date a message pops up with invalid date entry.
    How can i capture this error message in ALV Grid.

    Hi,
    Instead of displaying the error message directly, capture the message into a string variable and display it along with the grid display.
    Thanks,
    Sri.

  • Oracle error message code 1401 op 4, ORA-01401: inserted value too large fo

    Hi All
    I got this error when I try to run convert tables on our application server. Anyone know why? I am using Oracle 9i
    Here is the error message:
    Checking Table WORK_INSTRUCTION
    Table not in database
    Conversion Method - Create Table
    Creating Table WORK_INSTRUCTION
    Unable to create database table 'WORK_INSTRUCTION'
    Oracle error message code 1401 op 4, ORA-01401: inserted value too large for column
    WORK_INSTRUCTION definition as followings:
    table work_instruction;
    field identity
         used_for unique_key
         datatype identity;
    { APR 31/3/03 - Bug Nr WI4}
    field wi_admin
    {         links_to personnel . identity;}
    {         links_to location . identity;}
         links_to lab_section . identity;
    { ARP 31/3/03 - Bug Nr WI5 }
    field wi_title
    {         datatype text(20);   }
         datatype text(100);
    field version
              datatype text ( 4 );
    field wi_status
         datatype identity
         prompt_type choose
         choose_type WI_STATUS
         default 'I ' ;
    field wi_type
         datatype identity
         prompt_type choose
         choose_type WI_TYPE
         default '0 ';
    field sterlab_status
         datatype identity
         prompt_type choose
         choose_type STER_STAT
         default '0 ';
    field used_in_lims
         datatype boolean
         true_word 'Yes'
         false_word 'No'
         default 'No' ;
    { ARP WI16 28/5/03 - Extend from 10 to 45 }
    field method
         datatype text(45);
    field ref_method
         datatype text(100);
    field delegate
         links_to personnel . identity;
    field date_expire
         datatype date;
    field date_draft
         datatype date;
    field double_method
         datatype boolean
         true_word 'Yes'
         false_word 'No'
         default 'No' ;
    field technique
         datatype identity
         prompt_type choose
         choose_type TECHNIQUE
         default '0 ';
    field date_distribute
         datatype date;
    field report_date
         datatype date;
    field group_autho
         datatype text ( 16 );
    field astm_volume
         datatype text ( 6 );
    field date_non_active
         datatype date;
    field translated_in
         datatype text(10);
    { ARP WI16 28/5/03 - Extend from 60 to 2000 }
    field comments
         datatype text(2000);
    field doc_path
         datatype text ( 300 )
         prompt_type user_defined
         library 'TEST_SOP_FILE'
         routine 'file_browse';
    field modified_on
         datatype date
         used_for modified_on ;
    field modified_by
         links_to personnel.identity
         used_for modified_by;
    field modifiable
         datatype boolean
         used_for modifiable;
    field removeflag datatype boolean
         used_for remove_flag;
    { MOD TDR - 10/04/03 - Link to livelink document }
    field livelink_url
    datatype text ( 300 ) ;
    Thanks
    Li

    Verbatim from the manual:
    ORA-01401:     inserted value too large for column
    Cause:     The value entered is larger than the maximum width defined for the column.
    Action:     Enter a value smaller than the column width or use the MODIFY option with ALTER TABLE to expand the column width.You should find which value is bein attempted to be inserted into a column with a capacity shorter than the value length.
    ~ Madrid.

  • Oracle error message code 1653 op 4, ORA-01653: unable to extend table

    Hi
    Our application use Oracle 9i as database. I modified one of tables and try to convert it from this application, then I got an Oralce 1653 error as followings:
    Creating Table SAMPLE_T
    Copying data from SAMPLE to SAMPLE_T
    Unable to move data from table 'SAMPLE' to table 'SAMPLE_T'
    Oracle error message code 1653 op 4, ORA-01653: unable to extend table SAND.SAMPLE_T by 1024 in tablespace SAMPLE_RESULT
    I suspect the tablespace SAMPLE_RESULT is not big enough and also can not extended automatically, but not sure if it is right or there maybe other reasons behind this error.
    Any idea?
    Thanks
    Li

    Lets try .....
    SQL> select tablespace_name,sum(bytes)/1024 from dba_free_space where tablespace_name='USERS' group by tablespace_name;
    TABLESPACE_NAME                SUM(BYTES)/1024
    USERS                                      384
    SQL> alter database datafile 'C:\ORACLE\ORADATA\MYDB\USERS01.DBF' autoextend off;
    SQL> alter table scott.emp allocate extent;
    Table altered.
    SQL> /
    alter table scott.emp allocate extent
    ERROR at line 1:
    ORA-01653: unable to extend table SCOTT.EMP by 128 in tablespace USERSI believe you must add more space to tablespace SAMPLE_RESULT or set the autoextend on for associated datafiles.
    Hope it help ..
    Bhupinder

  • Oracle error message categorization

    Good morning,
    Do you know any document / url classifying ORACLE ERROR messages by category (for exemple connexion issue / memory issue / datafile issue etc)?
    The purpose is to grop log file and generate a call in case of specific Oracle error.
    In case of connexion issue - user not allowed to connect on a schema - I should raise a call
    In case of autoextend issue, I should raise a call.
    Thank you.

    arrgh,
    I found this doco but I was hoping something else exist
    Thanks
    --Simon                                                                                                                                                                           

  • Capturing Runtime Error Messages From ODI (Sunopsis) Operator

    Hi
    I have following question
    1) I want to capture error message of an activity that has failed during execution
    I have created a variable and used following query to capture it
    select T.TXT
    from <%=odiRef.getObjectName("L","SNP_EXP_TXT","D")%> T,
    <%=odiRef.getObjectName("L","SNP_STEP_LOG","D")%> S
    where S.SESS_NO = <%=odiRef.getSession("SESS_NO")%>
    and S.I_TXT_STEP_MESS = T.I_TXT
    order by T.TXT_ORD asc
    unfortunatly am not getting entire error message ,instead am getting first row of the error from SNP_EXP_TXT table.How to get entire error message in a variable.
    2) How can we know scenario name if we know session number?
    Please provide your inputs
    Thanks
    Baji

    Hi,
    Don't use this query, it won't work.
    Use the API GetPrevStepLog, it is simple and better...
    Take a look at:
    Use the http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/documentation/oracledi_api_reference.pdf
    For the session name, just use getSession() Method ( too is at the pdf)
    I hope be helpful.
    Cezar
    Edited by: Cezar Santos on 21/11/2008 09:16

  • Capturing oracle error codes into a variable

    Hi
    Can someone show me how it is possible to save an Oracle defined error code into a variable? What I am trying to do is when a stored procedure fails an Oracle error is raised, such as ORA-xxxx, then pass this code into variable to be saved into a log.
    How do I achieve this?

    user633278 wrote:
    How do I achieve this?Function SQLCODE in PL/SQL exception handler returns error code. SQLERRM returns message:
    SQL> declare
      2      x number;
      3  begin
      4      x := 1/0;
      5    exception
      6      when others
      7        then
      8          dbms_output.put_line('Error code: ' || SQLCODE);
      9          dbms_output.put_line('Error message: ' || SQLERRM);
    10  end;
    11  /
    Error code: -1476
    Error message: ORA-01476: divisor is equal to zero
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Capturing custom error message from alert category

    We are using XSLT mapping and We are raising custom error message based upon some conditions i.e if vendor number is invalid or blank.If it doesn't meet the requirement,mapping will fail and it will throw error message as" IDoc XXXXXXXXX is having invalid vendor number".
    My question is,we would like to send this custom error message to email receipients through RWB-AFW.
    How do we capture this custom error message is alert category or alert rule?

    You can not unless u use BPM.
    VJ

  • Handling Oracle error messages

    I'm hoping this is a simple question.
    I have an updatable report I'm using to collect data. It's pretty vanilla - I just used the default templates. I have a unique index constraint on the form's underlying table. When I violate the constraint and attempt to save a row, I get redirected to what looks to be a default error page that isn't very user friendly.
    Can someone tell me how I can specify a different error message depending on the error number Oracle returns?
    Thanks for any info.

    The whole problem is divided in two parts: Exception is defined or not, I'll show you haow to handle exception that do not exist and want to trap them.
    I saw that there is no named exception for ORA error "-00054", which is raised when record is locked. So I define my exception as:
    busy_resource EXCEPTION;
      PRAGMA EXCEPTION_INIT(busy_resource, -00054);Now to handle this exception in the Appex process looks like:
    begin
      ...your code ...
      :PXX_msg := 'OK!';
    exception
      when busy_resource THEN
        :PXX_msg := 'Record is locked. Try later';
      when others then
        :PXX_msg := 'Unknown error!;
    end;where "PXX_msg" is hidden item acesable on the page, XX represent page number.
    And in "Process Error Message" part of process don't put anything because all errors are handled and error will never happened. If you want that part put in excepttion part "RAISE;" command so erro will be raised!!!
    And in "Process Success Message" of the same process put also:
    "&PXX_msg."
    So you can see the result in much pleasent way!
    You have the same variable as result and now all to do is imagine exceptions that could happened. For the first time allways try to put some logging in "WHEN OTHERS THEN" part top collect as much as possible errors that could happened.
    Hope this helps!

  • Lookup of Oracle Error Message at application level

    Hi
    I'm writing a c# application that connects to an oracle database. My application queries a table containing a column with oracle error codes BUT NO ERROR MESSAGES. The application must show these error descriptions to the user. As I cannot expect the user to know errorcodes, the application should be able to translate it into the error message
    e.g.: instead of showing "ORA-13349" I'd like to show a textbox "polygon boundary crosses itself".
    Question: is the mapping <error_code, error_message> accessible to an application? How ?
    Thank you,
    Marco
    ps: it's not possible to change the stored procedure! I've to solve it at the application level

    You can use the function: standard.sqlerrm and pass as parameter the number of the error.
    http://www.tunzi.ch/page.php?name=errm
    Bye, Aron

  • Oracle Error Messages....

    Just trying to confirm something I suspect to be true. If Oracle encounters an error when your client machine cannot find the database specified in the tnsnames.ora file would you receive one or both of the following error messages?
    ORA-12198: TNS: could not find path to destination
    ORA-12203: TNS: unable to connect to destination
    I suspect this would be an either or situation but am unable to confirm it through technet.

    Here's what I found in the docs:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    TNS-12198 TNS:could not find path to destination
    Cause: Could not navigate a path through Interchanges to the destination. This error occurs if an invalid community is in the address string, or the address includes a protocol that is not available or the TNSNAV.ORA file does not have a correct CMANAGER address specified or the Interchange is down.
    Action: Assure that Interchanges necessary to get to the desired destination are up and have available capacity for an additional connection. Also check that the correct community and protocol have been specified in the CMANAGER address used.
    <HR></BLOCKQUOTE>
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    TNS-12203 TNS:unable to connect to destination
    Cause: Invalid TNS address supplied or destination is not listening. This error can also occur because of underlying network transport problems.
    Action: Verify that the service name you entered on the command line was correct. Ensure that the listener is running at the remote node and that the ADDRESS parameters specified in TNSNAMES.ORA are correct. Finally, check that all Interchanges needed to make the connection are up and running.
    <HR></BLOCKQUOTE>
    Regards,
    -rh
    null

  • ORACLE Error Message - ORA-25254

    I need help correcting this error message while starting dbconsole.
    ORA-25254: time-out in LISTEN while waiting for a message
    Cause: The specified wait time has elapsed and there were no messages for any of the agents in the agent-list.
    Action: Try the LISTEN call with an appropriate time-out.

    I still cannot resolve this error. Does anyone knows how to fix it?

  • Oracle error message at sql prompt

    Dear,
    what is the command that is used to display the error message and action at the sql command prompt.....
    Thanks and regards
    Vijay

    I thought OERR tool is missing or not installed with my Oracle9i version in
    WindowsXP likewise I'm unable to use TKPROF utility also which is not
    been provided in Oracle9i-R1.
    I presumed OERR and TKPROF utilities are not provided in 9i for Windows,
    until you clarified that OERR executes under Unix only.
    Thanks Pierre,

Maybe you are looking for

  • HT201077 How do I get my shared photo streams from my ipad to my iPhone?

    How do I get my photo streams from my ipad to sync to my iphone?

  • Support Package is obsolete

    Hi there, I've been upgrading the SAP Solution Manager EHP1 from support package 19 to 24, but i have a serious problem and i was not able to find a solution neither at SAP Support Portal nor at SAP SDN. Actually, the OCS SAPKW70020/21/22/23 were not

  • Content-Type: text/plain

    Hours after I MMS a picture or video I get the following message. Anyone know what it means?? The message seems to go through but not sure if complete. Re: Content-Type: text/plain; boundary="_CONTENT_64564_PART_BOUNDARY__33243242_"

  • Interpreting Frame Rate issues

    Hey guys, got a tough one here: I'm rendering Toonboom animations to Quicktime Mov Files at 24fps - although when i import them into Premiere CS6 it will only 50% of the time recognise the correct frame rate - the other times it will choose a random

  • Official list of supported graphics cards for HP IPISB-CH2 motherboard

    Hi, Is there any official list of supported graphics cards for HP motherboards (specifically HP IPISB-CH2 (Chicago))? I've been trying to upgrade my graphics for MSI GTX 960, but found out the MB's BIOS (v. 7.12) is incompatible and there's no BIOS u