Error in creating a trigger

i am creating a trigger i am getting an error
create or replace TRIGGER INS_Discharge
AFTER INSERT
ON Discharge
FOR EACH ROW
AS
declare
vr_DischargeType INT ;
vr_Visit_ID INT ;
vr_Discharge_Date DATE;
vr_VisitDate DATE;
vr_AdmTime varchar(5) ;
vr_TransferID INT ;
vr_BedID AS INT ;
BEGIN
select :NEW.DischargeType into vr_DischargeType
from dual;
select :NEW.Discharge_Date into vr_Discharge_Date
from dual;
select :NEW.VisitDate into vr_VisitDate
from dual;
SELECT VisitDate into vr_VisitDate FROM Visit WHERE Visit_ID = vr_Visit_ID ;
UPDATE Visit SET DischargeType = vr_DischargeType, DischargeDate = vr_Discharge_Date
WHERE Visit_ID = vr_Visit_ID ;
SELECT MAX(Transfer_ID)into vr_TransferID FROM BedSchedule WHERE VisitID = vr_Visit_ID ;
IF vr_DischargeType = 2 then
SELECT Bed_ID into vr_BedID FROM BedSchedule WHERE Transfer_ID = vr_TransferID ;
UPDATE Bed_Mst SET Bed_Status_ID = 1 WHERE Bed_ID = vr_BedID ;
:NEW.Bed_ID :=vr_BedID;
end if;
END ;
Error report:
ORA-04079: invalid trigger specification
04079. 00000 - "invalid trigger specification"
*Cause:    The create TRIGGER statement is invalid.
*Action:   Check the statement for correct syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

i have done you said .... i have oracle version 10g
create or replace TRIGGER trUPD_Discharge
AFTER UPDATE
ON Discharge
for each row
AS
declare
vr_DischargeType INT ;
vr_Discharge_Date DATE;
vr_Visit_ID INT ;
vr_CancelStatus INt;
BEGIN
/*select :NEW.DischargeType into vr_DischargeType from dual;
select :NEW.Visit_ID into vr_Visit_ID from dual;
select :NEW.Discharge_Date into vr_Discharge_Date from dual;
select nvl((select :NEW.CancelStatus from dual),0)
into vr_CancelStatus from dual;
If vr_CancelStatus = 0 then
UPDATE Visit SET DischargeType = :NEW.DischargeType,
DischargeDate =:NEW.Discharge_Date WHERE Visit_ID = :NEW.Visit_ID ;
end if;
END;
but still getting same error
Error report:
ORA-04079: invalid trigger specification
04079. 00000 - "invalid trigger specification"
*Cause:    The create TRIGGER statement is invalid.
*Action:   Check the statement for correct syntax.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Whats this error while creating a trigger

    HI ,
    I was creating a trigger and getting the following Error . What is this
    1 CREATE OR REPLACE TRIGGER TRG_AUDIT_LOGON AFTER
    2 LOGON ON DATABASE
    3 Declare
    4 v_sid v$session.sid%type ;
    5 v_serial v$session.serial# %type;
    6 v_username v$session.username%type;
    7 v_osuserid v$session.osuser%type;
    8 v_machinename v$session.machine%type;
    9 v_PROGRAM v$session.program%type;
    10 v_TERMINAL v$session.terminal%type;
    11 v_hostname v$instance.host_name%type;
    12 v_instance_name v$instance.instance_name%type;
    13 v_application_id v$database.dbid%type;
    14 v_logon_time date;
    15 v_Audit_tab_check varchar2(30);
    16 v_system_users_tab_check varchar2(30);
    17 v_sql_Audit_upload varchar2(1000) := 'INSERT INTO dbaoper.T_AUDIT (HOST_NAME, APPLICATION_ID, INSTANCE_NAME, SID, SERIAL#, USERNAME, OSUSERID, MACHINENAME, PROGRAM, TERMINAL, LOGON_TIME) VALUES (:v_hostname,:v_application_id,:v_instance_name, :v_sid, :v_serial, :v_username ,:v_osuserid,: v_machinename, :v_program,:v_TERMINAL,:v_logon_time ) ';
    18 type c_audit_cur_typ is ref cursor;
    19 C_Audit c_audit_cur_typ ;
    20 V_system_users_tab := 'T_SYSTEM_USERS';
    21 No_Audit_records Exception;
    22 Begin
    23 Select table_name into v_Audit_tab_check from dba_tables where owner='DBAOPER' and table_name='T_AUDIT';
    24 Select table_name into v_system_users_tab_check from dba_tables where owner='DBAOPER' and table_name='T_SYSTEM_USERS';
    25 Open c_Audit for ' SELECT sid, serial#, username, osuser, machine, program, terminal FROM v$session WHERE audsid = userenv (''''sessionid'''') and program not like ''''oracle@%J0%'''' and username not in (select * from dbaoper.' || V_system_users_tab||' ) and type!=''''BACKGROUND'''' ' ;
    26 Fetch c_Audit into v_sid, v_serial, v_username, v_osuserid, v_machinename,v_program,v_TERMINAL ;
    27 If c_Audit%Notfound then
    28 Raise No_Audit_records ;
    29 Else
    30 Select host_name, instance_name into v_hostname, v_instance_name from v$instance;
    31 select dbid into v_application_id from v$database;
    32 select sysdate into v_logon_time from dual;
    33 execute immediate v_sql_Audit_upload using v_hostname,v_application_id,v_instance_name,v_sid,v_serial,v_username,v_osuserid,v_machinename,v_program,v_TERMINAL,v_logon_time;
    34 end if;
    35 close C_Audit;
    36 exception
    37 when no_data_found then
    38 dbms_system.ksdwrt(2, ' ORA-20001 Audit tables T_AUDIT or T_SYSTEM_USERS not found Audit information is not being captured'
    39 );
    40 When No_Audit_records then
    41 dbms_output.put_line ('No Audit records to insert ');
    42* end;
    SQL> /
    Warning: Trigger created with compilation errors.
    SQL> sho err
    Errors for TRIGGER TRG_AUDIT_LOGON:
    LINE/COL ERROR
    18/20 PLS-00103: Encountered the symbol "=" when expecting one of the
    following:
    constant exception <an identifier>
    <a double-quoted delimited-identifier> table LONG_ double ref
    char time timestamp interval date binary national character
    nchar
    The symbol "<an identifier>" was substituted for "=" to
    continue.
    Thanks
    Pramod

    Hi
    I am sorry...i am getting the following error once trigger is created and one of the user is trying to connect....what might be the reason ?
    Enter user-name: test
    Enter password:
    ERROR:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00907: missing right parenthesis
    ORA-06512: at line 23
    Thanks
    Prmaod

  • Pl/Sql Error while creating a trigger

    Hello everyone m trying to make a trigger whose purpose is not to allow any update insert or delete to be done on the table Work if the day is sunday.I tried this code but it is giving me error
    create or replace trigger No_work_on_Sunday
    After insert or update or delete
    on Work When owner='MAX'
    for each row
    begin
            if (select to_char(sysdate,'D')=1) then
                     raise_application_error(-20001,'no work on sunday');
          end if;
    end;
    on Work when owner='MAX'
    ERROR at line 3:
    ORA-04077: WHEN clause cannot be used with table level triggers Pls help
    Edited by: 781207 on Jul 16, 2010 7:43 AM

    create or replace trigger No_work_on_Sunday
    before insert or update or delete
    for each row
    on Work When owner='MAX'
    begin
            if to_char(sysdate,'D')=1 then
                     raise_application_error(-20001,'no work on sunday');
          end if;
    end;
    /Keep in mind to_char(sysdate,'D')=1 is NLS dependent. In US week starts Sunday in most european some coutries week starts Monday. In middle east it can be Friday or Saturday...
    SY.
    Edited by: Solomon Yakobson on Jul 16, 2010 7:50 AM

  • How can i creat a trigger    error  invalid trigger specification

    i have a stored procedure which i want it to be triggered when an insertion is done on table A
    and that stored procedure accepts values from the insertion performed in table A
    and inserts into Table B by either updating the table or insertion into Table B
    how can i achieve this
    OK fine i have a table called Table A
    i want a trigger that can accept values such as
    create or replace trigger UpdateMyDoc  after insert on  Table A
    for each row
    accoutntno varchar2,
    ID varchar2
    As
    cnt number;
    Begin
    update Table B value (accoutntno ,ID ); commit;
    end ;
    is the above possible if it is then i get this  [1]: (Error): ORA-04079: invalid trigger specification
    any help
    Edited by: kama021 on Aug 13, 2009 2:24 AM

    Stop right there, Kama.
    update Table B value (accoutntno ,ID ); commit;Do not go any further on triggers, until you at least know how to write an UPDATE
    Or is it INSERT
    Once you have that in place, carry on by reading a bit about Transactions
    Regards
    Peter

  • 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

  • Error in Creating Trigger

    Hi All,
    I have a problem in creating a trigger.
    I have two fields named last_updated_by, last_updated_date which
    r common to all the tables.
    If the user made any change to the exiting record, the values of
    the those two colums should get changed automatically with the
    username and sysdate.
    When I wrote a trigger its giving mutation error.
    Can I update these value by stored procedure via trigger?
    I heard its possible by DBMS_JOB package. Can anyone give idea?
    Thanks in Advance.
    Regards
    Gopinath Kona

    You should only get the mutating table probllem if you're doing
    SELCT or DML against the table the trigger's built on. Which
    suggests that you're approaching this the wrong way.
    Try CREATE TRIGGER blah blah
    FOR EACH ROW
    :new.last_updated_by := USER;
    :new.last_updated_date := SYSDATE;
    END;
    If that's what you are doing then the problem lies elsewhere.
    Rgds, APC

  • Error in Forms while creating the trigger- WHEN-CREATE-RECORD

    Hello,
    Right now I am using 11g client side and 10g database.
    I am constantly getting an error while creating triggers in 11g.
    I have created a sequence in SQL developer using the following code:
    create sequence loc_id_sequence
    start with 14;
    After creating the sequence. I am trying to write the PL/SQL code in forms builder for the trigger WHEN-CREATE-RECORD
    declare
    loc_id number;
    begin
    loc_id := loc_id_sequence.nextval;
    end;
    But I have been getting the following error constantly. Can anyone please help me?
    "Error 0 at line 5, column 4
    SQL statement ignored".
    Can anyone please tell me why I am getting that error

    In fact, even I thought there might be some problem with the connectivity with the 10g database and 11g client but the other DB related code works.
    I just have the problem with using sequence for the trigger WHEN-CREATE-RECORD.
    In fact I also tried using WHEN-NEW-RECORD-INSTANCE smart trigger instead of WHEN-CREATE-RECORD for the same sequence. But even that doesn't work.
    Do u have any idea of what that error means?
    "Error 0 at line 5, column 4
    SQL statement ignored"
    Edited by: Pooja 1985 on Feb 26, 2013 5:43 PM
    Edited by: Pooja 1985 on Feb 26, 2013 5:44 PM

  • Bad bind variable error on creating trigger

    hi
    im trying to create a trigger on a table in Oracle and I keep gettin this error:
    PLS-00049: bad bind variable 'NEW.ID'
    TeamID is a primary Key, it creates the sequence fine, but i get the error on the create trigger,
    CREATE TABLE TBLTEAMS
    TEAMID NUMBER(5),
    NAME VARCHAR2(50 BYTE),
    MANAGER VARCHAR2(50 BYTE),
    COSTCENTRE NUMBER(9),
    PARENTTEAMID NUMBER(5)
    create sequence seq_Teamsautonumber;
    create trigger trg_Teamsautonumber
    before insert on tblteams
    for each row
    begin
    select seq_Teamsautonumber.nextval into :new.id from dual;
    end;
    any ideas?

    You have said
    :new.idthat means you are trying to load the sequence value into a column that doesn't exist in your table.
    you would need to use
    :new.teamidAssuming you are trying to auto-populate the TEAMID column on your table.

  • PLS-00428 Error when creating a new trigger

    Hi,
    I'm encountering the PLS-00428 error when I run the script below.
    CREATE OR REPLACE TRIGGER TIBCOUSER.po_response_trigger
    BEFORE INSERT ON po_response FOR EACH ROW
    BEGIN
    IF:NEW.ariba_processsequence is null then
    SELECT pttransid AS pttransid, 'Product Test Pass 1' AS pttransname, aribaorderid AS aribaorderid, '0' AS errorcode, '' AS MESSAGE, SYSDATE AS ariba_insertdate
    FROM po_request
    WHERE adb_l_delivery_status = 'N';
    UPDATE po_request
    SET adb_l_delivery_status = 'C'
    WHERE adb_l_delivery_status = 'N';
    END IF;
    END;
    Can someone point out what is missing or what is wrong with the script? Any help would be much appreciated.
    Regards,
    Jigger

    Hi Jigger,
    I was able to create the trigger using the script below.That's nice, you got the trigger created. Below is your trigger, I have added some comments.
    create or replace trigger tibcouser.po_response_trigger
       before insert or update
       on po_response
       for each row
    declare
      -- 1. These variables should really be anchored to po_response
      -- 2. They should be named differently than columns in po_response
      -- 3. It seems that you don't need them (See 7.)
       pttransid               integer := null;
       pttransname             varchar2(255) := null;
       aribaorderid            varchar2(255) := null;
       errorcode               integer := null;
       message                 varchar2(255) := null;
       ariba_insertdate        date := null;
       adb_l_delivery_status   char(1) := null;
    begin
      -- 4. This is never true, since adb_l_delivery_status is null, here
          -- So, I guess your trigger never does anything, so in a sense it works
       if (adb_l_delivery_status = 'N')
       then
        -- 5. This select  will raise too_many_rows, when there is more than one record in po_response.
        -- 6. It seems you will have a problem with mutating table
        -- 7. The select doesn't do anything, you never use any of the values selected
        -- 8. The select is confusing, since variables are named equally to columns
        -- 9. You select constants, why not just assign them right away
        select pttransid
                ,pttransname
                ,aribaorderid
                ,'0'
                ,sysdate
            into pttransid
                ,pttransname
                ,aribaorderid
                ,errorcode
                ,message
                ,ariba_insertdate
            from po_response;
          -- 10. This update will update ALL records in po_request, probably not what you want.
          update po_request
             set adb_l_delivery_status = 'C';
       end if;
    -- 11. Good practise dictates end po_response_trigger;
    end;
    /In general, when you think your post has been answered, then kindly mark it as such.
    Regards
    Peter

  • Error PLS-00103 when trying to create a trigger

    Hello folks,
    I am trying to create a trigger but I am encountering this error telling me that Oracle expected a ";" but found a bracket "(" in line 7. I have not yet found out what's the problem. It would be very appreciated if somebody could give a me a hint on this. The code used to create the trigger follows.
    CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR UPDATE ON Inscriptions
    FOR EACH ROW
    DECLARE
    num INTEGER;
    BEGIN
    IF :new.ni < 1000 THEN
    SELECT COUNT(*) INTO num FROM Sportifs WHERE ns = :new.ni;
    IF num = 0 THEN
    RAISE(abort,'foreign key violation');
    END IF;
    END IF;
    IF :new.ni > 1000 THEN
    SELECT COUNT(*) INTO num From Equipes WHERE nequipe = :new.ni;
    IF num = 0 THEN
    RAISE(abort,'foreign key violation');
    END IF;
    END IF;
    EXCEPTION
    END;
    Thanks in advance
    Sebastian

    user2019788 wrote:
    Hello folks,
    I am trying to create a trigger but I am encountering this error telling me that Oracle expected a ";" but found a bracket "(" in line 7. I have not yet found out what's the problem. It would be very appreciated if somebody could give a me a hint on this. The code used to create the trigger follows.
    CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR UPDATE ON Inscriptions
    FOR EACH ROW
    DECLARE
    num INTEGER;
    BEGIN
    IF :new.ni < 1000 THEN
    SELECT COUNT(*) INTO num FROM Sportifs WHERE ns = :new.ni;
    IF num = 0 THEN
    RAISE(abort,'foreign key violation');
    END IF;
    END IF;
    IF :new.ni > 1000 THEN
    SELECT COUNT(*) INTO num From Equipes WHERE nequipe = :new.ni;
    IF num = 0 THEN
    RAISE(abort,'foreign key violation');
    END IF;
    END IF;
    EXCEPTION
    END;
    Thanks in advance
    SebastianDon't know why it's complaining about line 7 but your RAISE statement syntax is incorrect. I think what you want instead of "RAISE" is "RAISE_APPLICATION_ERROR". You also need to either put something between the EXCEPTION and END or remove the "EXCEPTION"
    CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR UPDATE ON Inscriptions
       FOR EACH ROW
       DECLARE
         num INTEGER;
       BEGIN
         IF :new.ni < 1000 THEN
           SELECT COUNT(*) INTO num FROM Sportifs WHERE ns = :new.ni;
           IF num = 0 THEN
             RAISE_APPLICATION_ERROR(-20101,'foreign key violation');
           END IF;
         END IF;
         IF :new.ni > 1000 THEN
           SELECT COUNT(*) INTO num From Equipes WHERE nequipe = :new.ni;
           IF num = 0 THEN
             RAISE_APPLICATION_ERROR(-20101,'foreign key violation');
           END IF;
         END IF;
    --   EXCEPTION
    --     WHEN OTHERS THEN RAISE;
       END;

  • Error while create trigger on for nested table

    I want to insert a record into a nested table.For this, I created a view for the table, which includes the nested table.It told me ORA-25015 cannot perform DML on this nested table view column.So I created a trigger for the nested table.However, it told me that ORA-25010 Invalid nested table column name in nested table clause.I think my nested table is valid, i don't konw why did it appear this kind of problem?
    My table is
    CREATE TABLE ENT
    ID NUMBER(7) NOT NULL,
    CREATE_DATE VARCHAR2(11 BYTE),
    UPDATE_DATE VARCHAR2(11 BYTE),
    DEPTS VARRAY_DEPT_SEQ
    CREATE OR REPLACE
    TYPE DEPT AS OBJECT
    ID NUMBER(8),
    ANCHOR VARCHAR2(20),
    CREATE OR REPLACE
    TYPE " VARRAY_DEPT_SEQ" as varray(930) of DEPT
    CREATE OR REPLACE VIEW ENT_NESTED_VIEW
    (ID, CREATE_DATE, UPDATE_DATE, DEPTS)
    AS
    select e.ID,cast(multiset(select r.id,r.anchor from ent z, table(z.depts) r where z.ID=e.ID )as varray_dept_seq)
    FROM ENT e
    Then when I created trigger;
    CREATE OR REPLACE TRIGGER EMP.ENT_NESTED_TRI
    INSTEAD OF INSERT
    ON NESTED TABLE DEPTS OF EMP.ENT_NESTED_VIEW
    REFERENCING NEW AS New OLD AS Old PARENT AS Parent
    FOR EACH ROW
    BEGIN
    END ;
    I met the problem: ORA-25010 Invalid nested table column name in nested table clause
    Could you please tell me the reason
    Thank you!
    My insert SQL is:
    insert into table(select depts from ent_nested_view where id=1856) values(varray_dept_seq(dept(255687,'AF58743')))
    Message was edited by:
    user589751

    Hi,TongucY
    Compared with the "Referencing Clause with Nested Tables" part of this reference -
    http://psoug.org/reference/instead_of_trigger.html, I found the answer of this
    quesion. That is "CREATE OR REPLACE TYPE " VARRAY_DEPT_SEQ" as[b] varray(930) of
    DEPT". It turns to be a varying array, not a nested table. It should be "CREATE OR
    REPLACE TYPE " VARRAY_DEPT_SEQ" as table of DEPT". That is OK. Thank you very
    much!
    While there is an another question, if I create a varying array like" CREATE OR
    REPLACE TYPE " VARRAY_DEPT_SEQ" as[b] varray(930) of DEPT " and I want to insert
    a record into the varying array, which the record has been existed.The method that
    create a view and a trigger seems not to be effective.
    For instance,
    There is a record in the table
    ID:1020
    CREATE_DATE:2005-10-20
    UPDATE_DATE:2007-2-11
    DETPS: ((10225,AMY))
    I want to ask this record to be
    ID:1020
    CREATE_DATE:2005-10-20
    UPDATE_DATE:2007-2-11
    DETPS: ((10225,AMY),(10558,TOM))
    How should I do?
    Could you please help me?
    Best regards.
    Message was edited by:
    user589751

  • Error in execuitng a trigger

    I am getting the following error in executing while executing the "dropping the trigger " , "creating a trigger " . or executing any stored proc .
    Please advise .
    I am on 10g Release 2 on Redhat linux .
    SQL> drop trigger logon_trigger ;
    drop trigger logon_trigger
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01008: not all variables bound
    ORA-06512: at line 21

    I was able to resolve this by setting a undocumented parameter "_system_trig_enabled"=FALSE .
    But , I have a logon trigger . If I set this to FALSE , logon trigger does not kick in .
    How to have a logon trigger working and to avoid this error ?
    QL> drop table t;
    drop table t
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01008: not all variables bound
    ORA-06512: at line 21
    SQL> alter system set "_system_trig_enabled"=FALSE;
    System altered
    SQL> drop table t;
    Table dropped

  • Error while creating sequence - related to xdb installation?

    I'm getting the following error while creating a sequence -
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-20000: Trigger xdb_installation_trigger does not support object creation of
    type SEQUENCE
    ORA-06512: at line 32
    oracle xml db was installed on this instance.
    Is there a way around it? We want oracle xml db installed but we still want to be able to create and drop sequences!

    Hi Expert,
    In T-Code: OB52, We need to open the period 001 for Year - 2012 for the Account Type - S and for GL Account - 799999.
    Configure as shown below for your Posting Period Variant:
    Account Type: S
    From Account: (Only provide any GL Accounts From Range, If you require any specific GL Accounts to be open. Else leave blank)
    To Account:(Only provide any GL Accounts To Range, If you require any specific GL Accounts to be open. Else leave blank)
    From Period: 01
    Year: 2012
    To Period:01
    Year:2012
    From Period:13
    Year:2012
    To Period:16
    Year:2012
    Save
    Regards,
    GK
    SAP

  • Create a trigger to check inserted date is before or after SYSDATE

    Hi,
    I am trying to create a trigger that will check an inserted date against SYSDATE and alter the value (i.e. make it SYSDATE) when the entered date is incorrect.
    For example, I have a Customer table with a record named MemberDate which, when a date is entered to it, will be checked by the trigger to ensure it is not before the current date.
    My code so far;
    CREATE OR REPLACE TRIGGER Customer
    BEFORE INSERT ON
    Customer
    FOR EACH ROW
    DECLARE
    e_invaliddate_ud EXCEPTION;
    BEGIN
    IF :NEW.MemberDate < SYSDATE THEN
    RAISE e_invaliddate_ud;
    END IF;
    EXCEPTION
    WHEN e_invaliddate_ud THEN
    DBMS_OUTPUT.PUT_LINE('The date entered for MemberDate is invalid. The
    MemberDate has been set to the current date');
    END;
    So far, this trigger only returns an error message but allows the date to be entered even if it is incorrect. I have tried a few ways of altering the entered date to SYSDATE but to no avail.
    I am running scripts using SQL PLUS and inserting data using
    INSERT INTO Customer
    VALUES(CustomerID, ..., MemberDate);
    Where the values entered will be checked to ensure the MemberDate is not before SYSDATE.
    The MemberDate data-type is DATE and has a rule that it must not be before the current date. I am aware that a constraint may not be used to perform a check using SYSDATE, this is why I am trying to make a trigger.
    However, my knowledge of triggers is limited
    If anyone can help, I will be very Happy.
    Thank you in advance.

    Use this if you want an error message that halts the execution:
    create or replace trigger customer
    before insert on customer
    for each row
    begin
      if :new.memberdate < sysdate
      then
        raise_application_error(-20000,'The date entered for MemberDate is invalid.');
      end if;
    end;Use this if you want to automatically to overwrite the MemberDate with sysdate without an error message:
    create or replace trigger customer
    before insert on customer
    for each row
    begin
      :new.memberdate := greatest(sysdate,:new.memberdate);
    end;Note: untested
    Regards,
    Rob.

  • Error in creating DLN on SAP 2007 01 PL07

    Hi Experts,
    Our profuct has been used by multi clients for years, and everything is working fine until one client upgrades to SAP 2007 01 PL07. The user was working properly at beginning, and got a error in creating DLN, then the user will not be able to create DLN any more, then the user has to logout and login the SAP to create DLN agian. the error will be trigger pretty often,and error msg is: the requested action is not support this object.
    the error is only hapened on one of our clients, and we struggled for long time, but could not fix it out.
    Any suggestion or recommandation will be more then welcome!
    Thank in advance.
    Austen

    You may check these:
    The requested action is not supported for this object
    Errors not listed in the documentation...

Maybe you are looking for

  • How to move group account from liability to equity

    Need to move one group account (summary account) from P&L to Balance Sheet in BCS system (one hierarchy to another). How to do it?What is the procedure? Any SAP notes or links would be helpful Also, if you could forward me notes for BCS and BW it wou

  • Unable to delete transport request

    Hi Team, The Standalone sandbox with ECC 6.0 Im deleting the transport request , getting error unable to delete the tranport request Cannot open log: hostname\sapmnt\trans\log\CC000036.SID. Kinldy assist me in solving the issue . Regards Kumar

  • Store Multiple rows in a dictionary to show as a grid

    Hi, I need to store multiple rows in a data dictionary. Please give me the solution if the CCP has these feature to store multiple row data. Please provide the guide if this is limitation in CCP

  • Smartview webf run time prompts upon submit are not picking up from the POV

    Hi , I am in Planning 11.1.2.1 and using Smartview 11.1.2.1.103. After connecting to Planning Webform from Smartview, i am saving a composite form which should launch a Business Rule with run time prompts attached to the webform upon submit. The busi

  • RE: (forte-users) Terminal Services - Win 2000

    Hi l've already installed my application 'appA' at my server 'ServerA'. When l try to execute this application in my pc thru Terminal Server, there were nothing displayed at my pc but when l check at on 'ServerA' , l can see that 'appA' is running ov