Perform ... ON COMMIT is not working

Hello,
I have to change Exclusion/Inclusion Flag in Invoice document after pressing SAVE button. I wrote code in FM 'RV_INVOICE_DOCUMENT_ADD'. I used implicit enhancement and put my logic at the end of FM. In Development server, since data is very less, so my code is running without using PERFORM.. ON COMMIT but is testing server, since data is very huge. So, my logic is not getting triggered.
Actually, I am calling table VBRP and EIKP in this FM and at the time of selecting records from VBRP and EIKP, records are not present in these tables. But in Development, since data is very so it works fine. But in testing, it is getting failed.
So, I used PERFORM.. ON COMMIT. But this is not calling my code even in Developemnt server.
Please, help me, how to use PERFORM.. ON COMMIT. Or is there another place where in, I can put my code. BTW this FM is the last place where I am getting values in VBRP and EIKP tables. Before this FM, we don't get any values in VBRP and EIKP.
Regards
Arpit

Hi Arpit,
Can't you use another condition like import parameter WITH_POSTING to determine the execution of the code?
And maybe placing your code in a function and call it with starting new task instruction where you can wait for the table updates.
regards,
Arpit

Similar Messages

  • Comm.jar not working in Applet but works in Eclipse

    Hello,
    Please help me to read serial port data from Java Applet.
    The below code working well and get data from weighing machine when we run in eclipse(Run Applet). But it now working when we use class file in Applet.
    I think its security issue, but i still could not understand what we need to do.
    I put the JOptionPane.showDialog and found that the code is crashing in line CommPortIdentifier.getPortIdentifiers(); (Not understood why try catch not working.)
    I am using in Windows 7 environment.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.logging.Logger;
    import javax.comm.*;
    import javax.swing.*;
    public class SimpleApplet extends JApplet {
    public void init() {
    JButton button = new JButton("Click me!");
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {                 
         JOptionPane.showMessageDialog(SimpleApplet.this, "hello");
    JOptionPane.showMessageDialog(SimpleApplet.this, Getdata());
    add(button, BorderLayout.CENTER);
    setBackground(Color.GRAY);
    public String Getdata()
         try
              String drivername = "com.sun.comm.Win32Driver";
    try
    CommDriver driver = (CommDriver) Class.forName(drivername).newInstance();
    driver.initialize();
    catch (Exception e) { //just do nothing, it doesn't really matter
         Enumeration portList=null;
    CommPortIdentifier portId;
    SerialPort serialPort;
    OutputStream outputStream;
    try
         portList = CommPortIdentifier.getPortIdentifiers();
    }catch(Exception ex)
         JOptionPane.showMessageDialog(SimpleApplet.this, "erorr:" + ex.getStackTrace().toString());
    JOptionPane.showMessageDialog(SimpleApplet.this, "get port lsit");
              while(portList.hasMoreElements())
                   portId = (CommPortIdentifier) portList.nextElement();
                   if(portId.getPortType()== CommPortIdentifier.PORT_SERIAL)
                        if(portId.getName().equals("COM1"))
                             try
                                  serialPort = (SerialPort) portId.open("WeightMachine",200);                              
                                  serialPort.setSerialPortParams(1200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
                                  outputStream = serialPort.getOutputStream();
                                  InputStream mInputFromPort = serialPort.getInputStream();
                                  outputStream.write("W".getBytes());
                                  outputStream.flush();
                                  Thread.sleep(500);
                                  byte mBytesIn [] = new byte[20];
                                  mInputFromPort.read(mBytesIn);
                                  //mInputFromPort.read(mBytesIn);
                                  String value = new String(mBytesIn);
                                  mInputFromPort.close();
                                  serialPort.close();
                                  return value.replace("+00", "").replace(" Kg", "");
                             }catch(Exception ex)
                                  return ex.getMessage();
              }catch(Exception ex)
                   JOptionPane.showMessageDialog(SimpleApplet.this, "erorr last:" + ex.getStackTrace().toString());
              return "Not found";
    Thanks in advance.
    Avinash

    959817 wrote:EJP wrote:959817 wrote:
    it now working when we use class file in Applet.Define 'not working'.But when i run applet from browser from same machine its not working.That's not an answer. That's just a vague and pointless restatement of the original vague and pointless statement that I asked you to clarify.
    When you take your car to a mechanic, do you just tell him it's 'not working'?

  • Perform ON COMMIT doesn't work (Try it)

    Has anyone tried a PERFORM ON COMMIT within a BADI? It doesn't work and i don't know why.
    I am working with the HR Module, and i have a BADI, which is fired when the user hits the 'SAVE' button (PA30 Transaction).. when this happens, i execute a PERFORM ON COMMIT and the subroutine is never called...
    Does anyone know anything about this?
    Regards

    In your BADI submit a function module [IN BACKGROUND TASK|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=inBACKGROUNDTASK&adv=false&sortby=cm_rnd_rankvalue] to update the second infotype via FM [HR_INFOTYPE_OPERATION|https://www.sdn.sap.com/irj/scn/advancedsearch?query=hr_infotype_operation&cat=sdn_all] (create a RFC enabled Z-FM that call the standard FM)
    Regards

  • An update statement followed by a commit does not work

    Hi all,
    When I have these two statements executed together, it does not work.
    update booking set arrival_date = sysdate - 1
    where booking_no = '200500000018';
    commit;
    But when I first execute the first update statement, then comment it out, and then execute the commit statement, it works. Is that a bug or do I do something wrong or is it supposed that way? Oracle 9.2.0.7, Raptor on XP SP2.
    Thanks.
    ben

    Thanks Donal. I tried and it did not work. Maybe I missed something? I used the same script file that works in SQL+. When I did that in Raptor by clicking the exceute script button, I did not see any thing in the script output window. I verified that by selecting * from user_objects (I was trying to create a sproc) and no sproc was created. Then I ran the script in SQL+, and then ran the select * from user_objects again in raptor, I got one row back.
    ben

  • Java comm api not working in j2sdk1.4

    am doing a sms project in java..
    my code is works fine in jdk1.3 ,but when i tried in j2sdk1.4 it failed
    1.classpath used
    c:\j2sdk1.4.2_08\lib\comm.jar;
    2.copied win32 dll to j2sdk1.4.2_08\ bin
    3.comm.jar and java.properties toj 2sdk1.4.2_08\lib
    also in policy tool,grant allpermissons set
    thkx
    arvind

    i cant run the program in j2sdk1.4
    port is not opening.
    iam using comm.jar,javax.comm.properties ,win32 dll

  • Create and commit does not work

    Hi,
    I have a Creation form in which I have a auto-suggest box(using ajax) and a ediable table.
    I have Create button and Commit button dragged from the Data Control Palette.
    But they dont work?
    Is it becoz of the Ajax which i have kept?
    Also Can anyone suggest a doc which explains what happens actually when a create/commit button is clicked.

    Hi,
    the create and commit buttons execute method bindings (operations if using ADF BC) on the binding layer.
    Not sure if this has to do with you Ajax implementation because this is what only you can tell from looking at your code. Change the "create" binding in the pageDef file to reference "CreateInsert" if using ADF Business Components. This will create a new row.
    Note that the commit button is disabled until a change has been submitted
    Frank

  • COMMIT is not working in HS to EXCEL under 9.2.0.1.0

    Hi, I am using HS to access EXCEL spreadsheet via DB link under Oracle 9.2.0.1.0. Everything works OK, I update EXCEL data no problem. However when I commit the changes and release (close) DB link all my changes disappear. Below is the code:
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    CT
    NJ
    SQL> update "effective_date$"@EXCELDB set "state"='AL' where "state"='NJ';
    16 rows updated.
    SQL> commit;
    Commit complete.
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    AL
    CT
    SQL> commit;
    Commit complete.
    SQL> alter session close database link EXCELDB;
    Session altered.
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    CT
    NJ
    As you can see, as soon as I close DB link, I am back to original data. At the same time same exact steps under Oracle 8.1.7.0.0 via same ODBC datasource work OK:
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    CT
    NJ
    SQL> update "effective_date$"@EXCELDB set "state"='AL' where "state"='NJ';
    16 rows updated.
    SQL> commit;
    Commit complete.
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    AL
    CT
    SQL> commit;
    Commit complete.
    SQL> alter session close database link EXCELDB;
    Session altered.
    SQL> select distinct("state") from "effective_date$"@EXCELDB;
    state
    AL
    CT
    Any clues?
    Thanks,
    Solomon YAkobson.

    Hello,
    Do you have the same issue?

  • Cfselect default value containing comma does not work

    I have a drop down list of Countries stored in a table as
    defined by UPS. These are used to calculate shipping charges.
    When a customer record is brought up and their country is
    "Ireland, Republic Of", the country displayed ends up being the
    first country in the list, which is Albania. Of course, when the
    user saves the record, they did not intentionally change the
    country, Albania is their new country. So I did not know there was
    a city of Dublin in Albania.
    Does the reporting of bugs feature on Adobe work? I posted
    this there a couple of weeks ago and did not hear anything.

    It just sort of seems to defeat the purpose of typedefs when you cannot use many of the property nodes.
    To me the purpose of typedefs is to make it easier to add / remove controls without having to replace all the clusters.
    On reading http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/1b04fd6a11e6f17286256c6300588bfa?OpenDocument
    carefully, the key point is
    "The only properties available for a strict type definition control are those that affect the appearance of the control such as Visible, Disabled, Key Focus, Blinking, Position, and Bounds."
    It is also annoying that the properties that are not available can still be used with no effect, without any compile error / warnings, runtime errors etc...
    So I modified the set VI by wirin
    g a property node to the strict type def reference. I used the control references propetry to get an array of references to the controls in the cluster. I then indexed the array to get to one of the boolean controls and set the value signaling property on the reference to the boolean button. This did generate an event.
    Dispite what it says above the value signaling property did update the values on the type def controls on the front panel without generating an event. I also tried the value property and that updated the value of the type def control.

  • Wired Keyboard - Comma Key not working

    I have the older model keyboard that came with my system and my comma key suddenly isn't working. Is there any fix to this? I've popped the key off - cleaned it - tested the little button inside using a pencil tip to press it down - restarted my computer - and nothing. Still doesn't work. All other keys work fine.
    Any thoughts on how I can fix this problem or do I have to purchase a whole new keyboard? BTW - there's no Apple Store within 100 miles to take it in and I can't ship it in for repair (have to have it for work). Any help or ideas??

    Keyboards as recent as yours tend to have a large rubber mat that provides the key "feel" and spring-back. The key "switches" are all printed on a circuit-board-like layer inside the keyboard, and there is no such thing as replacing a keyswitch.
    I think your most practical option is to obtain a spare keyboard and then send yours for repair. When it comes back, you will have a spare in case of emergency.
    Because new Macs come with a keyboard, and some users insist on a different keyboard, there is some traffic in new/lightly-used keyboards on eBay and similar venues. Really old keyboards (like ADB keyboards) go for US$10 plus about that much again for shipping. I have no idea what the market in recent keyboards is like.

  • Commit is not working in web service.

    H All,
    I am calling a customised FM in my web service (URL) in that FM i am crating a BP with BAPI_BUPA_CREATE_DATA2 it returns
    the BP nuMber. After that i am calling BAPI_TRANSACTION_COMMIT with WAIT = 'X'.But at some instance that BP does not commit in database.
    Several users are calling my Customized FM at the same time.
    Any help please.
    Thanks ,
    Ruchi
    Edited by: Ruchi Tiwari on Jan 13, 2012 12:12 PM

    Hi Ruchi, maybe the problem is that the service user that excecutes really your FM (RFC) don´t have SAP_ALL or SAP_ALL.
    Good Luck!
    Edited by: Isaac Mena on Jan 14, 2012 9:08 AM

  • Commit not working on web

    Using Forms 6i Client/Server & on App Server
    I have a form that runs in both client/server and on the app server.
    In C/S it commits with no problems. On the App Server the commit does not work. No errors are produced. There is no ddl_commit in the form, just a straightforward 'commit'.
    Can anyone shed any light on this mystery?

    After further investigation, I have managed to replicate the problem in the Client/Server environment by changing the run time compatability mode in the form level properties to 5.0. It seems that 5.0 behavior is carried out by default when the form is run on the Application Server.
    The problem was to do with a non display item having it's required property set to YES but not being populated. On the web, this item was being validated where as client server (where the runtime compatability mode property was 4.5 in the form), it isn't.
    The form on-error trigger prevented the error from being displayed but once I got around that, I was able to track down the errant item! I guess the answer is to set the run time compatability mode to 5.0 when moving to the App Server to ensure consistent behavior with the Client/Server Environment.
    The property and the differences between 4.5 and 5.0 are documented in the Forms Help system.

  • Perform on commit

    Hi,
    can you show me an example of "perform on commit" with variables.

    Hi,
    PERFORM ON COMMIT routines are not executed in the dialog module.
    You must ensure that any subroutines called using ON COMMIT can be delayed until the next COMMIT WORK in the calling program. Remember that the global data of the dialog module is destroyed along with the internal session when control returns to the calling program. Consequently, subroutines called using PERFORM ON COMMIT must not use this global data.
    The statement PERFORM ON COMMIT calls a subroutine in the dialog work process. However, it is not executed until the system reaches the next COMMIT WORK statement. Here, as well, the ABAP statement COMMIT WORK defines the end of the SAP LUW, since all statements in a subroutine called with PERFORM ON COMMIT that make database changes are executed in the
    database LUW of the corresponding dialog step.
    The advantage of this bundling technique against CALL FUNCTION... IN UPDATE TASK is better performance, since the update data does not have to be written into an extra table. The disadvantage, however, is that you cannot pass parameters in a PERFORM... ON COMMIT statement. Data is passed using global variables and ABAP memory. There is a considerable danger of data inconsistency when you use this method to pass data.
    You can also put the CALL FUNCTION IN UPDATE TASK into a subroutine and call the subroutine with:
    <b>PERFORM SUBROUT ON COMMIT.</b>
    If you choose this method, the subroutine is executed at the commit. Thus the request to run the function in the update task is also logged during commit processing. As a result, the parameter values logged with the request are those current at the time of the commit.
    Ex.
    a = 1.
    PERFORM F ON COMMIT.
    a = 2.
    PERFORM F ON COMMIT.
    a = 3.
    COMMIT WORK.
    FORM f.
    CALL FUNCTION 'UPD_FM' IN UPDATE TASK EXPORTING PAR = A.
    ENDFORM.
    In this example, the function module UPD_FM is carried out with the value 3 in PAR. The update task executes the function module only once, despite the two PERFORM ON COMMIT statements. This is because a given function module, logged with the same parameter values, can never be executed more than once in the update task. The subroutine itself, containing the function module call, may not have parameters.
    Regards,
    Bhaskar

  • Buttons not working in the upgraded (ERP 2005) PM BSP

    Hi...
    We have recently upgraded our system from ERP2004 to ERP2005. We have made the SAPU re-conciliation. When we tested our entire BSP in portal, some of the buttons that used to work before upgrade are not working right now. Some of them are:
        1. the CREATE button that allows us to create performance plans/appraisals is not working in employee login (ESS)
        2. Start Evaluation button that changes the appraisal from Inreview to Inprocess status is also not working.
             When I did a code compare, the upgraded version of HRHAP_DOCUMENT_CHANGE_STATUS has got a new function module called HRHAP_0DOC_DET_NEW_STATUS which is used to Determine New Status depending on BUTTON_ID. But in the old version this is not there, instead a perform does the same function. Does this help?
    Can  anyone tell me why these are not working? Any information that you could provide will be really useful.
    Thanks,
    Aruna Nivetha.R

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • DBsequence not working in ADF app

    HI All
    I am using Jdeveloper 11g release 2 (11.1.2.3.0) and Oracle DB.
    I have created an entity object and set the type of the filed as DBseequence but forgot to insert the sequence+trigger in the database for the table from which it was created.
    I have also created a view object for this EO, and through the app module have used it i a page.
    Clearly the submit and/or commit were not working because of the missing seq+trigger.
    I created the seq + trigger on the db, everything works fine if I insert a record from the db, and the id is generated as it should.
    When i try to do the same from ADF (tried from the page and from the model tester) i get the following error : (oracle.jbo.AttrValException) JBO-27014: Attribute Invoiceid in Invoices is required.
    It seems that the fact that there is a sequence to generate the id is not recognized.
    Any ideas?
    Thank you

    Or you use the groovy approach which doesn't need the db trigger and is easy to implement.
    Check out http://tompeez.wordpress.com/2011/09/02/using-groovy-expression-to-set-a-primary-key-with-a-sequence-number/
    Timo

  • Nested perform on commit error

    hi all,happy new year 2006
    in my custom transaction upon save,
    iam calling a Func module in update task passing all the internal tables which contain the update data.
    inside this FM iam doing table updates without commit and also calling change document funcs ( open,single/multiple case/close) to update the CDHDR and CDPOS tables.
    iam also calling BAPI_SALESORDER_CHANGE inside this update task FM. after the call iam calling BAPI_TRANSACTION_COMMIT.
    Iam getting an update task termination message saying that there are nested perform on commit statements happenening in some some SAP prog call and therefore it causes a dump. i have seen that the fm 'CHANGEDOCUMENT_CLOSE' calls a 'perform on commit'.
    but not able to figure out where exactly is the problem.
    any suggestions.
    thanks a lot.

    Hi KP!
    I'm sure you can't call BAPI_TRANSACTION_COMMIT in an update task - there a commit is a forbidden statement.
    I had a short look at CHANGEDOCUMENT_CLOSE:
    *    don't call this form on COMMIT when you are already in a form on
    *    commit
        IF sy-oncom = 'P'.
          PERFORM swe_event_create_changedocumnt.
        ELSE.
          PERFORM swe_event_create_changedocumnt ON COMMIT.
        ENDIF.
    At least here (and on release 640, ERP 5.0) a different coding for update tasks is executed.
    Do you have a shortdump, where you can check exact place of the nested call? Or is this a generation error -> again try to check exact place.
    Regards,
    Christian

Maybe you are looking for