RAISING AN EVENT WHEN DATABASE TABLE UPDATES

hi all,
         i want to raise an event when database table updates.For eg : if a price of a material has been changed then i have to raise an event and run the abap program in back ground.i know transaction SM62 to create event, i dont know about transaction SM64. please give me the procedure how to solve this problem. i dont know work flow. please give me a sample code how to raise event.
thanka and regards
suresh

Hi Suresh
It is important to understand that the SAP architecture abstracts the database from the application.
I think that you should look for ways that the application triggers an event when an update has taken place, rather than the DB.
Two ways of doing this that spring to mind are change pointers (for the ALE interface, see menu SALE) and Business Transaction Events (various things including CRM integration, see menu FIBF).
The latter works very well for sending prices to CRM when they change. I am more familiar with this than ALE so I will discuss it.
If you go to menu FIBF and then follow menu path Environment -> Info System (P/S), and then run the report for event 00503301, you can find documentation and a sample function module that you can copy.
Once you register your new function module in the event tables then it will be called when prices are changed.
Cheers
Dom

Similar Messages

  • Raise an event when an idoc invoice (INVOIC02) gets created in error

    Hi All,
    I’m trying to generate an email message from an output invoice when processed incorrectly.
    I created a subtype of IDOCINVOIC, updated the linkage table using swe2  but the events are not raised when I go to re-issue my invoice output.
    I know it’s possible to raise these events in idoc invoice exit ZXEDFU02 but  the status is not created at this stage.
    Is it possible to raise an event when an idoc invoice gets created in error?
    King Regards
    Ann

    @CoolDadTX -That's because I've written com servers in the past using VB.net, however they were not registered with the Running object table.
     What I'm trying to do in this case is have an application that will be started by the user, and then they will start another application written in .Net to connect to that first application.  The reason for this is that we have an application
    written in an old version of smalltalk that doesn't seem to support getObject but can create an IUknown, and we already have base classes to attach to COM objects written in .Net.  As this new application needs to be started first it can't be tightly
    coupled to the legacy application, so we are trying to register the new application and then connect a Dotnet Client that is being started through a  COM Interface from the legacy application.  I know it's convoluted but we need to keep the legacy
    application alive for a bit longer while we rewrite it as an add-in for the new application.
    The article that you linked to has been very helpful on the server side, but do you have any ideas as to how I can connect the sink on the client side in C#?

  • Database table update issue

    Hello experts, Need your Help...
    I am trying to update database table using Update command. And I am doing COMMIT WORK AND WAIT. after the successful update.
    But my code sometimes does not work and the table is not updated.
    Sometimes the code works and sometimes not.. for the same data.
    Can anybody think of any possible reason?
    Thanks in advance,
    --Kumail

    Hello Guys,
    Here is the code, here we have all the keys... as it updates correctly sometimes. But doesnt update sometimes... for same data...... I have added COMMITT and WAIT statements to solve this problem.... but no luck....
            UPDATE zfxx_bsr_data
                SET zfxxstatus_glr  = zfxx_bsr_data-zfxxstatus_glr
                zfxxstatus_issue = zfxx_bsr_data-zfxxstatus_issue
                    zfxxerdat_glr   = sy-datum
                    zfxxuser_glr    = sy-uname
                    zfxxremark_glr  = zfxx_bsr_data-zfxxremark_glr
                    zfxxertime_glr  = sy-uzeit
                  doc_ind         = w_doc_ind                  
                  zfxx_attach_acc = w_zfxx_att_acc      
              WHERE bukrs        EQ t001-bukrs
              AND   saknr        EQ zfxx_bsr_data-saknr
              AND   zfxxperiod   EQ zfxx_bsr_data-zfxxperiod
              AND   zfxxfield    EQ c_ba
              AND   zfxxfieldval EQ tgsb-gsber.
            IF sy-subrc EQ 0.
              WAIT UP TO 3 SECONDS.
              COMMIT WORK.
              WAIT UP TO 3 SECONDS.
            ENDIF.

  • DRAW database table updation

    Hi Experts,
    Actually i want to update DRAW database table .
    i want to update 'LOEDK'  field as 'X' by using my report program by giving inputs as "doknr  doktl  dokar and
    dokvr" .Is there any functional module or BAPI for doing this task.
    Thanks,
    Madhu.

    Hi,
    Pls cordinate to abaper for this.
    Anil

  • Firing event when pressing table cell

    Hi,
    Is it possible firing an event when double click the web dynpro table cell?
    Fired event must be called with parameter with value inside cell.
    Is it possible?
    Thanks.

    Hi
    What TablecelllEdito  you want to use here. If it is LinkToAction then map the parameter with its action.
    Code for this is
    wdContext.nodeTestNode().setSelected(i, true);
    //Here i is the parameter of type Node Element.
    Best Regards
    Satish Kumar

  • Need to raise Business Event after insert or updates on a table

    Hi All,
    Requirement : I have a Custom table in Oracle E-biz (R12 using 11g database), Whenever any row is inserted or updated on this Custom table, I need to log this changes in an audit table and then raise a Business event.
    Please suggest which are the best possible options.
    I could sense few options like
    1. Using Oracle Alerts (Event)
    2. Using Triggers
    Thanks,
    Santhosh

    Thanks for the response.
    Let me look into the links which you have sent.
    Meanwhile i have few clarifications as given below:
    1. If i use triggers, the trigger fires before the transaction is committed.
    2. If i use event alerts, i see some delay in the alert firing. I tried creating a separate concurrent program for "Check event alert". But still i dont see any improvement.
    Any suggestions on this ..?
    Thanks,
    Santhosh

  • Database table updation with XML Document data

    import java.io.*;
    import java.lang.*;
    import java.net.URL;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import oracle.xml.sql.dml.OracleXMLSave;
    import org.w3c.dom.Document;
    public class updateXMLData
    public static void main( String argv[] ) throws SQLException,Exception
    String tabName = "emp";
    Connection conn = null;
    String xmlString;
    Document doc;
    URL filename;
    try
    //init a JDBC connection using Oracle's JDBC Drivers
    String host = "maple"; // change,these won't work
    String port = "1521";
    String sid = "PBSI";
    String s1 = "jdbc:oracle:thin:@" + host + ":" + port + ":" + sid;
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection( s1,"scott","tiger");
    // Instructions for updating the database rows from XML Document
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    filename = sav.getURL("pbsiempupd.xml");
    sav.setRowTag("EMP");
    String[] tempArr = new String[2];
    tempArr[0]="EMPNO";
    tempArr[1]="ENAME";
    sav.setKeyColumnList(tempArr);
    sav.setUpdateColumnList(tempArr);
    int noRows = sav.updateXML(filename);
    System.out.println("No of rows updated : " + noRows);
    catch (SQLException se)
    System.out.println("An SQL exception has occured ");
    System.out.println("The error code is : " + se.getErrorCode());
    System.out.println("The SQL State is : " + se.getSQLState());
    System.out.println("The message is : " + se.getMessage());
    catch (Exception e)
    System.out.println("Unknown exception has occured");
    System.out.println("The class is : "+ e.getClass());
    System.out.println("The message is : "+e.getMessage());
    finally
    if (conn != null) conn.close();
    The input XML Document is given below :- in 'pbsiempupd.xml'
    <?xml version="1.0"?>
    <ROWSET>
    <EMP>
    <EMPNO>8888</EMPNO>
    <ENAME>RAO THOTAKURA</ENAME>
    </EMP>
    <EMP>
    <EMPNO>9999</EMPNO>
    <ENAME>BAVA MANI</ENAME>
    </EMP>
    <EMP>
    <EMPNO>7777</EMPNO>
    <ENAME>SRINIVAS M</ENAME>
    </EMP>
    </ROWSET>
    After executing this class with 'java updataXMLData' I'm getting following runtime error message :-
    Unknown exception has occured
    The class is : class oracle.xml.sql.OracleXMLSQLException
    The message is : Exception 'java.sql.SQLException:Missing IN or OUT parameter at index:: 1'
    encountered during processing ROW element 0All prior XML row changes were rolled back.
    in the XML document.
    Please anybody could explain how to solve it.
    Thanks
    Sambasivarao Thotakura

    See my reply to your other question. thanks.

  • Use of loops in pbo and pai events when a table control is on the screen

    asap.

    Hi Feroz,
              What is the very purpose of using table controls and tab strips in module pool programming.
    Rgds,
    kha

  • How to track changes when a contact updates contacts address section?

    I'm creating a workflow to create an integration event when a contact updates its contacts address section (number/street, address2, address3 city, state, zip).
    Record Type: Contact
    Trigger Event: When Modified record saved
    Workflow Rule Condition: None
    Action Type: Integration Event
    When I go to configure the workflow action, I don't see the address on the track changes list. How do I specifiy the address section to be tracked when it's modified?
    Thanks

    The best way would be to create a trigger in the database that would update the history table whenever the data was changed. The next best would be to use a stored procedure. I would not try to do this with server side scripting.

  • BCALV_EDIT_03 - Need the table update function

    I am fairly new to OO programming and have worked through the various sample programs. I am currently using BCALV_EDIT_03 and _04 to write a table maintenance program.
    I kind of have figured out how the delete and insert function works but unfortunately in sample program _03 the final table update function is missing.
    What I am after is that I get all the changed records from the grid and update the external table just with those records.
    Could somebody post some sample update code that I could check out?
    Thanks in advance.
    Gerd

    Table update as in, database table update or ALV table update ?
    ALV Table update will be done automatically, in case you have used the method : set_table_for_first_display
    As you also quote that you are checking out BCALV_<b>EDIT</b>_03, I will just clarify this point, all changes made to the table are triggered by the EVENT DATA_CHANGED and this event has the necessary fields, from which you can come to know which rows and what values have changed. You need to use this DATA_CHANGED event and update your internal table. This is then shown in SET_TABLE_FOR_FIRST_DISPLAY in PBO.
    In case you are talking about database update and if it is a custom table, then you have to use the direct update.
    In case it is a SAP table, you might let us know which table it is, and probably some of the experts here can let you know the Function Module, BAPI or any method of a class to use.
    In case you need a good tutorial help, you can find it in Serdar Simsekler's
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
    Let me know if I am way tangent here or I could be of help to you.
    Regards,
    Subramanian V.

  • Problems with event when changing Purchase Requisition. (BO:BUS2009)

    Hi experts,
    I have a doubt with this. When i erase a position in the Purchase Requisition (ME52N), the event SIGNIFICANTLYCHANGED of BUS2009 is raised.
    When I try to modify the  Purchase Requisition not erasign the position but changing the Material group the event is not raised. Can i customize the system to define that changing the Material group is a significantly change for my system? If not, can i raise another event when this happens?
    Thanks!!
    Artur.

    Hi,
    Simply create a custom event called CHANGED in the BO.
    Create a entry for this event in SWEC tcode. Select the radio button on change.
    This should do the job.
    Note : This event will be raised for any kind of changes in this purchase requisition.
    Regards,
    Raj

  • Two Different Databases Tables Synchronisation

    Hello,
    In my case DATABASE A is always updating table TABLE XYZ of DATABASE B through MQ Series using online messages. Due to some reasons that link is down, could any one suggest how we keep continue synchronisation of these two databases, we can not modify any thing on DATABASE A we can only read it as it is master database while DATABSE B is updated by A.
    Table of DATABASE A is containing 2 Million records same with B. Can any one let me know how to compare the rows of the tables of each database and if some rows are missing in DATABASE B it should be updated by DATABASE A.
    Please suggest any solution so that both databases should be kepy synchroinised at table rows level.
    Thanks

    Hi,
    why post three times the same thread ?
    Synchronisation between two databases tables
    Synchronisation between two databases tables
    updating table TABLE XYZ of DATABASE B through MQ SeriesAnyway, have you think about materialized view through dblink ? A matarialized view can be refresh on commit on master table or at point in time.
    To compare table try :
      1* create table tab4 (col1 date, col2 number)
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into tab4 values (sysdate,1)
    SQL> /
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into tab4 values (sysdate,2)
    SQL> /
    1 row created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into tab4 values (sysdate,3)
    SQL> /
    1 row created.
    SQL> create table tab5 as select * from tab4;
    Table created.
    SQL> update tab4 set col1 = sysdate where col2=1;
    1 row updated.
    SQL> select * from tab4
      2  minus
      3  select * from tab5;
    COL1            COL2
    12-APR-06          1
    SQL> So try :
    select * from tabA@databaseA
    minus
    select * from tabB;Nicolas.

  • Weird thing about when user click Update button

    Hi,
    I got a very weird thing when i want to add some my code in button "1" on click event. I use below code to capture the on click event when user click "Update" button, so i can do some tasks(assign some fix value to a specific field). I found i can capture the event only once. Once the document is updated and i open second recordl then my code is never exexuted then. No error, no exception. Is anyone know what happen?
    Thanks,
    Lan

    Hi All,
    Yes, you are right. After i use try block, i can see the error. I thought I should be expected an red exception alert in the B1 info bar.
    Thank you !
    Lan

  • How to update two database tables when using DatabaseProvider

    I'm a begginer and I've made an application which uses a database. In one page, I have a table which I've took it from "woodstock basic" palette. I was using DatabaseProvider to populate the table with data from a database table called "copii". My code is:
    //i'm check all the rows in the table to see if the field "IDCOPIIC" =0 and if true I will put the value of "newCopiiId"
    do {
    if (copiiDataProvider.getValue("IDCOPIIC").equals
    (new Long(0))) {
    copiiDataProvider.setValue("IDCOPIIC", new Long(newCopiiId));
    newCopiiId++;
    } while (copiiDataProvider.cursorNext());
    copiiDataProvider.commitChanges();
    My problem comes now because I have another database table tided with a foreign key by this one and I want to update this one too when I'm updating the "copii" table. I don't know how to do it ...I've tried in many ways but is impossible. Can anyone help me ! I'm desperate...I cannot figure it out how I could insert, update in two tables in the same time when I'm using DataProvider .
    Thanks in advance!

    Hmm.
    Not sure where your going with the <select> menu.
    The description you made:
    "Both have an id column, which is presumably the record's primary key, but you need to create a relationship by storing the primary key of one table as a foreign key in the child (related) table. For example, you should insert the primary key of the first table in the second table as user_id. That enables you to identify which username and password are related to an individual listed in the second table"
    Seems to be the direction that I'm looking for.
    Now my question is how do I insert the primary key of the first table in the second table as user_id?
    >
    >"For example, you should insert the primary key of the first table in the second table as user_id"
    Since both tables have an id column and they both are the primary key, do I just change the name of the second tables id column to "user_id" then?
    Or is there an actual "insert the primary key to another table" function that I don't know about?

  • Update ztable from database table directly

    hi all,
    can u tell me the possible ways to update a ztable from database table directly.
    i mean is there anyway to update ztable whenever entry is created in database table .
    i dont want to update using insert,modify statements.
    points will be rewarded to all hlpful answers.

    A slightly dirty solution:
    Use SAP functions for reading from CDHEADER and CDPOS tables [with enough filters such that you extract minimum records possible] to read changes to MARA table fields since last run of your program. Use this information to update your ZTABLE. I would recommend having a table maintainance generator on ZTABLE. The actual update should be by a BDC by calling transaction SM30 for ZTABLE maintainance. Now the program may be set up as a batch job running 1ce an hour. You get updates to the extent of 1 hour latency.
    Alternatively, you may look if an opportunistic BADI / user Exit is there alongside MM01/02 transactions - assuming the latter are the only ones updating MARA. In this BADI you may write the code to update ZTABLE- again, look to do it by BDC call transaction sm30 to maintain ZTable. To lighten up the code -load on BADI you may simply raise a custom event and move on. You will configure a job that runs your program when that particular event is raised. This will need the 'burden' of figuring out the changes, though.
    An elegant way would be to fire a MATMAS fIDOC for every change to Material, capture that and turn back the changes to ZTABLE. This will facilitate the delta load.

Maybe you are looking for

  • I can't see the 'search' option on this site. Am I the only one?

    I'm having an issue with DVDSP and I can't see the 'search' option on this site. Is Apple cutting down on bandwidth for this so they can sell their phones?! Anyone else having the same issue?

  • Error while adding approver

    Hi Sourcing Experts, I am getting the following error while trying to add the approver through the below code . log.setLogMessage("------------------ Approver Found------------------");           Logger.info(log);           addApprover(ext_legalgroup

  • PLSQL warning

    Hi All, I have compiled a procedure which contains the below query, is giving the below warning...Can any one help me to get out of this issue... Warning(6,3): PLW-07204: conversion away from column type may result in sub-optimal query plan SELECT co

  • Help Adding Menu Items to Bridge

    I've created (modified) a couple of Bridge Scripts and finally have them working nicely. Now, I want to add a couple of Menu Commands to execute them. I tried modifying a script in the SDK, SnpAddMenuItem.jsx, which would work fine if I only had one

  • Error in SerializationPagedCache

    We got this exception in our production logs today. I suppose it happened in an env in which the overflow had never triggered. Can you explain what this means? Is this really a timeout connecting to a cluster node, or is it a configuration problem wi