GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM

GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM
Here is my code...
IF TRIGGER_NAME = 'WHEN_VALIDATE_ITEM' THEN
FND_MESSAGE.DEBUG('Error!);
GO_ITEM('abc.xyz');
END IF
After I clicked 'OK' on the message the GO_ITEM doesn't point to the desire item.
Thanks.

that's moroe than easy. Raise Form_Trigger_Failure :-)
WHEN-VALIDATE-ITEM :
BEGIN
  IF TRIGGER_NAME = 'WHEN_VALIDATE_ITEM' THEN
    FND_MESSAGE.DEBUG('Error!);
    IF something_goes_wrong THEN
      RAISE FORM_TRIGGER_FAILURE;
    END IF;
    One_Time_Timer.Initialize (Const.ott_Query);
  END IF
EXCEPTION
  WHEN FORM_TRIGGER_FAILURE THEN
    RAISE;
END;
[(pre]
try it
Gerd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Select Into code not working in Trigger

    Hello there,
    I was hoping somebody could give me the solution to this problem ,
    I have a scenarior in which I was trying to insert into table B if an insert occurs on Table A by the use of a trigger on table A .
    Here is the code:
    BEGIN
    IF INSERTING THEN
    select MAX(Val1),MAX(Val2)
    INTO localVar_1 ,localVar_2
    from tableC,tableD
    where <<some join condition>>
    INSERT INTO TABLEB(col1 ,
    col2,
    col3,
    col4,
    col5,
    col6,
    col7,
    col8,
    col9)
    VALUES(:new.someValue1,
    :new.someValue2,
    :new.someValue3,
    localVar_1,
    localVar_2,
    :new.someValue4,
    :new.someValue5,
    :new.someValue6,
    :new.someValue7);
    END IF;
    The Error I get is ORA-01400 "Cannot Insert Null Into" "Schema"."Table"."Column" . I suspect my localVar_1 to be nulled out ,which brings into question the SELECT INTO prior to this which is supposed to assign a value to these variables , If I do just a SELECT that seems to work but SELECT INTO seems to be having problems . Any suggestions?

    Check the NOT NULL constraint in TABLEB, and if you find any columns having it, try to insert a fixed value and see it it works.
    thanks

  • UTL_SMTP package not working in trigger

    Hello Friends,
    I have created a trigger through which i am trying to send a mail.but it gives an error message as:
    ORA-30678: too many open connections
    Also when i run the same script at the SQL Prompt, it will send the email to mentioned recipients.
    Please help me in resolving this issue...
    Thanks in advance,
    Ankur

    > I have created a trigger through which i am trying to send a mail
    That is a very wrong approach to use. The purpose of a trigger is to protect data integrity. It is not a do-everything-with-it-including-washing-the-windows tool.
    A trigger can submit a DBMS_JOB that in turn will do an e-mail shot. A trigger can insert an e-mail request into a table (queue) for a DBMS_JOB to pick up and process.
    But a trigger that performs external functions (like sending mail, accessing the o/s command line, etc) compromises the business transaction - and make it dependant on external and non-related factors to make it succeed. What if the e-mail address is wrong? What if the POP mailbox of the recipient is full/ What if the mail server is down for 5 minutes maintenance? What if that specific network router/gateway/switch is down?
    Fail the business transaction because of the trigger attempting to do what it is not suppose to do?
    External functions have no place in a trigger.

  • Format Trigger not working in 10g Report.

    I have a report with two eclipses
    (*) Debit (*) Credit . Please note that the two asterics denotes eclipses.
    I have a format triggers on these eclipses based on the database item Debit_credit.
    IF :debit_credit = 'CREDIT' THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    End if;
    and vis-visa. However the format trigger is not working. Regardless of the value of
    debit_credit. I even created a frame around these eclipses and put my format trigger all to no avail. Please help.

    Create a boilerplate text in your repeating frame (get rid of the field :debit_credit from your layout, but leave it in your query). I created the boilerplate field B_1. My format trigger looks like:
    function B_1FormatTrigger return boolean is
    begin
      if upper(:debit_credit) = 'CREDIT' then
           srw.set_field(0, to_char('(*) CREDIT'));
       else srw.set_field(0, to_char('(*) DEBIT'));
      end if;
      return (TRUE);
    end;I hope I understood your question OK...I am not sure what an eclipses is?

  • I'm having an intermittent problem with my midi controllers triggering Mainstage 3. I'm using a PreSonus Firebox audio interface. It's been working fine for months, but now when I first turn on the computer in the morning , I'm not able to trigger Ma

    I’m having an intermittent problem with my midi controllers triggering Mainstage 3.
    I’m using a PreSonus Firebox audio interface.
    It’s been working fine for months, but now when I first turn on the computer in the morning , I’m not able to trigger MainStage from the keyboard.  I tried different midi controllers, different keyboards, different midi cords, and check midi preferences.  The audio interface is working fine and is recogonized, but the midi doesn’twork.  I re-started the computer several times and then finally it miraculously starts working again.
      I’ve been having to this every day now.  Any help or ideas is very much appreciated.

    I Had the same problem with a FireStudio. Try unplugging the FireWire plug and the power plug. Wait for a few seconds, then plug both back in. The light on my FireStudio was flashing blue/red which means "not connecting." I did what I just described, and everything works again. Hope it works for you.

  • It is not working when use trigger to check data from other table.

    Please help me with this, I have put a trigger on a table but it can not work as I expect.
    case study: one class has many students, only one of them goes to match.
    The purpose of this trigger is to check when choose a student goes to match, this student must in his class where he belongs to.
    Version of Oracle is 10.2.0.1.0.
    --table:
    DROP TABLE STU;
    DROP TABLE CLASS;
    create table CLASS(
    CID     VARCHAR2(5)   PRIMARY KEY,
    CNAME   VARCHAR2(20)  NOT NULL,
    SCHOSEN VARCHAR2(5));
    create table STU(
    SID     VARCHAR2(5)   PRIMARY KEY,
    SNAME   VARCHAR2(20)  NOT NULL,
    CID     VARCHAR2(5)   NOT NULL REFERENCES CLASS(CID) ON DELETE CASCADE);
    --data:
    --CLASS
    INSERT INTO CLASS(CID,CNAME) VALUES(1,'SUN');
    INSERT INTO CLASS(CID,CNAME) VALUES(2,'MOON');
    INSERT INTO CLASS(CID,CNAME) VALUES(3,'EARTH');
    --STU
    INSERT INTO STU VALUES(1,'JACK',1);
    INSERT INTO STU VALUES(2,'TOM',1);
    INSERT INTO STU VALUES(3,'LILY',2);
    INSERT INTO STU VALUES(4,'DUSTIN',3);
    --TRIGGER
    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY INTEGER;
    INVALID_STU EXCEPTION;
    VALID_STU EXCEPTION;
    MUTATING_TABLE EXCEPTION;
    PRAGMA EXCEPTION_INIT(MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
      SELECT SID FROM STU, CLASS
      WHERE STU.SID=ST AND STU.CID=CLASS.CID AND CLASS.CID=CL
        FOR UPDATE OF CLASS.SCHOSEN;
    BEGIN
      OPEN DUMMY_CURSOR(:NEW.SCHOSEN, :NEW.CID);
      FETCH DUMMY_CURSOR INTO DUMMY;
      IF DUMMY_CURSOR%NOTFOUND THEN
        RAISE INVALID_STU;
      ELSE
        RAISE VALID_STU;
      END IF;
      CLOSE DUMMY_CURSOR;
    EXCEPTION
      WHEN INVALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
      WHEN VALID_STU THEN
        CLOSE DUMMY_CURSOR;
        DBMS_OUTPUT.PUT_LINE('STUDENT CHOOSE SUCCEFULLY!');
      WHEN MUTATING_TABLE THEN
        NULL;
    END;
    /Just copy and paste above and try to run following:
    UPDATE CLASS
    SET SCHOSEN=3
    WHERE CID=1;
    Clearly,you can not choose student which is 3 as match member of class 1. Please help me. Thanks.
    Edited by: 991096 on 01-Mar-2013 02:36
    Edited by: 991096 on 01-Mar-2013 03:03
    Edited by: 991096 on 01-Mar-2013 03:11

    Hi,
    Welcome to the forum!
    Like the others, I can't see a business purpose for this trigger. I assume it's just an experiment to learn how triggers work.
    991096 wrote:
    Please help me with this, I have put a trigger on a table but it can not be triggered.Sorry, I don't understand what you want help with.
    Are you saying the trigger doesn't fire? It does fire; it just raises the mutating table error, so you don't see anything.
    case study: one class has many students, only one of them goes to match.What do you mean when you say "goes to match"?
    --table:
    DROP TABLE STU;
    DROP TABLE CLASS;
    create table CLASS(
    CID VARCHAR2(5) PRIMARY KEY,
    CNAME VARCHAR2(20) NOT NULL,
    SCHOSEN VARCHAR2(5));
    create table STU(
    SID VARCHAR2(5) PRIMARY KEY,
    SNAME VARCHAR2(20) NOT NULL,
    CID VARCHAR2(5) NOT NULL REFERENCES CLASS(CID) ON DELETE CASCADE);
    --data:
    --CLASS
    INSERT INTO CLASS(CID,CNAME) VALUES(1,'SUN');
    INSERT INTO CLASS(CID,CNAME) VALUES(2,'MOON');
    INSERT INTO CLASS(CID,CNAME) VALUES(3,'EARTH');
    --STU
    INSERT INTO STU VALUES(1,'JACK',1);
    INSERT INTO STU VALUES(2,'TOM',1);
    INSERT INTO STU VALUES(3,'LILY',2);
    INSERT INTO STU VALUES(4,'DUSTIN',3);
    --TRIGGER
    CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY INTEGER;
    INVALID_STU EXCEPTION;
    VALID_STU EXCEPTION;
    MUTATING_TABLE EXCEPTION;
    PRAGMA EXCEPTION_INIT(MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
    SELECT SID FROM STU, CLASS
    WHERE STU.SID=ST AND STU.CID=CLASS.CID AND CLASS.CID=CL
    FOR UPDATE OF CLASS.SCHOSEN;
    BEGIN
    OPEN DUMMY_CURSOR(:NEW.SCHOSEN, :NEW.CID);
    FETCH DUMMY_CURSOR INTO DUMMY;
    IF DUMMY_CURSOR%NOTFOUND THEN
    RAISE INVALID_STU;
    ELSE
    RAISE VALID_STU;
    END IF;
    CLOSE DUMMY_CURSOR;
    EXCEPTION
    WHEN INVALID_STU THEN
    CLOSE DUMMY_CURSOR;
    DBMS_OUTPUT.PUT_LINE('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
    WHEN VALID_STU THEN
    CLOSE DUMMY_CURSOR;
    DBMS_OUTPUT.PUT_LINE('STUDENT CHOOSE SUCCEFULLY!');
    WHEN MUTATING_TABLE THEN
    NULL;
    END;
    /Thanks for posting the CREATE TABLE, INSERT and CREATE TRIGGER statements; that really helps!
    See the forum FAQ {message:id=9360002} for other helpful tips, such as how to use \ tags to post formatted code.
    Just copy and paste above and try to run following:
    UPDATE CLASS
    SET SCHOSEN=3
    WHERE CID=1;
    Clearly,you can not choose student which is 3 as match member of class 1. The trigger did not be triggered. Please help me. Thanks.You can't do DML, or even query, the class table from a FOR EACH ROW trigger on the same class table.
    Add 3 more calls to put_line to see this:CREATE OR REPLACE TRIGGER CHECK_SCHOSEN
    BEFORE INSERT OR UPDATE OF SCHOSEN ON CLASS
    FOR EACH ROW WHEN (NEW.SCHOSEN IS NOT NULL)
    DECLARE
    DUMMY          INTEGER;
    INVALID_STU      EXCEPTION;
    VALID_STU          EXCEPTION;
    MUTATING_TABLE      EXCEPTION;
    PRAGMA           EXCEPTION_INIT (MUTATING_TABLE, -4091);
    CURSOR DUMMY_CURSOR (ST VARCHAR2, CL VARCHAR2) IS
    SELECT SID
         FROM      STU
         ,     CLASS
         WHERE     STU.SID          = ST
         AND     STU.CID          = CLASS.CID
         AND     CLASS.CID     = CL
         FOR UPDATE OF           CLASS.SCHOSEN;
    BEGIN
    dbms_output.put_line (:NEW.schosen || ' = schosen entering check_schosen');     -- ***** NEW *****
    OPEN DUMMY_CURSOR (:NEW.SCHOSEN, :NEW.CID);
    dbms_output.put_line ('Cursor is open now.');     -- ***** NEW *****
    FETCH DUMMY_CURSOR INTO DUMMY;
    IF DUMMY_CURSOR%NOTFOUND THEN
    RAISE INVALID_STU;
    ELSE
    RAISE VALID_STU;
    END IF;
    CLOSE DUMMY_CURSOR;
    EXCEPTION
    WHEN INVALID_STU THEN
    CLOSE DUMMY_CURSOR;
         DBMS_OUTPUT.PUT_LINE ('PLEASE RE-ENTER CLASS ID AND STUDENT ID AS CLASS OR STUDENT IS NOT VALID.');
    WHEN VALID_STU THEN
         CLOSE DUMMY_CURSOR;
         DBMS_OUTPUT.PUT_LINE ('STUDENT CHOOSE SUCCEFULLY!');
    WHEN MUTATING_TABLE THEN
    DBMS_OUTPUT.PUT_LINE ('MUTATING TABLE');     -- ***** NEW *****
         NULL;
    END;
    Output, when trying to UPDATE class:3 = schosen entering check_schosen
    MUTATING TABLE
    1 row updated.
    Obviously, the trigger fired, since you see the message "3 = schosen entering check_schosen"
    Obviously, the OPEN statement raised an error, since you don't see the message 'Cursor is open now.'
    Obviously, the mutating table error was raised, since you see the message 'MUTATING TABLE'.
    So the trigger fired, and went to the EXCEPTION handler almost immediately.  The EXCEPTION handler printed a message, as instructed, and the trigger ended.  Then the actual UPDATE took place.
    I hope this answers your question.
    If not, what is your question?  It may be very clear to you, but a complete mystery to others.  Ask clear questions, such as "Why did ... happen?  I thought ... would happen, be ... as the PL/SQL manual says at ...".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Trigger is not working properly

    Hi,
    I am developing a library application where user is not allowed to take more than 2 books. If he is trying to take 3rd book, a trigger is used from the backend to throw error message, I developed a trigger, but somhow it is not working: Can you anybody help? Code is below:
    create or replace trigger "BOOKS_T1"
    BEFORE
    insert or update on "BOOKS"
    for each row
    declare
    counter1 number(38);
    countstr varchar2(10);
    pragma autonomous_transaction;
    begin
    select count(*) into countstr from books where user_name ='[email protected]';
    counter1:=to_number(countstr);
    IF counter1 > 2 THEN
    RAISE_APPLICATION_ERROR(-20100, 'Sorry, you have already taken 2 books. Please return a book and try');
    END IF;
    end;
    Books - Table Name
    User_name - one of the column in Books table, where the name of the user is stored.
    Right now, the user_name, I am using here is static, that is I give the name manually, but in the APEX application is should be APP_USER, how can this be done. Also, if there are also any better ways to handle this validation, other than using triggers, please let me know.
    Thanks!
    Edited by: Suzi on May 10, 2010 11:38 PM

    Suzi,
    i think you chose the worst method of doing this and I'll try to explain why:
    you have a relation table where you keep track of books per user and this forces you to perform a select count every time inside a trigger. This is bad, especially if you didn't create an index on the user_name column.
    Moreover you are going to bury some apex logic inside this trigger without any real reason.
    At this point it would be easier to move this validation checks to the place where they belong to: apex.
    Create an EXISTS or NOT EXISTS type of validation where you are free to use :APP_USER without having to resort to v('APP_USER') inside a trigger;
    The reason for using a trigger in this situation would be if non-apex procedures are also inserting/updating the table.
    If that is the case then i strongly recommend to put a book counter on the master table (the users table presumably) and then use the trigger on delete/insert/update on the books table to keep this counter in sync with the master table.
    With such book counter you could also implement a simple CHECK constraint to perform this instead of that trigger:
    ALTER TABLE app_users ADD CONSTRAINT ck_book_count CHECK(book_count < 3);If the max number of books is going to be variable for some reason, then the trigger would be the way to go:
    create or replace
    TRIGGER "BI_APP_USERS"
    before insert on app_users
    for each row
    begin
      if :new.book_count > 2 then
        RAISE_APPLICATION_ERROR(-20100, 'Sorry, you have already taken '||2||' books. Please return a book and try');
      end if;
    end;Flavio
    http://oraclequirks.blogspot.com

  • After update insert trigger is not working correctly

    Hello experts!
    I created an after insert/update trigger and what strikes me is that it is not working as expected.
    The trigger launches a procedure that does an insert in a second table if values in the triggered table ("my_table") are altered.
    The problem is that the values in my second table, which are correlated to "my_table", are not changed with the correct values right away. The trigger and insert trails behind!
    I have to update twice for the values to appear in my second table. Only then, the data of the first update will be inserted into the second table wheras the parent table ("my_table") will hold the latest values.
    Do you have an idea what could be wrong?
    create or replace
    trigger myscheme.after_update_insert_set_tw
    after update or insert
      on myscheme.my_table
      for each row
    declare
    begin
    pr_my_table_tw_sync_sk(:new.lng_falle, :new.int_fallennummer, :new.lng_schaedling, :new.objectid);
    end;Brgds,
    Seb

    Okay I'll give my best to explain what my procedure is supposed to do and what the table structure is like. I hope it'll help you to help me :-)
    My parent table is called fangzahlen and is created as follows:
    CREATE TABLE "BORKI"."FANGZAHLEN"
       (     "OBJECTID" NUMBER(10,0) NOT NULL ENABLE,
         "LNG_FALLE" NUMBER(10,0) NOT NULL ENABLE,
         "LNG_BEARBEITER" NUMBER(10,0),
         "DATE_DATUM" DATE DEFAULT SYSDATE NOT NULL ENABLE,
         "INT_FALLENNUMMER" NUMBER(4,0) NOT NULL ENABLE,
         "LNG_SCHAEDLING" NUMBER(2,0) NOT NULL ENABLE,
         "INT_VOLUMEN" NUMBER(10,0),
         "INT_ANZAHL" NUMBER(10,0),
         "INT_ANTEIL_JUNGKAEFER" NUMBER(3,0),
         "BOOL_KOEDERWECHSEL" NUMBER(1,0),
          CONSTRAINT "PK_FANGZAHLEN" PRIMARY KEY ("OBJECTID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS"  ENABLE,
          CONSTRAINT "CHECK_DATE_DATUM" CHECK ("DATE_DATUM" >= '1.apr.2006') ENABLE
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;It holds values such as:
    OBJECTID,"LNG_FALLE","LNG_BEARBEITER","DATE_DATUM","INT_FALLENNUMMER","LNG_SCHAEDLING","INT_VOLUMEN","INT_ANZAHL","INT_ANTEIL_JUNGKAEFER","BOOL_KOEDERWECHSEL"
    97548,"39","1081","08.04.10","1","2","","220","","0"
    97534,"39","1081","06.04.10","1","2","","100","","-1"My subtable is called tbl_test and created with:
    CREATE TABLE "BORKI"."TBL_TEST"
       (     "OBJECTID" NUMBER(12,0) NOT NULL ENABLE,
         "LNG_FALLE" NUMBER(10,0),
         "DATE_DATUM" DATE,
         "INT_FALLENNUMMER" NUMBER(4,0),
         "LNG_SCHAEDLING" NUMBER(2,0),
         "INT_VOLUMEN" NUMBER(10,0),
         "INT_ANZAHL" NUMBER(10,0),
         "LNG_FANGZAHLEN" NUMBER(12,0)
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "USERS" ;Okay, this were the prerequisites!
    Let's concentrate on the trigger and procedure:
    The purpose of the procedure is to insert data into tbl_test once a record in "fangzahlen" has been updated or inserted.
    Tbl_test holds the mean average values (int_anzahl) for a number of collected items (lng_schaedling).
    I need to insert date values for the combination of each lng_fangzahlen, lng_schaedling, lng_falle and int_fallennr into tbl_test.
    If I had the following data in table fangzahlen:
    97548,"39","1081","08.04.10","1","2","","220","","0"
    97534,"39","1081","06.04.10","1","2","","100","","-1"the query in the insert section of my procedure returns the following data when run manually:
    97534     31.03.10     16,667     (null)     1     39     2
    97548     06.04.10     110     (null)     1     39     2Now, I need to generate the dates between the first and the second objectid (column 1 in the data above).
    Hence,
    97534     31.03.10     16,667     (null)     1     39     2
    97534     01.04.10     16,667     (null)     1     39     2
    97534     02.04.10     16,667     (null)     1     39     2
    97534     03.04.10     16,667     (null)     1     39     2
    97534     04.04.10     16,667     (null)     1     39     2
    97534     05.04.10     16,667     (null)     1     39     2
    97534     06.04.10     16,667     (null)     1     39     2
    97548     07.04.10     110     (null)     1     39     2
    97548     08.04.10     110     (null)     1     39     2
    My problem is thatthe values above will only appear after I do another update to table fangzahlen or insert a new record into it. Theoretically the result above should be inserted right away?
    Below is my procedure, which might give you a better idea of what I am trying to do! Please excuse this rather awkward explanation. If you need more info please don't hesitate to ask for it!
    create or replace
    Procedure "PR_FANGZAHLEN_TW_SYNC_SK"
        Pr_falle        Number,
        Pr_fallennummer Number,
        Pr_schaedling   Number,
        Pr_objectid     Number)
    Is
      Y                Number (10);
      pragma autonomous_transaction;
    Begin
    -- first all records should be deleted from the subtable i.e. tbl_test
        delete from borki.tbl_test where lng_falle = pr_falle
            and int_fallennummer = pr_fallennummer
            and lng_schaedling   = pr_schaedling
           and date_datum       > '31.03.2010';
          commit;
          For Rec In
          (select objectid lng_fangzahlen,
            date_datum,
            prev_date,
            (date_datum - prev_date) difference_in_days,
            round((
            case
              when nvl(int_volumen,0) > 0
              and lng_schaedling      = 1
              then int_volumen * 40
              when nvl(int_volumen,0) > 0
              and lng_schaedling      = 2
              then int_volumen * 550
              when nvl(int_anzahl,0) > 0
              then int_anzahl
            end ) / (date_datum - prev_date),3) counted_bugs,
            int_fallennummer,
            lng_falle,
            lng_schaedling
          from
            (select objectid,
              date_datum,
              case
                when lag(date_datum) over(order by date_datum) is null
                then to_date('31.03.2010')
                else lag(date_datum) over(order by date_datum)
              end as prev_date,
              int_volumen,
              int_anzahl,
              int_fallennummer,
              lng_falle,
              lng_schaedling
            from borki.fangzahlen
            where lng_falle      = pr_falle
            and int_fallennummer = pr_fallennummer
            and lng_schaedling   = pr_schaedling
            and date_datum       > '31.03.2010'
           -- and objectid         = pr_objectid
            order by date_datum desc
          order by date_datum asc
          Loop
            Y := 1;
            While Y < rec.difference_in_days + 1
            Loop
              Insert
              Into tbl_test
                  lng_fangzahlen,
                  date_datum,
                  int_anzahl,
                  int_volumen,
                  int_fallennummer,
                  lng_falle,
                 lng_schaedling
              select objectid lng_fangzahlen,
            prev_date +Y,
            round((
            case
              when nvl(int_volumen,0) > 0
              and lng_schaedling      = 1
              then int_volumen * 40
              when nvl(int_volumen,0) > 0
              and lng_schaedling      = 2
              then int_volumen * 550
              when nvl(int_anzahl,0) > 0
              then int_anzahl
            end ) / (date_datum - prev_date),3) counted_bugs,
            int_volumen,
            int_fallennummer,
            lng_falle,
            lng_schaedling
          from
            (select objectid,
              date_datum,
              case
                when lag(date_datum) over(order by date_datum) is null
                then to_date('31.03.2010')
                else lag(date_datum) over(order by date_datum)
              end as prev_date,
              int_volumen,
              int_anzahl,
              int_fallennummer,
              lng_falle,
              lng_schaedling
            from borki.fangzahlen
            where lng_falle      = pr_falle
            and int_fallennummer = pr_fallennummer
            and lng_schaedling   = pr_schaedling
            and date_datum       > '31.03.2010'
            order by date_datum desc
          order by date_datum asc
              commit;
              Y := Y + 1;
            End Loop;
          End Loop; -- end of cursor
      Exception
      When No_data_found Then
        Null;
      When Others Then
        -- Consider logging the error and then re-raise
        Raise;
      End "PR_FANGZAHLEN_TW_SYNC_SK";

  • I am trying to trigger a custom event using a program but does not work ..

    HI ....i am trying to trigger a custom event of a custom object type using a program but does not work. If trigger the same event using SWUE it works.
    below is the code...
    {Key = '0010001115'. "Sales Order Number (hard-coded)
    CALL FUNCTION 'SWE_EVENT_CREATE'
      EXPORTING
        objtype                       = 'ZXXXXXXXF'
        objkey                        = KEY
        event                         = 'ZEVENT'
      CREATOR                       = ' '
      TAKE_WORKITEM_REQUESTER       = ' '
      START_WITH_DELAY              = ' '
      START_RECFB_SYNCHRON          = ' '
      NO_COMMIT_FOR_QUEUE           = ' '
      DEBUG_FLAG                    = ' '
      NO_LOGGING                    = ' '
      IDENT                         =
    IMPORTING
      EVENT_ID                      =
      RECEIVER_COUNT                =
    TABLES
      EVENT_CONTAINER               =
    EXCEPTIONS
      OBJTYPE_NOT_FOUND             = 1
      OTHERS                        = 2}
    Please guide me if i am missing something.

    Hi Sunny,
    I think you should try creating the event using FM SAP_WAPI_CREATE_EVENT.
    CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
      EXPORTING
        OBJECT_TYPE             =  'ZXXXXXXXF'
        OBJECT_KEY              = key
        EVENT                   = 'ZEVENT'
    *   COMMIT_WORK             = 'X'
    *   EVENT_LANGUAGE          = SY-LANGU
    *   LANGUAGE                = SY-LANGU
    *   USER                    = SY-UNAME
    *   IFS_XML_CONTAINER       =
    IMPORTING
       RETURN_CODE             = rcode
       EVENT_ID                = event_id
    * TABLES
    *   INPUT_CONTAINER         =
    *   MESSAGE_LINES           =
    *   MESSAGE_STRUCT          =
    Regards,
    Saumya

  • Trigger - After Report Not working.

    Hai,
    Below is the coding written on the after report trigger for inserting values in a table but it not working,
    even srw.message put and checked but not functioning at all...
    what might be the problem...
    Thanks in Advance...
    function AfterReport return boolean is
    begin
         srw.message(100,'Hai');
    if (:total_credit) is not null then
         insert into opcl (fiscal_yr_cd,Period_no,Col1,Col2,Col3,Col4,Col5,Col6)
         Values (:P_Fiscal_yr,:P_Period,nvl(:total_credit,0), nvl(:total_cess_cf,0),
         nvl(:total_sec_cess_cf,0), nvl(:cf_tot_serv_tax1,0), nvl(:cf_tot_serv_tax2,0),
         nvl(:cf_tot_serv_tax3,0));
    commit;      
    end if;      
    return (TRUE);
    end;

    How are you running the report? Not in the preview mode in builder I hope, because that won't fire the after report trigger.
    "The After Report trigger fires after you exit the *Runtime Previewer*, or after *report output is sent to a specified destination*..."

  • Process chain - After error ABAP - trigger a metachain start does not work.

    Hi,
    I have a process chain, where after an ABAP runs into red (ERROR MESSAGE triggered), another process type, like start a new meta-chain, or start an infopackage starts.... But is does not work. After i go to logs, it asks me whether i want to trigger the following jobs, if i choose yes, it works. But i need to start it automatically, when the ABAP Routine has an error message (RED) in the chain.
    Any idea, because I tried to solve it all the day, but i did not manage to get itwork...
    Many Thanks,
    L.

    Hi,
    the problem is not the ABAP Program.
    I have the following situation:
    A Metachain contains as second step a call of local chain. After the local chain, according to the status of it (green o red), we have other different steps. So we have two different link (red and green) starting from the local process chain step.
    Inside the local process chain there is the ABAP program that check several parameters and if something is not as expected fails with status red. if this situation happens, the local process chain becomes red and in SM37 inside the job i see the error that i forced, but the status is not triggered to the first metachain , so the corresponding following steps are not triggered.
    This issue happens only if fails the ABAP program because, for example, a Infopackages loading fails every thing works and the corresponding steps in the metachain are executed.
    In the ABAP program in order to force the status red we have the following code:
    MESSAGE e162(00) WITH 'Status' 'Red'.
    Any idea?
    Thanks,
    Veronica

  • Partial Trigger is not working with Panel Group Layout using ADF 11g.

    Friends,
    I have a requirment , Based on the <af:selectBooleanCheckbox> value I have to render <af:panelGroupLayout> dynamically. If the check box is checked then I have to display panel group layout otherwise not. The problem what I am facing here is Partial Trigger is not working, If I Un check the boolean box and refresh the page then I see it is working. If I don't refresh the page I am not seeing this is working as expected.
    Below is the snippet
    <af:selectBooleanCheckbox value="#{bindings.ChkBoolean.inputValue}"
    shortDesc="#{bindings.OtherOptChk.hints.tooltip}"
    id="OtherOpt" immediate="true" autoSubmit="true"
    />
    <af:panelGroupLayout id="pgl11" partialTriggers="ChkBoolean"
    rendered="#{bindings.ChkBoolean.inputValue}"">
    Am I doing anything wrong here
    Thanks in Advance

    Hi,
    I started to document common pitfalls like this. The problem has been reported last month too and is documented in here: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf
    Frank

  • Trigger is not working while updating the values of UDF

    Dear Freind,
    I have created one Trigger for ORDR for Sales order. It is working fine. For that i have created two UDF to Title level. When i fill all fields it shows the correct result in DocTotal. But problem is that, while updateing specific record it also update but only refresh the DocTotal.
    Means suppose i change the value of UDF fields that time it is not working it gives following error.
    "There is difference between the document total and component total"
    ALTER TRIGGER AmountForPC1
    ON dbo.ORDR
    AFTER INSERT,
    UPDATE
    AS
    SET NOCOUNT ON
    UPDATE x
    SET x.DocTotal = COALESCE(i.DocTotalSy, 0) + COALESCE(i.U_Ref, 0) + COALESCE(i.U_Sub, 0)
    FROM dbo.ORDR AS x
    INNER JOIN inserted AS i ON i.DocEntry = x.DocEntry
    Thanks
    Swapnil

    Hi Swapnil,
    Are you aware that you might run into trouble, at least when it comes to a support case, because you have created triggers?
    Accordingly to note [896891|https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMSZ3PTU4ODAwMDAr)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891] triggers are not supported.
    Regards
    Mario

  • INSERTstatement is not working if there is a before insert trigger

    INSERTstatement is not working if there is a before insert trigger on that table. That trigger contains an insert to another table which having the main table reference.
    Let us say, for example there a table named 'EMP_DEPT' and there is a before insert trigger on this table.
    In this trigger inserting a record in to another table named 'AUDIT_EMP' and in this table using EMP_Dept primary key as foreign key.
    Table EMP_DEPT is having the below columns:
    EMP_DEPT_SYS_ID
    EMP_DEPT_NO
    DEP_NAME etc..
    Table AUDIT_EMP is having the below columns:
    AUDIT_EMP_SYS_ID
    EMP_DEPT_SYS_ID
    AUDIT_NO etc..
    the code in the trigger is
    INSERT INTO audit_emp
    (audit_emp_sys_id, emp_dept_sys_id, audit_no
    VALUES (audit_emp.NEXTVAL, :new EMP_DEPT_SYS_ID, '1101'
    Now when you execute the insert query like:
    INSERT INTO emp_dept
    (emp_dept_sys_id, emp_dept_no, dep_name
    VALUES (EMP_DEPT.nextval, 1001, 'Dep-1'
    It is giving the error saying 'Integrity constraint error, parent key not found' from the trigger.
    But, when you modify the above insert query like the below then it is working.
    INSERT INTO emp_dept
    (emp_dept_sys_id, emp_dept_no, dep_name
    SELECT EMP_DEPT.nextval, 1001, 'Dep-1'
    FROM DUAL;
    I am using Oracle 10g.
    Why the insert into values is not working. Is there any commit transaction sequence change? Any idea please?
    Edited by: user6475632 on Sep 16, 2009 7:08 AM

    Obviously the code you posted can not work.
    You are inserting the detail record (the audit record) before the master record, where it should have been after. IMO, you should fire the trigger AFTER INSERT for each row.
    If that still doesn't work, you need to change the foreign key constraint into a deferred constraint, which is evaluated at commit, instead of immediately. The SQL reference manual has further info on this.
    'Oracle 10g' is considered a marketing label here, not a -4 digit- version.
    Sybrand Bakker
    Senior Oracle DBA

  • The TRIGGER LIST function is not working.

    I am trying to change the voltage output on several Agilent 661xxA modules simultaneously. The TriggerList functions is supposed to do this but it is not working. Only one of the power supply modules is turned on when I execute the fire the trigger.

    Greetings,
    Are you using this device's Instrument Driver in the same program as the GPIB 488.2 function TriggerList? This could be causing the issue. Mixing these VIs can be problematic.
    Spencer S.

Maybe you are looking for

  • Error while showing data in sub tab region

    Hi, I have created a custom OAF page with three Tabs Device Details User Privileges Chart Templates Under "User Privileges" There is a summary page which shows all User details records. When user click on "Update" icon control is delegated to "Update

  • How to populate Current Date and Time in OAF page through CO

    Hi all, How can we generate the current system date(without using "select sysdate from dual"), in OAF controller page (processRequest) to an OAMessageDateFieldBean? When i use the following code, the month is always displayed as January only. In OAF

  • App says "Evaluatio​n Copy" but ActiveX controls are not evaluation copies.

    App has been running for 3+ years in a Win95 machine. Just moved to Win98 machine and now "Evaluation Copy" appears in app. I have copied the two OCX files from the Win95 machine and registered them on the new machine. I purchased ComponentWorks 3 ye

  • Setting Authorization Object to User defined field

    Hi What authorization object to be used to give user only display access in CJ20N tcode under "User Fields" tab. Any suggestion would be appreciated. Rgds Kamran

  • NO OF USER CONNECTIONS TO ORACLE

    Hi all I am new to administration . could anybody please let me know how to find out the total no of users who have connected to oracle during one session. any light on this is greatly appreciated. thanks mahima null