How to create triggers...

I have the following trigger which seems to be working properly when it's created using sqlplus.
CREATE OR REPLACE TRIGGER trig_address
BEFORE INSERT ON address REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
SELECT seq_address.nextval INTO :NEW.ID FROM dual;
END;
I would like to create this thru JDBC if possible. I have run into problems that make me believe Oracle considers placement of keywords because this doesn't seem to work properly:
CREATE OR REPLACE TRIGGER trig_address BEFORE INSERT ON address REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT seq_address.nextval INTO :NEW.ID FROM dual;END;/
Is it possible to create triggers thru JDBC? If so, how?
Thx,
Dan
Edited by: user10432031 on Dec 15, 2008 6:20 AM

As you can see from following example, Oracle does not care about the formatting.
SQL> create table test (id number);
Table created.
SQL> create or replace trigger trgrow_testbu before update on test for each row begin :new.id := 10; end;
  2  /
Trigger created.
SQL>You have not mentioned the error that you are getting so I presume the forward slash at the end of following statement is causing the problem.
CREATE OR REPLACE TRIGGER trig_address BEFORE INSERT ON address REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT seq_address.nextval INTO :NEW.ID FROM dual;END;/Try removing that.
Apart from that, ensure that the logged in user has CREATE TRIGGER privilege.

Similar Messages

  • The ideal knowledge of creating triggers in form

    its very easy to design a form but the matters is creating triggers so since i am a beginner i need ur guidance how to create triggers in form

    Hi,
    There are 3 types of triggers Form Level, Block Level and Item level triggers.
    First you have to decide which level you are going to create a trigger.
    Suppose you need to create Item level trigger, for a push button there is a trigger called When-Button-Presed. Like wise for each item,block and form has specific/general triggers for each event.
    you should check forms documentation or fellow online help/examples
    http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=designing_forms/trig/dg0701.html&vtTopicId=
    Nilaksha.

  • Creating triggers in a package

    Does any body has an example on how to create triggers in package/package body.
    Here is an example of one of many triggers that I need to create in a package.
    CREATE OR REPLACE TRIGGER distributor_q_i
    BEFORE INSERT ON f_sw.WQM001Q000001
    FOR EACH ROW
    DECLARE
    lv_sql_error_code PLS_INTEGER;
    lv_sql_error_message VARCHAR2(512);--Maximum SQL error message size:512
    BEGIN
    INSERT INTO [email protected]
    (F_PRITIME, F_STATUS, F_DELAY, F_TIMEOUT, F_USERID,
    F_GROUPID, UF000, UF001, UF002, UF003, UF004, UF005,
    UF006,SYS_CREATED_DATE, SYS_STATUS_DATE,
    SYS_STATUS_PREV,SYS_USER_NAME, SYS_USER_IP )
    VALUES (:new.f_pritime,:new.f_status,:new.f_delay,:new.f_timeout,
    :new.f_userid,:new.f_groupid,:new.uf000,:new.uf001,
    :new.uf002,:new.uf003,:new.uf004,:new.uf005,
    :new.uf006,SYSDATE, SYSDATE, null, USER, null);
    EXCEPTION
    WHEN OTHERS THEN
    lv_sql_error_code := SQLCODE;
    lv_sql_error_message := SQLERRM(v_sql_error_code);
    DBMS_OUTPUT.PUT_LINE('OTHER ERROR');
    DBMS_OUTPUT.PUT_LINE(v_sql_error_message);
    END distributor_q_i;
    show errors;

    Hello
    That idea is pretty much fine. If you're on 9i the values(rec1) will work, if you're on 8i you'll have to specify each column i.e.
    SQL> CREATE OR REPLACE PACKAGE dt_test_package
      2  AS
      3  PROCEDURE proc1 (rec1 IN dt_test_tab2%ROWTYPE);
      4  END;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY dt_test_package
      2  AS
      3  PROCEDURE proc1 (rec1 IN dt_test_tab2%ROWTYPE)
      4  IS
      5  BEGIN
      6  INSERT INTO dt_test_tab2 VALUES(rec1.col1,rec1.col2);
      7  END;
      8  END;
      9  /
    Package body created.
    SQL> CREATE OR REPLACE TRIGGER dt_test_trigger BEFORE INSERT ON dt_test_tab1 FOR EACH ROW
      2
      3  DECLARE
      4  rec1 dt_test_tab2%ROWTYPE;
      5  BEGIN
      6  rec1.col1 := :NEW.col1;
      7  rec1.col2 := :NEW.col2;
      8  dt_test_package.proc1(rec1);
      9  END;
    10  /
    Trigger created.
    SQL> insert into dt_test_tab1 values('col1','col2','col3');
    1 row created.
    SQL> /
    1 row created.
    SQL> select * from dt_test_tab1;
    COL1       COL2       COL3
    col1       col2       col3
    col1       col2       col3
    SQL> select * from dt_test_tab2;
    COL1       COL2
    col1       col2
    col1       col2David

  • How to raise the event without creating Triggers

    Hi Gurus,
    here is my requirement.
    Whenever user issue the material from inventory ( on hand quantity reduced ), we have to generate a data file which contains item number, sub inventory and quantity info. for this we have created a utl file package. But here my issue is, without creating triggers / Alerts , i have to run the utl package.
    Please advice me how to do this / is there any middle ware tools available to run the package / concurrent prohram.
    We are using R12.
    Regards,
    Sreehari.

    Oracle provides various business events for material issue/transactions from inventory (For e.g.,oracle.apps.inv.miscIssue, oracle.apps.inv.subinvTransfer, oracle.apps.wip.job.material.transact, etc.).
    First check what kind of transactions happen when the On-hand is consumed. Then Go to any Workflow Admin responsibility >> Business Events: Events >> Search for the event you are looking for >>Hit Update >> Enable the event >> Navigate to Subscription and associate your PLSQL pacakge. let me know if it helps.

  • How to create audit triggers and run it dynamically?

    DECLARE
    V_CRT VARCHAR2(4000);
    V_DRP VARCHAR2(200);
    BEGIN
    FOR tab_rec IN (SELECT TABLE_NAME FROM USER_tabLES WHERE TABLE_NAME NOT LIKE '%TMP' AND TABLE_NAME NOT LIKE '%BAK' AND TABLE_NAME NOT LIKE 'MV_%') loop
    v_DRP := 'DROP TABLE AUD_'||tab_rec.tABLE_name ||';' || CHR(13);
    v_crt := ' CREATE TABLE AUD_'||tab_rec.tABLE_name
    ||'( ACTION VARCHAR2(1) ,
    CONSTRAINT AUD_'||SUBSTR(TAB_REC.TABLE_NAME, 1,11)||substr(tab_rec.table_name,length(tab_rec.table_name)-4,5)||'_CHKACTION CHECK (ACTION IN (''I'',''U'',''D'')),
    ISSUE_TIMESTAMP TIMESTAMP DEFAULT SYSDATE,
    ISSUE_USER VARCHAR2(30),
    ISSUE_HOST VARCHAR2(40),
    FOR col_rec IN (SELECT column_name,data_type,data_length,data_precision,data_scale FROM user_tab_cols WHERE table_name = tab_rec.table_name ORDER BY column_id)
    loop
    IF col_rec.data_type = 'VARCHAR2' THEN
    v_crt := v_crt || col_rec.column_name || ' '|| col_rec.data_type||'('||col_rec.data_length||'),'||chr(13)||' ';
    ELSIF col_rec.data_type = 'NUMBER' THEN
    v_crt := v_crt || col_rec.column_name || ' '||col_rec.data_type;
    IF col_rec.data_precision IS NOT NULL THEN
    v_crt:= v_crt||'('||col_rec.data_precision||','||col_rec.data_scale||'),'||chr(13)||' ';
    ELSE
    v_crt:= v_crt||','||chr(13)||' ';
    END IF;
    ELSE
    v_crt := v_crt || col_rec.column_name || ' '||col_rec.data_type||','||chr(13)||' ';
    END IF;
    END loop;
    v_crt := rtrim(v_crt);
    v_crt := substr(v_crt,1,LENGTH(v_crt)-2)||');';
    DBMS_OUTPUT.PUT_LINE(v_crt);
    v_crt:= '';
    END LOOP;
    END;
    The audit tables are named same as the table prefixed with AUD_. The audit table has two columns ACTION and ISSUE_TIMESTAMP more than the main tables.
    This anonymous block creates the triggers in the table which has audit tables dynamically.
    The user data is not maintained here in this code.
    This code runs.
    DECLARE
    v_output1 VARCHAR2(5000);
    v_insert VARCHAR2(4000);
    v_delete VARCHAR2(4000);
    v_update VARCHAR2(4000);
    v_cols VARCHAR2(1000);
    v_columns VARCHAR2(2000)DEFAULT '';
    v_columns_new VARCHAR2(2000) DEFAULT '';
    v_columns_old VARCHAR2(2000) DEFAULT '';
    v_tab1 VARCHAR2(30) DEFAULT ' ';
    v_tab2 VARCHAR2(30) DEFAULT ' ';
    v_tab3 VARCHAR2(30) DEFAULT ' ';
    v_schema varchar2(30) default 'schema'; --
    v_user_id VARCHAR2(30); -- not used in this program
    v_host VARCHAR2(30);
    BEGIN
    /* The audit tables are created with table name prefixed with AUD and columns ACTION AND ISSUE DATE, ISSUE_USER,ISSUE_HOST added.*/
    FOR rec IN
    (SELECT tname FROM tab WHERE tname LIKE 'AUD%'
    LOOP
    v_columns := '';
    v_columns_new := '';
    v_columns_old := '';
    v_output1 := 'CREATE OR REPLACE TRIGGER '
    ||v_schema||'.' ||rec.tname ||'_TRIG ' || chr(13)
    ||' AFTER ' || chr(13)
    ||' INSERT OR '|| chr(13)
    ||' UPDATE OR '|| chr(13)
    ||' DELETE ON '|| chr(13)
    ||v_schema||'.'
    || substr(rec.tname,5)
    || chr(13)
    ||' FOR EACH ROW '
    ||chr(13)
    ||' BEGIN ' || chr(13);
    FOR colrec IN
    (SELECT column_name
    FROM user_tab_cols
    WHERE table_name = rec.tname
    AND column_name NOT IN ('ACTION','ISSUE_TIMESTAMP','ISSUE_USER','ISSUE_HOST')
    LOOP
    v_columns := v_columns||v_tab3||colrec.column_name ||','||chr(13);
    v_columns_new := v_columns_new ||v_tab3||':new.'||colrec.column_name ||','||chr(13) ;
    v_columns_old := v_columns_old ||v_tab3||':old.'||colrec.column_name ||','||chr(13) ;
    END LOOP;
    v_columns := SUBSTR(v_columns ,1,LENGTH(v_columns ) -2);
    v_columns_new := SUBSTR(v_columns_new,1,LENGTH(v_columns_new)-2);
    v_columns_old := SUBSTR(v_columns_old,1,LENGTH(v_columns_old)-2);
    v_insert := v_tab1||'IF INSERTING THEN ' || chr(13)
    ||v_tab2||'INSERT INTO '||v_schema||'.' ||rec.tname|| chr(13)
    || v_tab2||' ( '||chr(13)
    || v_tab3||'ACTION,'||chr(13)
    || v_tab3||'ISSUE_TIMESTAMP,' ||chr(13)
    || v_tab3||'ISSUE_USER,'||chr(13)
    || v_tab3||'ISSUE_HOST,'||chr(13)
    ||v_columns ||chr(13) ||v_tab2||')' || chr(13)
    ||v_tab2||' VALUES ' ||chr(13)
    ||v_tab2||' (' ||chr(13)
    ||v_tab3||'''I'''||','||chr(13)
    ||v_tab3||'SYSTIMESTAMP'||','||chr(13)
    ||v_tab3||'USER'||','||chr(13)
    ||v_tab3||'sys_context('||'''USERENV'''||','||'''HOST'''||'),'||chr(13)
    ||v_columns_new ||v_tab2||');' ||chr(13)
    ||v_tab1||'END IF;'
    || CHR(13);
    v_delete := v_tab1||'IF DELETING THEN ' || chr(13)
    ||v_tab2||'INSERT INTO '||v_schema||'.' ||rec.tname|| chr(13)
    ||v_tab2|| '( '||chr(13)
    || v_tab3||'ACTION,'||chr(13)
    || v_tab3||'ISSUE_TIMESTAMP,' ||chr(13)
    || v_tab3||'ISSUE_USER,'||chr(13)
    || v_tab3||'ISSUE_HOST,'||chr(13)
    ||v_columns ||chr(13)
    ||v_tab2||')' || chr(13)
    ||v_tab2||' VALUES ' ||chr(13)
    ||v_tab2||' (' ||chr(13)
    ||v_tab3||'''D'''||','||chr(13)
    ||v_tab3||'SYSTIMESTAMP'||','||chr(13)
    ||v_tab3||'USER'||','||chr(13)
    ||v_tab3||'sys_context('||'''USERENV'''||','||'''HOST'''||'),'||chr(13)
    ||v_columns_old
    ||v_tab2||');' ||chr(13)
    ||v_tab1
    ||'END IF;' ||CHR(13);
    v_update := v_tab1||'IF UPDATING THEN ' || chr(13)
    ||v_tab2||'INSERT INTO '||v_schema||'.' ||rec.tname|| chr(13)
    ||v_tab2|| '( '||chr(13)
    ||v_tab3|| 'ACTION,'||chr(13)
    ||v_tab3|| 'ISSUE_TIMESTAMP,' ||chr(13)
    ||v_tab3||'ISSUE_USER,'||chr(13)
    ||v_tab3||'ISSUE_HOST,'||chr(13)
    ||v_columns ||chr(13)
    ||v_tab2||')' || chr(13)
    ||v_tab2||' VALUES ' ||chr(13)
    ||v_tab2||' (' ||chr(13)
    ||v_tab3||'''U'''||','||chr(13)
    ||v_tab3||'SYSTIMESTAMP'||','||chr(13)
    ||v_tab3||'USER'||','||chr(13)
    ||v_tab3||'sys_context('||'''USERENV'''||','||'''HOST'''||'),'||chr(13)
    ||v_columns_new
    ||v_tab2||');' ||chr(13)
    ||v_tab1||'END IF;'|| chr(13) ;
    -- v_output1 := v_output1 || v_insert || v_update|| v_delete ||CHR(13)||'END;';
    --EXECUTE IMMEDIATE v_output1;
    -- v_output1 := v_output1 || chr(13)||'/';
    dbms_output.put_line(v_output1); generate script
    dbms_output.put_line(v_output1);
    dbms_output.put_line(v_insert);
    dbms_output.put_line(v_update);
    dbms_output.put_line(v_delete);
    dbms_output.put_line('END;');
    dbms_output.put_line('/');
    END LOOP;
    END;
    show errors;
    Edited by: ranjus on Oct 17, 2012 3:33 PM

    Thank you so much for your suggestions.
    I went through the link you suggested.
    I wondered why DBA requested me to create triggers when such easy option was available to them. And I found the reason why triggers for audit.
    When Triggers Are Necessary
    Avoiding False Positives. Audit trails are generated through autonomous transactions from the original transactions. Hence they are committed even if the original transactions are rolled back.
    Here is a simple example to illustrate the point. Assume that we have set up auditing for UPDATEs on table CLASS. A user issues a statement to update a data value from 20 to 10 and then rolls it back as shown below.
    update class set size = 10 where class_id = 123;
    rollback
    Now the value of the column SIZE will be 20, not 10, as if the user never did anything. However, the audit trail will capture the change, even if it's rolled back. This may be undesirable in some cases, especially if there are lots of rollbacks by users. In such a case, you may have to use the trigger to capture only committed changes. If there were a trigger on the table CLASS to insert records into the user defined audit trail, upon rollback the audit trails would have been rolled back too
    Capturing Before-change Values. Oracle-provided audit trails do not show the values before and after the change. For instance, the above change will create an audit record that shows the statement and the SCN number at the change, but not the value before the change (20). The value can be obtained from the SCN number using flashback query, but it depends on the information being available in the undo segments. If the information is not captured within the limit specified by the undo_retention period, the prior values can never be retrieved. Using a trigger guarantees that the values are captured without dependence on the undo_retention period, and may prove useful at times. Under these two circumstances you may decide to continue using triggers to record the audit trails at a granular detail.

  • How to create the event in the report for jobs scheduling.

    Hi Experts,
    i have a requirement like as follows:
    The following triggers for Batch Jobs in the SCM system will be created.i.     
    Background Processing Event = u201CAPO Background Processing Eventu201D. After sending the Event, write a Log Report line u201CEvent u201CAPO Background Processing Eventu201D sentu201D.
    Could you please suggest me how we create the Event or which transaction ?
    Please give me a steps for creating events so that based on these events we use
    CALL METHOD cl_batch_event=>raise
        EXPORTING
          i_eventid                      = p_bpeve
          i_server                       = p_server
          i_ignore_incorrect_server      = p_ignore
        EXCEPTIONS
          excpt_raise_failed             = 1
          excpt_server_accepts_no_events = 2
          excpt_raise_forbidden          = 3
          excpt_unknown_event            = 4
          excpt_no_authority             = 5
          OTHERS                         = 6.
    Right now i received message "APO Background Processing Event" is doesn't exists.
    Thanks in Advance.
    Puneet.

    Hi Puneet,
    Goto transaction SM62 and in there to BckProcEvents tab. There you can create the events.
    You just need to specify the name and Description of an event.
    Hope this serves your purpose.
    Thanks

  • How to create a report  based on selected item from Select list?

    Hi,
    I have created a tables_LOV based on:
    select table_name d, table_name r from user_tab_cols
    where column_name like '%_type%'
    Then I created a page item ListOfTables,  Display as select list and pointing to tables_LOV.
    I run the page, and i can select the table i want from the drop down list.
    How to create a report  based on the selected item? (ex: select * from selected_table)
    many thanks in advance
    Salah

    Hi Salah,
    Allright, have a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report
    I think that simulates what you're trying to accomplish. I've set up the simplest method I could think of.
    The report is based on an apex collection. If you are not familiar with that, you should study the documentation: APEX_COLLECTION
    To recreate my example you should:
    1) create an (interactive) report on your collection
    SELECT *
       FROM APEX_collections
    WHERE collection_name = 'MY_COLLECTION'
    2) create a page_item select list for the tables you want to display (in my case this is called "P38_TABLES" )
    3) create a dynamic action that triggers on change of your select list page_item. The dynamic action must be a PL/SQL procedure perfoming the following code:
    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
    end;
    Make sure you add your page_item to the "Page Items to Submit" section.
    4) Add an extra true action that does a refresh of the report region.
    Here are two pictures describing the da:
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA1.png
    http://www.vincentdeelen.com/images/otn/OTN_COLLECTION_REPORT_DA2.png
    Good luck and regards,
    Vincent
    http://vincentdeelen.blogspot.com

  • How to create multiple modules in quizzes in single file?

    Hi,
    Can someone guide me how to create a multiple module quizzes under one captivate file ( captivate 5.5 ver)
    I have a quiz.cptx file with 50 questions from different chapters A,B,C,D,E with 10 questions in each chapter.
    The scenario
    Note : min 80% score  per chapter is the passing criteria
    1. Start the quiz after login and password
    2. Start the quiz for chapter A ( 10 questions)
    3. score for chapter A should be displayed
    4. If "cpQuizInfoPointsscored"'s  value < = 40 ; ie 80 % for chapter A
             review of the failed questions in the chapter
             OR
             retake quiz for that chapter should be triggered,
       else goto chapter B
    5. Start the quiz for chapter B ( 10 questions)
    3. score for chapter B should be displayed
    5. If "cpQuizInfoPointsscored"'s  value < = 40 ; ie 80 % for chapter B
             review of the failed questions in the chapter
             OR
             retake quiz for that chapter should be triggered,
       else goto chapter C
    6. //rly with other chapters
    7. After passing all chapters the result should be printer based on the scores.
    Is there any better ideas to crack the steps 4 - 6, bcz i am not able to reset the value of "cpQuizInfoPointsscored"; which is incremented as each question is completed.

    Welcome to the forum,
    Agree totally with Rod, this can be done with advanced actions (have some examples on my blog), but it is a lot of work. And the Quizzing system variables such as cpQuizINfoPointsscored are all read only, no way to change them by advanced actions at all.
    If you want to transfer variable values from one file to another, like from the different quiz files to a main file (to take decisions over there about possible branchings), you should have a look at Michael Lund's Save & Load Data widget:
    Save & Load Data widget
    Lilybiri

  • Flash CS4 - how to create event flow from children to parents?

    In my opinion natural event flow direction is from children
    to its parants.
    E.g. when in dialog box buttons are pressed it is natural to
    inform only
    this dialog box about these actions. When dialog box can't
    handle particular
    event then passes it to its parent and so on .
    Unfortunately this direction is not well supported by Flash.
    To achieve
    support for this event direction it is necessary to call
    parent.dispatchEvent() with bubbling option off. This
    solution is
    inconvenient because sometimes I can't predict what event
    types will be
    triggered inside dialog components. Most likely there is no
    function to
    catch all events which have no defined handlers in dialog in
    order to be
    possible to pass them one level higher.
    Have you got any experience with building communication model
    between
    objects in Flash applications?
    Regards,
    Marek

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

  • How to create event based process chains

    Hi All,
    I would like to know about event based process chains. In connection to this, could you please answer the following queries,
    1. How to create events
    2. How to link created event to the process chain in the same BI or BW system and as well as from  
        externel BI system.
    3. How link one process chain with other process chain (i.e, After completion of one process chain, it
        should trigger other dependent process chain)
    Thanks and Regards,
    Kotesh.

    1). Doubt regarding first question.
    For example, i would like to create time based event (it should be trigger daily at specified time),
    where we have to maintain scheduling options while creating event.
    When i checked SM62 there i found only two options a). Event name and b). Description.
    Could please send any doucument link if you have.
    Ans : You can use function modules like "BP_EVENT_RAISE" in a program and schedule the program to trigger.
    2). For externel BIW system also same procedure we need to follow or any difference.
    Ans : Externally you need to trigger the same event.
    3). i found dependent process chain also had scheduling options as direct scheduling insted of start using meta chain or API. As you said dependent process chain should be mata chain. it seems dependent process chain may be Meta chain or Direct scheduilg.
    Ans : Its your choice how you want to schedule it.You can either make that dependent chain a metachain or schedule it separately.
    I found at the end of first process chain they kept one process like Raise event and second process chain connected with the help of raise event process event name. If you have any idea about this process could explain a bit more.
    Ans : May be they are raising the event in the main chain and triggering the dependent chain using this event.
    But Metachain is preferred for such thing.Though it does similar thing.
    Hope this helps.

  • How to create Event for a BO

    Hi Experts,
    I am developing WF for tcode MD03, this transaction is used to create planned order.
    I need to trigger a WF to send mail when ever a Planned order is created using MD03 tcode.
    BUS2004 is the BO for Planned order, but this BO does not have any event linked to it. So my question is how to create a event to a BO.
    Also, I used BTE to create a Z function module, this FM is getting triggered whenPlanned order is created using MD03 tcode. Is it possible to trigger a WF using this FM?, If yes, how?
    Thanks in advance.
    Regards
    Balu

    Hi All,
    Thanks for your useful suggestion.
    I placed a breakpoint in the Z FM to check whether the created planned is updated in Plaf table when this FM is triggered. But i found that Plaf table is not updated when the FM is getting triggered.
    Do you still recommend me to go ahead and call the WF?
    Regards
    Balu

  • How to create event/notification in SAP using PI.

    Hi there,
    How to create the event/notification in SAP that triggered by the PI system. Any suggestion appreciated.
    Thanks

    Hi Mistry
    You call a bapi to add the event message to SAP EM.
    Below an example:
    SAP EM ABAP - Calling a BAPI to create an Event Message in SAP Event Management - Code Gallery - SCN Wiki
    Best regards
    Eduardo Chagas

  • How to create a Sales Order

    Hi Guys,
    Any one tell me how to create a Sales Order. What are the Mandatory parameters we need to pass while creating. Thanks in advance.
    Thanks
    Kiran.B

    Hello kiran,
    <b>**REMEMBER: please do reward points for good answers**</b>
    1.      Create sales order
    This process step can be triggered as follows:
    The customer accepts the quotation and places an order.
      You create a sales order with reference to a quotation. For more information, see Structure link processing Quotations. The system copies the items from the quotation.
    You create a sales order. This is also possible without performing the previous steps.
           2.      Enter products
    You enter products requested by customers.
    Note
    If necessary, you can configure products again for every item of the sales order. You can find more information in the business scenario variant Structure linkQuotation and Order Management (Configure-to-Order) and under Structure linkProduct Configuration in the Sales Transaction.
           3.      Check availability, schedule order and create requirements
    The system triggers an availability check and scheduling in SAP APO for every order item in SAP CRM. The confirmed quantities and dates are confirmed by SAP APO to SAP CRM, and saved in the sales order (see Structure linkAvailability Check in the Sales Order). At the same time, a customer requirement is created in SAP APO.
    Note
    You can also execute the availability check in SAP R/3. You can find more information under Structure linkAvailability Check with SAP R/3.
           4.      Maintain and determine conditions
    The system determines the prices and the value of individual items. If necessary, you can process these. For more information, see Structure linkPricing.
           5.      Perform credit check
    SAP R/3 executes a credit check based on the results of pricing in SAP CRM. The result of the credit check is confirmed in SAP CRM, and saved as the credit status at item level. For more information, see Structure linkAutomatic Credit Check.
           6.      System replicates sales order
    After the sales order has been saved in SAP CRM, complete and without errors, it is replicated for logistics processing in SAP R/3. Order data is transferred together with confirmed scheduling lines to SAP R/3.
           7.      System receives sales order
    After replication to SAP R/3, you can change the sales order in SAP CRM and SAP R/3. You can find more information on this under Structure linkData Exchange for Sales Transactions: CRM Enterprise - SAP R/3
           8.      Send order confirmation to customer
    You can send the order confirmation either electronically, or in print to the customer. You can find more information under Structure linkSales Order Confirmation by E-Mail.
           9.      Monitor status of order
    Regards
    Ak

  • How to Create A new Database in the oracle 10g XE

    i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

    Hi there 785434,
    (This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
    Moderator, please move this if able
    I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
    Example:
    CREATE TABLE TEST
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE
    LOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE TABLE TEST_HISTORY
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE,
    CHANGE_DESCRIPTION
    NOLOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE OR REPLACE TRIGGER TRG_BU_TEST
    BEFORE UPDATE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
    END;
    CREATE OR REPLACE TRIGGER TRG_BD_TEST
    BEFORE DELETE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
    END;
    Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
    Note that this method might not be suitable for very high transaction rates.
    You will need to 'clear' these history tables as part of routine maintenance.
    Hope that this Helps.
    Ronald.

  • How to Create material master workflow

    Hi All,
    Can anybody tell me how to create material master workflow?
    i need to customize the workitem  for creating data in different views in MM01 transaction with restriction to particular user.
    Regards,
    Priti

    Hi,
    This link is to  display a material.My requirement is to create a workflow which will allow a responsible person to enter data for specific department data e.g Purchase,Accounting etc.Initially anyone can create data using basic data1 and basic data2 views.After this my workflow will be triggered and it will go to next person who is responsible to enter Purchase data and then Accounting data.
    Plz help me to create different views with respect to person.
    Thanks in advance.

Maybe you are looking for

  • Radeon HD 5770 vs. NVIDIA GeForce 7300 GT

    I am running a first gen. 1,1 Mac Pro 2 x GHz Dual-Core with 18 GB Ram. I have two 30"-Cinema Display connected to two NVIDIA GeForce 7300 GT. Will I recognize more speed by upgrading to a single Radeon HD 5770? I know that this upgrade would cost me

  • Help,how to display a index in report

    Dear all experts,i need to modify the following code so tat i can actually dispaly one more columm which is at pos0 for the index number.   i add in the following code in bold,but it din give me any display... IF WA_MVSTAT-MATNR EQ SPACE.        AT N

  • I can't drag an images between not floating frames

    Hello i have the newe Elements 12. It was working perfectly, but after the last up-date there was a problem. Ican't drag images between not floating frames anymore. this was possible before the up-date. now the images can only be draged if one is a n

  • Adobe Content Viewer, library downloading issue

    I have the free version of the folio building tools currently with acrobat.com as I test the capabilities of the publishing suite for our company. I updated the folio tools, can sign in, create a folio, and it appears OK in the shared workspace on ac

  • Compressed XMP in JPEG files?

    Hi, I'm trying to access XMP info in some images files. Some works, anothers doesn't. The images that a cannot access seems to have the XMP info compressed or in binary format. Someone knows if I'm right or I'm wrong? And if is compressed, how to acc