Raise error in a trigger

Hi
I have a question about a trigger.
The purpose of this trigger is to prevent modifications being made to a record.
TRIGGER AR_APPLICATIONS_ARU BEFORE UPDATE OF DISPLAY ON AR.AR_RECEIVABLE_APPLICATIONS_ALL
FOR EACH ROW
DECLARE
e_ERRORNAME EXCEPTION;
e_TEST EXCEPTION;
PRAGMA EXCEPTION_INIT(e_TEST, -06512);
BEGIN
   IF (:NEW.DISPLAY = 'N') AND (:OLD.DISPLAY= 'Y') AND ((:OLD.ATTRIBUTE13='PAYED') OR (:OLD.ATTRIBUTE13='PAID'))
    THEN
     RAISE_APPLICATION_ERROR(-20001,'-----------Test foutmelding!-------------');
   END IF;
END;This trigger shoots when it should, but I get also other error messages:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "APPS.FND_MESSAGE", line 581
ORA-06512: at "APPS.FND_MESSAGE", line 537
ORA-06512: at "APPS.APP_EXCEPTION", line 42
ORA-06512: at "APPS.ARP_APP_PKG", line 681
ORA-20001: -----------Test foutmelding!-------------
ORA-06512: at "APPS.XXABET_AR_APPLICATIONS_ARU", line 17
ORA-04088: error during execution of trigger 'APPS.XXABET_AR_APPLICATIONS_ARU'
ORA-06512: at "APPS.ARP_PROCESS_APPLICATION", line 522
FRM-40735: ON-UPDATE trigger raised unhandled exception ORA-06502.What do I do wrong, or how can I suppress those messages?

this works for me:
create table ar_receivable_applications_all (display varchar2(1), attribute13 varchar2(10));
  1  create or replace TRIGGER AR_APPLICATIONS_ARU BEFORE UPDATE OF DISPLAY ON
  2  AR_RECEIVABLE_APPLICATIONS_ALL
  3  FOR EACH ROW
  4  when (old.attribute13 in ('PAYED','PAID'))
  5  BEGIN
  6     IF :NEW.DISPLAY = 'N' AND :OLD.DISPLAY = 'Y'
  7      THEN
  8       RAISE_APPLICATION_ERROR(-20001,'-----------Test foutmelding!-------------');
  9     END IF;
10* END;
SQL> /
Trigger created.
SQL> insert into ar_receivable_applications_all values ('Y','PAID');
1 row created.
SQL> commit;
Commit complete.
SQL> update ar_receivable_applications_all set display='N';
update ar_receivable_applications_all set display='N'
ERROR at line 1:
ORA-20001: -----------Test foutmelding!-------------
ORA-06512: at "WEBPROD.AR_APPLICATIONS_ARU", line 4
ORA-04088: error during execution of trigger 'WEBPROD.AR_APPLICATIONS_ARU'
SQL>

Similar Messages

  • Help me, why Oracle Application raised error:no such trigger.

    Dear friend,
    I have developed a form program in FORMs 6I, and it works in my ORACLE APPLICATIONS ,but after it is installed in another Server,it popup the error windown, it said : FRM-40700:No such trigger:menu_to_appcore.
    I don't know why, somebody told me ,the oracle application with different vesion will cause this problem, is it true?, if it's true, how can i avoid it if i have to use those triggers.
    Thanks a lot.
    regards,
    willen 2002/06/27

    Willen,
    I suggest you review the Oracle Applications Developer's Guide (http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115devg.pdf). More than likely, your form does not include one or more of the required libraries or other subclassed objects required for an Applications Form. I highly recommend you base any Custom Form on the provided TEMPLATE.fmb that comes with Apps. This will ensure you have all the required objects in your form and the library paths are neutral (no hard-coded file paths to the library - which could be the cause of your error).
    somebody told me ,the oracle application with different vesion will cause this problem,As to this statement, you need to contact your DBA or Apps Server admin to find out which version of Oracle Forms is installed on the Apps Server. Your development environment must match. For example, Forms 6i patchset 18 installed on the Apps Server, you should have Forms 6i patchset 18 installed on your workstation. It will work if your workstation has a lower version than the Apps Server, but you're asking for trouble if you have a newer version installed on your workstation.
    Hope this helps.
    Craig...
    P.S. The E-Bus Suite forum is the more appropriate forum for an Applications question. This forum is for non-EBS Forms development. :-)

  • How to raise error message from PAI of oops ALV report

    Hi All,
    I have a requirement to raise error message form editable oops alv . After entering the data and then press SAVE button .
    Please help.
    Thanks in Advance

    HI SK,
    Write a Local class (Event Handeler) to handel the events. In Editable ALV once the user enter a value, CL_GUI_ALV_GRID will raise an event called DATA_CHANGED.
    1. Define and Implement a local class to handle that event.
    In the implementation of this class you need to get data from imported object to an internal table, then compare the same with the ALV output table.
    * Local Class to handler the events raised from the ALV Grid
    CLASS LCL_EVENT_HANDLER DEFINITION.
    PUBLIC SECTION.
    * Method to handel EDIT event, DATA_CHANGED of CL_GUI_ALV_GRID
      METHODS : ON_DATA_CHANGE FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
                           IMPORTING ER_DATA_CHANGED.
    ENDCLASS.
    * Event handler class Implementation
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
      METHOD ON_DATA_CHANGE.
        DATA : LT_MODIFY TYPE LVC_T_MODI,
                   LS_MODIFY TYPE LVC_S_MODI.
    * Copying changed data into intenal table from Object
        LT_MODIFY = ER_DATA_CHANGED->MT_MOD_CELLS.
    * Modifying the ouptut table with the changed values
        IF LT_MODIFY[] IS NOT INITIAL.
              *Compare the ALV Output table with LT_MODIFY
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    Then raise  a message on required condition in the same method.
    Note: To trigger the above method, you need to set event handler before displaying ALV (before calling method SET_TABLE_FOR_FIRST_DISPLAY)
    * Creating object for the Local event handler class
      CREATE OBJECT GR_HANDLER.
    * Set handler (call method of Event_handler) to handler Edit event
      SET HANDLER GR_HANDLER->ON_DATA_CHANGE FOR  GR_GRID.
    Regards,
    Vijay

  • How can I obtain an specific message raised by a database trigger

    Dear friends,
    if I have a database trigger and I want to show an error message which was raised from a database trigger to a form, I can do it by raising an application error inside database trigger, and by showing DBMS_ERROR_TEXT inside ON-ERROR trigger. This is ok for me.
    But how can I do if I want to show a specific message? Let's say I have a BEFORE INSERT table trigger, and I want to verify whether data was correctly informed (for example, "user name must be entered"). If I raise an application error, I see a very big error message which includes both my personal error message and database message.
    Surely I can do a SUBSTR in this message, but can't I do something easier? Let's say I put all error messages in a variable:
    (Let's suppose it's a BEFORE INSERT trigger code, which is related to my table)
    if :NEW.user_name is null then
    p_error_message := 'User name must be entered.';
    end if;
    if p_error_message is not null then
    raise_application_error (-20000, p_error_message);
    end if;
    ... with this p_error_message being shown to final user, with no need to edit it via PL/SQL instructions like SUBSTR. Is this possible? If not, I'll be quite satisfied with SUBSTR because it fits my needs somehow.
    Best regards,

    raise_application_error will be used for raise errors on form.here i'm providing u the example
    CREATE TRIGGER at AFTER UPDATE OR DELETE OR INSERT ON emp
    for each row
    declare
    v_1 number
    begin
    select empno into v_1 from emp where empno=7369 ;
    exception when no_data_found then
    RAISE_APPLICATION_ERROR(-20001,'No data found'||sqlerrm);
    END;
    now when you insert data on emp table through form. if value does not found of selected empno then No data found will be shown on form
    Edited by: SKYNIAZI on Mar 20, 2009 12:19 PM
    Edited by: SKYNIAZI on Mar 20, 2009 12:56 PM

  • Help raise error

    Hi,
    I'm using forms6i
    I have 2 datablocks in my form, which is a master detail block,say call_header and call_details.
    Now
    1) i want to prevent the insertion of new record in header table (call_header) if the details are not there .
    User can just enter details in header section and leave details section blank , in that case,when user tries to save, form should raise error showing that call details are not entered.
    2) If at first time user enters all the details(header and details) and then afterwards, he queries and delte the details section and try to save, in that case also error should be raised.
    Please help

    Arif,
    Sorry , but this form works in a weird way! :(
    I have created another count item as you told, in the header block, and in pre-insert trigger
    I've written
    msg_alert('Count '||:COUNT_HEADER,'I',FALSE);
    if NVL (:COUNT_HEADER, 0) <= 0 THEN
         Msg_Alert ('Enter Call Details !','I',FALSE);
         RAISE Form_Trigger_Failure;
    else
         select nvl(max(HCH_CALL_ID),0)+1 into :HCH_CALL_ID
                   from HLP_CALL_HEADER;
         Msg_Alert ('The generated Call ID:'||:HCH_CALL_ID,'I',FALSE);
                   :HCH_ORGN := :Global.orgn;
                   :HCH_CRT_ON := sysdate;
                   :HCH_UPD_ON := sysdate;
                   :HCH_CRT_BY := :Global.usr;
                   :HCH_UPD_BY := :Global.usr;
    end if;It shows the alert message to 'Enter Call Details', but it is not stopping. It is then clearing the form.
    In key-commit at form level, i have
    commit_form;
      IF FORM_SUCCESS THEN
           msg_alert('form success','I',FALSE);
         CLEAR_FORM(NO_VALIDATE);
         EXECUTE_TRIGGER('PRE-FORM');
      END IF;and it is showing form success message, but though it showed enter call details message.
    Why it doent raise form failure!?

  • Cash Management - Open interface - raise error

    in Cash Management - Bank Reconciliation, Open interface,
    APPS.CE_999_PKG.clear
    and
    APPS.CE_999_PKG.unclear
    i would like to check and if meet certain condition, i would like to raise error/exception, so that the Reconcile or UnReconcile can not proceed, how can I do that?
    i try to do a plsql 'raise exception', in ebs screen, show
    'FRM-40734: Internal Error: PL/SQl error occurred.'
    anyway to show the error msg in a popup msg box and/or display with more meaningful error message?

    Hi Brian,
    This is because, one payment/receipt cannot be shared by more than one bank statement line. This is why once payment/receipt is reconciled against a bank statement line, you can view this transaction only from reconciled screen.
    Regards,
    Kiran

  • Error -- No Such Trigger('when-button-pressed')

    Hi,
    I am getting the error ""No Such Trigger('when-button-pressed')"",
    when I am executing the code EXECUTE_TRIGGER( 'WHEN-BUTTON-PRESSED' );
    on some item(Key-Next-Item), although WHEN-BUTTON-PRESSED trigger exists.
    What could be the problem ?. It worked till yesterday, giving error from today, I havent
    changed any thing.
    Thanks in Advance
    Devender

    Steve's tip is the only good solution for this case.
    The problem in your case for example is:
    Let's say you have a block-trigger, which fires after your execute-trigger.
    Now a colleague of you, which don't know your code, create a WHEN-BUTTON-PRESSED on an item, then the new code is started and not the block-trigger-code.
    So, don't ever do this. Write your code in a package-function or -procedure and call it from the trigger. So you can re-user the functionality
    Gerd

  • Getting error while creating trigger!!

    Hi Guys,
    I am getting the following error while creating trigger in Oracle10g Database in TOAD environment.
    Error: PLS-00306: wrong number or types of arguments in call to '='
    Table details:
    One of the column having BLOB Data type in the table.
    In the trigger, I have compared :old and :new values.
    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_NEW(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    Any one knows about this issue, please let me know with the proper solution.
    Thanks for your immediate response!
    Regards,
    Lakshman

    CREATE OR REPLACE TRIGGER INPL.trigger_new
    AFTER INSERT OR UPDATE OR DELETE
    ON TABLE_NEW REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    action_flag VARCHAR2(1);
    new_image BLOB;
    BEGIN
    IF UPDATING
    THEN
    action_flag := 'U';
    ELSIF DELETING
    THEN
    action_flag := 'D';
    ELSIF INSERTING
    THEN
    action_flag := 'I';
    END IF;
    IF (:NEW.image = :OLD.image)
    THEN
    new_image := '';
    ELSE
    new_image := :NEW.image;
    END IF;
    INSERT INTO TABLE_AUD(action_flag, date_changed,nimage,oimage) values(new_image,:old.image);
    end;
    I am getting the error in line at If condition
    Error: PLS-00306: Wrong number or tpyes of arguments in call '='
    Please let me know if any one knows exact solution!
    Thanks in advance!
    Regards,
    Lakshman

  • How to raise error in Essbase UDF.

    Hi all.
    I have an udf:
    pulbic statuc void publish(String arg) throws RTimeException {
    throws new RTimeException ("error");
    and RTimeException defiend as:
    class RTimeException extends Exception
    RTimeException()
    RTimeException(String msg)
    super(msg);
    When i call the UDF from a business rule, it completes without any error.
    How to raise error to force the business rule to fail?
    Oleg.

    UP!

  • Query running ok in SQL but giving error in form trigger

    Hi guys
    here is the query
    SELECT NVL(BGM_PERAMT,0) INTO PERAMT FROM BROKERAGE_MASTER
    WHERE     BGM_BROKERAGETYPE = 'BR01' AND BGM_PERAMT <> 0
    The above query working fine in SQL but giving following error in when_button_pressed trigger
    [In a host language program, all records have been fetched. The return code from the fetch was +4 indicating that all records have been returned from the SQL query. ]
    please give me the solution for this problem.
    It is very urgent
    regards
    asha

    ok below is the code
    CURSOR RESALE_BROKERAGE IS SELECT am_brokerCd resalebrcd,'' resalesbrcd,NVL(SUM(AM_AMT),0) RESALE_AMT,COUNT(AM_RESALENO) TOTCNT,NVL(SUM(AM_UNITSAPPLD),0) RESALE_UNITS
    FROMRNT_RESALE_MASTER
    WHERE am_brokercd is not null AND AM_PROCTAG='Y' AND
    (to_date(to_char(AM_PROCDT,'DD/MON/YYYY')) BETWEEN
    to_date(to_char(:rnt_broker_date.fromdt,'DD/MON/YYYY')) AND
    to_date(to_char(:rnt_broker_date.todate,'DD/MON/YYYY')))
    GROUP BY am_brokerCd
    UNION
    SELECT AM_BROKERCD resalebrcd,     
    am_subbrokercd resalesbrcd,
    NVL(SUM(AM_AMT),0) RESALE_AMT,COUNT(AM_RESALENO) TOTCNT,
    NVL(SUM(AM_UNITSAPPLD),0) RESALE_UNITS
    FROM RNT_RESALE_MASTER
    WHERE     am_brokercd is not null AND AM_PROCTAG='Y' AND AM_BROKERCD = 'ARN-9760' AND (to_date(to_charAM_PROCDT,'DD/MON/YYYY')) BETWEEN
    to_date(to_char(:rnt_broker_date.fromdt,'DD/MON/YYYY')) AND
    to_date(to_char(:rnt_broker_date.todate,'DD/MON/YYYY')))
    GROUP BY AM_BROKERCD,am_subbrokercd;
    Asha

  • Raising Error in Process BTE 1120? is it safe?

    Dear all Experts,
    Iam using Process BTE - 00001120, to validate many things. It gets triggered in almost every FI document just beofre saving the document.  My Question is, is it safe to raise Error Message in this BTE as it gets triggered just before saving? If you can guide me to any FAQ's on BTE, it will be helpful.
    Note : Please answer the question if you have worked on the said BTE and if you have knowledge on it.
    Thanks & Regards,
    Faheem.

    Hi Nabeehatmadan,
    Thanks for the quick reply.Firstly I have not worked extensively on FI VALIDATIONS & SUBSTITUTIONS.As far as my knowledge and understanding , FI Validations & Substitutions are provided by SAP & we dont need to register Access Key for the same. But please check the Page 2 of the note 842318, which states :
    If you create a substitution, for example "Financial accounting - document
    line item", only certain fields are authorized for the substitution. This
    is because it may lead to problems with the documents or inconsistencies
    between different applications.
    It is possible to release more fields for substitution. However, this can
    be critical, as serious problems can occur as a result.
    This is why you should regard the following change as a modification (Note
    170183).
    And as I said that I have to raise error messages based on my checks and I have to use User Exits for the same to get my checks done as my checks includes conversions of WBS/Project compared with assignment etc etc , which cannot be done directly. Now check Page no 4 of the same note which states we cannot issue Messages :
    3. What must I take into account when implementing the user exit?
    No dialog boxes, warning messages, information or error messages must be
    issued in an exit, and a "COMMIT WORK" must not be rejected. This would,
    for example, interrupt the batch processing or cause problems with the
    documents to be posted. If you find a serious error in the field contents
    in the exit, send a termination message (A or X), which will ensure that
    the transaction is terminated.
    Please guide me if iam wrong ?
    Please let me know if we can issue error messages in BTE 1120?
    Thanks & Regards,
    Faheem.

  • Raising Error in Screen

    Hi,
    I have a requirement to raise error in Screen(Module Pool) and again allow user to stay in the same screen.But if i raise error then it is throwing user directly out of transaction.
    For example,if we see in VL02N we will get error while providing serial number during picking or packing but it will still allow user to stay in the same screen.But in my case i have customized VL02N and i am not able to raise error in the same way as it is throwing me out of transaction.
    Is there any transaction to maintain Eror type based on application or is there any way to handle this as an exception at screen level.?
    Please find attahement for the same.
    Regards,
    Venu

    some message types will behave differently in a dialog transaction...there is a lot of info in the help on this
    however, try using the addition
    DISPLAY LIKE of the statement MESSAGE.
    so, for example,
    message 'my message' type 'S' display like 'E'.
    try some different variants of the example above to give you the behaviour that fits best

  • Need a BADI for raising error messages for equi update (IE02)

    Hi,
    we are trying to raise few error messages while creating equipments through BADI's (Processing through IE02 and BAPI's).
    No BADI's are supporting for raising error messages.
    SAP doesnt support processing of userexits through BAPI's (refer note 564467).
    we actually need to implement these checks and should available for all the below processes:
    Through IE02
    while doing through BAPI's
    While Executing MASS CHANGE functionality (IE05)
    Please suggest any other solution to achieve all the three at one go instead of creating some enhancements for every thing.
    thanks.

    Hi,
    Try and search for a BADI....for transaction I102...take the package name and go to SE18 and see if BADI's are available...
    Alternatively search for key CL_EXITHANDLER or get BADI in the main program of IE02..
    if you are using SAP ECC6.0 then implicit or explicit enhancements will be available... Utilize them to meet your requirement...
    Thanks

  • While os db migration standrad table raising error

    Hi gurus,
                My basis team doing os db migration after export when they are trying to import data they are terminating due to problem that  at the standrad table SMEN_DATES it is raising error VIOLATION OF PRIMARY KEY. So we checked for the table contents
    in that table TYP and ID as primary key fileds but in contents there are entries with same combination of TYP and ID. Now problem is that  how to rectify that primary key violation with out modifying data.
    Thanks in advance,
    Santhi.

    It's not feasible to "rectify". The data has to be changed to conform to the database key.

  • Differences in the Usage of Raise Error  in the versions 11.1.3 and 11.1.4

    What is the differnces between the usage of Raise error in the versions 11.1.3 and 11.1.4 in OSB?
    Do let me know regardin this issue.
    Thank you!

    Hi, iTunes Store Help 12. 
    Thank you for visiting Apple Support Communities. 
    Here is an article I would recommend going through when experiencing issues with the iTunes Store. 
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/ts3297
    Cheers,
    Jason H. 

Maybe you are looking for

  • Help me out on this one ?

    Hi, maybe sumone can help me out. Suppose i have made a payment ( document type 'KZ')                 debit         credit bank            9,500                Tax              500 vendor                        10,000 I am making a report for cleared

  • Payment advice mailing to vendor

    Hi SDN users, Can any one give the producer  that how can the  payment advice will mail to vendor. please provide step by step configuraction and producer.

  • How to display PDF on each device

    We observed some mobile devices don't open the PDF directly and start to download. Does this depend on OS, Browser or something else? We tested iPhone and Android. Android starts to dawnload PDF by clicking PDF on our application. User has to open th

  • Remove pipe delimited and  quotes USING SAME ctL FILE

    i need to remove quotes and delimited(|) using control file in SQL LOADER. I am able to remove delimited but not able to " "(quotes).Can any one help me? "1"|"tom "|"newyork" LOAD DATA INSERT INTO TABLE temp_table FIELDS TERMINATED BY "|" TRAILING NU

  • Upgrade WLC 5508 to 7.3x or 7.4x?

    Hi Community, In order to enbale HA SSO on our two 5008 WLC's, I plan to upgrade them to 7.3 / 7.4 (currently 7.2) Right now 7.3.112.0 is the latest release. We do not have any 1600 series AP's, which requires 7.4. So here's my question..any reason g