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.

Similar Messages

  • 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

  • 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

  • URGENT: ADF Faces table updating issue.

    I have a project that uses JSF, ADF Faces, EJB 3.0, and the ADF binding framework.
    In this project, I have a page with a databound ADF Faces Table. The table has a number of read-only columns and two read-write columns. I also have an Edit button that allows the user to pop up a dialog box to edit the selected row of the table. When the user clicks OK in the dialog box, the data is passed back to the main page and the table is updated.
    Everything works correctly for the read-only columns. For the read-write columns, however, the table data does not get updated following an edit. This is what I have found:
    1. The table row data gets passed in to the Edit dialog correctly.
    2. The data gets passed back correctly.
    3. The model gets updated correctly (up to and including the database).
    4. Looking at the iterator in the debugger shows the correct, updated data.
    5. When the table row is getting redrawn, the getter calls for the read-write columns return the updated data.
    6. As mentioned above, the read-only columns get updated correctly.
    7. Updating the read-write columns directly from the table works correctly.
    So, the problem appears to be in the GUI layer. I suspect that, somehow, the submitted values of the read-write columns are not getting set properly, but I cannot figure out how to do this.
    Note that clicking on the Edit button results in a partial submit. In the return listener, I add a call to AdfFacesContext.getCurrentInstance().addPartialTarget(getRecipientTable()) in order to redraw the table (getRecipientTable() is the bound value of the ADF table).
    Please help! We are so close to production and we need to fix this.
    Thanks,
    Ara

    Hi,
    I don't have a testcase for this, so I just come up with ideas to try
    1. refresh the parent container of the table. It seems that the input text components are not triggered to refresh if the refresh is on the table.
    2. If using ADF, make sure the update is performed directly on theiterator (which automatically is the case if you use a ADF bound form for this)
    3. Check if executing the table iterator and then setting back the current row makes a difference
    Frank

  • 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.

  • 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.

  • 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.

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • Updating database table from co11n transaction ?

    I got a requirement to add two new addional fields  and want to save it in the standard table for reporting purpose. I follwed the steps like :
    1. I created new fields in the table AFRU using appending struture. and activated it using se14.
    2. I created a project and entered the enhancment (CONFPP07)  and i created the screen-exit. then i declared thse two fields in the include : ZXCOFTOP. once i activated the screen exit it appeared in the CO11N TCODE but when i enter some values in this fields , its getting stored  in the variable but i dont know how to store this value in the table AFRU .
    3. for updating i used the exit CONFPP05 and my would be like AFRUD_TAB-ZZSHIF = CAPTAIN.
    but the problem is its not getting updated in the database table AFRU.
    should i have to use module ...endmodule in ( SAPLCORU_S - 900 screen , exit : CONFPP07 ) and write code... , like the we follow
    for ztransaction or how should i solve this issue ?

    So, according to your code, it means that :
    1) your screen field is WA_AFRUD-ZZSHIF
    2) WA_AFRUD is declared as global (in ZXCOFTOP)
    Is that true?
    In PAI: EXIT_SAPLCORU_S_101, you should only do:
    move wa_afrud-zzshif to es_afrud-zzshif.
    In Exit : EXIT_SAPLCORF_105, you have to replace 'A'
    LOOP AT AFRUD_TAB.
    AFRUD_TAB-ZZSHIF = *wa_afrud-zzshif.* "'A'
    MODIFY AFRUD_TAB.
    ENDLOOP.
    Note that LOOP AT  is problable not the good coding (I think that this exit has to remain empty), it was just a test to check it works
    Did you think to activate your project in CMOD? (you have to activate both project, and the exits)
    Are you sure your exit is called. Did you debug it?
    See also Note 12831 (program SAPRSMODCHECK) to check there is no problem between project/exits
    Edited by: Sandra Rossi on Oct 17, 2008 6:59 PM

  • Updating tableview back into database table

    I am trying to display a recordset from mysql database table into a tableview in javafx. Maybe let's say get all records where invoice number is 101 i n the master table from the child records in the child table.(This is a typical master detail scenario.) After this I update the tableview add, delete, edit some records AND then I want to save this Tableview or rather update it back, synchronise into the database table.
    I request you to kindly help with sample code or any guidelines that will help me in this objective.

    Here is the tutorial of tableView : http://docs.oracle.com/javafx/2/ui_controls/table-view.htm
    You can use the Java Class that mapped the database for ObservableList. Get all the record in the database and cover it to the java object. Then add them to the ObservableList to show on TableView. After add, update, edit,... Get the item in the ObservableList and update back to your database.
    I can't tell in detail. You should try this tutorial and if there are any more Specific Issue you can post another question here.

  • Hello Gurus..... ISSUE with child Table update

    I have an issue with child table update
    I have created a GTC with one parent table and two child tables. I'm able to update the parent table and the values are found in db, but the ISSUE is the child Table values are not updating the db.
    please give me a solution
    regards
    Srikanth

    If you are keeping referential integrity in the database, not in the application, it is easy to find the child and parent tables. Here is a quick and dirty query. You can join this to dba_cons_columns to find out on which columns the referential constraints are defined. This lists all child-parent table including SYS and SYSTEM users. You can run this for specific users of course.
    select cons1.owner child_owner,cons1.table_name child_table,
    cons2.owner parent_owner,cons2.table_name parent_table
    from dba_constraints cons1,dba_constraints cons2
    where cons1.constraint_type='R'
    and cons1.r_constraint_name=cons2.constraint_name;

  • I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1.

    I have a column where I have implemented writeback, its working fine. On top of this I need to show 0 as No and 1 as yes in our report, that is also done. Now I want to enter Yes in a column where it was no and I want database table to get update with 1. I am not sure how to do it. SOmeone please help me out.

    Hi ,
    In your write back XML  try the below  query insert
    INSERT INTO TABLE_XYZ (attribute1)  values (SELECT CASE  WHEN @{C1}=’Yes’ then 1 when @{C1}=’No’ then 0 else null end from dual)
    Regards
    Rajagopal

  • Browse and update database tables

    I'm looking for a tool that will let me connect to an Oracle database, select a table and some fields off the table and build a simple java class to navigate / update the data.
    Essentially, I'm looking for a tool that replicates the way Microsoft Access can build a form for navigation and update of a database table.
    However, I want to use java, not MS Access.
    Any ideas if such a tool is available ?
    Thanks

    http://squirrel-sql.sourceforge.net/

  • Update database table

    I have 1 million records in application server and I want to update database table from that.
    Is UPDATE statement the best technique to do it.
    Just wanted to know if there is any other better tehcniques.
    Also i want to write the errors to job log. How can we do that?
    Regards,
    DNP

    If they are all new records or all changes, it would be best to use INSERT or UPDATE. You will also want to do mass inserts/changes using an internal table. Since you have so many records, you will probably have to do this in chunks in order to avoid dumping on the rollback area.
    Rob

  • Is it possible to update internal table from database table

    Hello All:
              I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
    thanks.
    Mithun

    Hello my friend,
    You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
    To update some fields at once use:
    UPDATE DBTABLE FROM TABLE IT_TABLE
    Hope this helps!!
    Gabriel

Maybe you are looking for

  • Could someone help me please

    I am doing a piece of code in RMI here is what i have come up with up to now: public class cipherimpl     extends java.rmi.server.UnicastRemoteObject     implements cipher {     public cipherimpl()          throws java.rmi.RemoteException {         

  • Trying to use external monitor on MBP

    Hi, I've hooked my Macbook Pro 15" to an external Dell monitor, keyboard and mouse and everything seems to be working fine - I can put the laptop to 'sleep', then wake it up via the external keyboard and then use the external monitor as the main moni

  • Disable Form Field

    I have created a form that is a mathematical worksheet. There are 3 types of fields: (1) fixed value, (2) user entry and (3) calculated results. In order to make the calculated result fields stand out their style is set to BOLD RED. The fixed value a

  • DOCTYPE is optional, why UCCX still issues Error in logs?

    We have a vxml server pointed by UCCX voice browser. I tested a simple vxml app. then found this error in logs. I believe in UCCX technic docs, it says the DOCTYPE is optional, why it still complains it? 129984: Feb 15 11:10:39.691 EST %MIVR-SS_VB-7-

  • Another unlock question

    I am using CS5 on my Mac. I working on modifying my website that I originally contracted out to build.I also am not contracted with my original ISP, so my site is not up on the web. I cannot contact the original designer and the ISP is no help. At th