Commit Work executed

When debugging a report program when i go step by step many a times a message is shown ' COMMIT WORK EXECUTED'. In what  cases and why is this message displayed.

Hi,
This is a rather strange occurence. And I have experienced it too.
In my search for an answer, i stumbled upon this thread.
It has a lot of information on it, and some conclusive answers.
Hope this helps you out.
http://www.sapfans.com/forums/viewtopic.php?t=169464&highlight=&sid=418f3ccc51dca0f3cc982e5d04107cb7
Pls reward if useful.

Similar Messages

  • How to execute Update Module FM after final commit work for a T-code.

    Hello Folks,
    I have a bit complex issue with my current object.
    We have modified MM41/MM42 transactions and added a subscreen to fulfill the requirement.
    We have designed the subscreen and embedded the same to MM41/MM42 through SPRO configuration.
    Now for update business logic,i am trying to execute one Function module(Update Module) in update Task...so that it will be executed once after the final commit work will be done for MM41/MM42.
    But its not executing.
    To fulfill my requirement i need to execute the FM only after Final Commit work for MM41/MM42.
    Please suggest in this regard.
    Even i can see few BADI's which are triggering through MM01/MM02 but not through MM41/MM42.
    BADI_ARTICLE_REF_RT
    BADI_MATERIAL_CHECK
    BADI_MAT_F_SPEC_SEL
    Code with which i am trying is given below.
    After PAI event of the subscreen---
    1:        MODULE USER_COMMAND_9001.
    2:       MODULE user_command_9001 INPUT.
                        PERFORM sub_save_mara ON COMMIT.
              ENDMODULE.
    3:       FORM sub_save_mara.
                         CALL FUNCTION 'ZMMUPDATE_MARA_APPEND_STRUCT' "IN UPDATE TASK
                                        EXPORTING
                                                 materialno = gv_matnr
                                                 appendmara = ty_zzmara.
             ENDFORM.                    "sub_save_mara
    4:                FUNCTION zmmupdate_mara_append_struct.
                      ""Update Function Module:
                       ""Local Interface:
                      *"  IMPORTING
                   *"     VALUE(MATERIALNO) TYPE  MATNR
                   *"     VALUE(APPENDMARA) TYPE  ZZMARA
    Data Declaration for Local use
      DATA : w_mara TYPE mara.
    Selecting the latest values for the material.
      SELECT SINGLE * FROM mara INTO w_mara WHERE matnr = materialno.
      IF sy-subrc = 0.
      Move the ZZMARA values to structure MARA
        MOVE-CORRESPONDING appendmara TO w_mara.
      Update the values in table MARA.
        MODIFY mara FROM w_mara.
      ENDIF.
    ENDFUNCTION.
    Kindly suggest.Thanks in advance.
    Regards
    Ansumesh

    Hi..
    The code given by me will work fine provided the Final commit should happen.
    Because to execute FM with update task,final commit work should happen which is mandatory and after that it will call the update task.
    In my case final commit work was not happeneing because..SAP standard program was not able to detect wether there is any change in my sub-screen or not as the standard program & my custom program,subscreens are different.
    As it was not able to detect the change,so final commit was not happening and hence update task also.
    To provide the reference of change in my subscreen to standard program ,i set a flag as per the change in the subscreen
    And exported the same to memory.
    Then Implemented one enhacement spot in MATERIAL_CHANGE_CHECK_RETAIL Fm where i have Imported the flag value.
    Based on my custom flag value,i have set one standard flag FLG_AENDERUNG_GES which tells SAP standard program for MM42 wether any change has happened or not.
    The above solved my purpose.
    Regards
    Ansumesh

  • Does Update function module gets executed after Commit Work?

    Hi Gurus,
    I have a BAPI with a Commit work. Does update function module V1 , V2 - i need mainly about the sequence of V2, gets executed after Commit work or before Commit work.
    Thanks

    Pl refer to SAP help on the same as follows.
    https://help.sap.com/saphelp_nw04/helpdata/en/e5/de86e135cd11d3acb00000e83539c3/content.htm
    Regards,
    Naveen Vishal

  • Executing subroutine after commit work, not on commit work

    Hi All,
    I want to execute my sub-routine after commit work, not on commit work.
    If any one have answer please mail me at  [email protected]

    Not sure if this helps you but this event is fired, when commit work is fired.
    Christian
    report test.
    class lcl_event_handler definition.
    public section.
        class-methods: on_commit_finished
             for event COMMIT_FINISHED
               of CL_OS_TRANSACTION_END_NOTIFIER.
    endclass.
    set handler lcl_event_handler=>on_commit_finished.
    commit work.
    class lcl_event_handler implementation.
    method on_commit_finished.
      break-point.
    endmethod.
    endclass.
    But check also oss note 704577

  • How to count " How many times the ' commit work ' Statement is executed.

    Hi all sap Champions,
    One of the client requirement, That is
    How to count " How many times the ' commit work ' Statement is executed.
    It's urgent.
    Please can anybody help me for this.
    Thanks
    Basu

    hi,
    when report try like this.
    declare a variable as
    data: counter type i value 0.
    COMMIT.
    counter = counter + 1.
    write:/10 counter 'NO. OF TIMES COMMIT WORKED'.

  • SO_OBJECT_SEND function does not work without an explicit COMMIT WORK

    Hi,
    We have used this Function module (SO_OBJECT_SEND) inside a custom BAdI Implementation , which sends e-mails when some of the fields inside an infotype are modified using transaction PA30 (HR-Maintain master data).
    After the system was upgraded to BASIS version 7.0 , as per SAP note 489286 ,the calling program of the send interface must execute an explicit COMMIT WORK.But inside an update , COMMIT WORK should not be executed.
    So we did not execute explicit COMMIT WORK  inside BAdI.
    But after this upgrade, the emails are not sent out of R/3 , and the status message 672 (Still no entry in queue) is displayed on the program 'Administration of External Send Processes' - Transaction SOST.
    Can anyone suggest a solution , if you have used this Function module (SO_OBJECT_SEND) inside a BAdI during update?
    Thanks,
    Kiran

    Hi Kiran,
    create one remote enable function module, write your required logic in this remote enableD function module.
    Now call this function module in Badi as below,
    eg. suppose Remote enable function module created is 'ztest'.
    then,
    In BadI write logic,
    CALL FUNCTION 'ZTEST' SEPARATE TASK 'T'
    EXPORTING ......
    IMPORTING.......
    also inside this function module
    call function 'SO_OBJECT_SEND' separate task 'T'
    exporting....
    importing....
    committwork.
    after doing this what will happen is your mail logic will be in saperate session, so your current program will pass the data and execution of this RFC and Program having BADI, will be in two saperate sessions, so although you are using committ work standred program will not get affected.
    This will improve performance too...:)
    Please Give points if it is going to help you.

  • COMMIT WORK AND WAIT does not work

    Hello,
    I know this question has been asked many times in various forums. But the fact remains that there is no definitive solution found for this problem which does not involve WAIT UP TO n SECONDS or SELECT until the DB commit has been completed.
    We have an IDoc based inbound interface for creating Project Defintion and WBS Elements. Here is how the code looks like in the processing function module:
    * Create Project Defintion
    CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
      EXPORTING
        project_definition_stru = lwa_proj_bapi
      TABLES
        e_message_table         = lt_messages.
    * If no errors
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
    * Other code
    * Create WBS Element (BAPI could not be used because not all fields are allowed to be updated)
    CALL TRANSACTION 'CJ11'
    Now while creating the WBS Element, transaction CJ11 returns an error that 'Project does not exist'. This is not correct because the same Project was successfully created in the previous step.
    It is clear that the problem is because of the delay in database commits.
    This happens only with few IDoc's and not all of them. And of course, the problem does not occur if I induce WAIT UP TO n SECONDS after BAPI_TRANSACTION_COMMIT. But this is not the best practice.
    The question is why BAPI_TRANSACTION_COMMIT does not wait even though we are forcing it to?
    Thanks in advance
    Sagar Acharya

    Suhas wrote:
    But i am baffled that although the COMMIT has happened earlier why is the data not updated in the DB ?
    Well, it's just a [COMMIT WORK|http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm] and not a [COMMIT WORK AND WAIT|http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm#@@AND%20WAIT@@COMMIT%20WORK@@]. Let me quote the ABAP help:
    If you do not specify the addition AND WAIT, the program does not wait until the update work process has executed it (asynchronous updating), but instead is resumed immediately after COMMIT WORK. However, if the addition AND WAIT is specified, program processing after COMMIT WORK will not continue until the update work process has executed the high-priority update function modules (synchronous updating).
    @Sagar Acharya: Well, I thought you were looking for an explanation why sometimes the project isn't created (and you only had posted coding that showed details for step 1) - I'm trying hard, but my mind reading skills are rather limited yet...
    So let's think about step 2 and 3: I assume that you made sure that your coding always references the correct WBS element. Again the commit (without wait) is done already via CJ11 (e.g. check form BUCHEN in SAPLCJWB). I'd expect though that the synchronous update mode should make this work. Since it doesn't, I'd try local update mode, which is what I'd choose in your case anyhow.
    Apart from that my mind is pretty blank, except for the usual silly things to check. E.g. are you sure you're coding is correct, you are handling all return messages and log them for inspection later (e.g. application log), you are certain that the WBS was actually created by the same IDoc that throws the fit (and IDoc was not reprocessed), etc.
    So maybe somebody else has better ideas...

  • Commit work statement creating problem in CALL TRANSACTION

    Hi Friends,
    we are facing a problem where we need to call a standard program from a  Zprogram.
    we have tried the following ways.
    1. Using SUBMIT statement , we are sending the parameters to the standard program, but when the standard program gives a  
        dump our program cannot process further records. we are calling the submit statment in a loop. As because the standard
        program is giving dump our program is not able to process the next record in the loop and this should not be the case.
        To avoid this we have used the second method.
    2. we used a CALL transaction, we have created a Tcode for the standard program and called this transaction in the calling
        program. We are passing the parameters for the  standard program via BDC table. this works fine even when  the standard
        program gives a dump but when ever the control   comes across a Commit work statement the the control comes back to our
       calling program with out executing the rest of the   statments after the commit.
    now our concern is even though there is an commit work statement , statements after the commit work should also get executed in call transaction. Is thee any way?
    Regards,
    Sravan

    Hi All,
    I got the solution
    DATA: ctu_parameters TYPE ctu_params.
    ctu_parameters-dismode = 'E'.
    ctu_parameters-updmode = 'A'.
    ctu_parameters-racommit = 'X'. "No abortion by COMMIT WORK
    CALL TRANSACTION USING itab_bdcdata OPTIONS FROM ctu_parameters.
    the above code will work even if there is an commit work . This might help some others.

  • Continue behind COMMIT WORK.

    Hi all,
    I am facing problem with COMMIT WORK in my STANDARD SAP modification for executing ABAP Proxy. The problem is that the program doesnt continue after COMMIT WORK (messages, screens), but return to the initial screen.
    Is there any way to commit data sent via proxy and then continue (with next proxy calling, processing screens etc)?
    Thank you very much.
    Frantisek Holas, CZ

    Hi,
    I solved the problem myself.
    http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4e3a79e11d1950f0000e82de14a/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4e3a79e11d1950f0000e82de14a/frameset.htm
    The point of solve the problem is place certain statements following with commit into standalone report, that you can call with SUBMIT command, passing value from ABAP memory or via select-option, as explained in documentation for SUBMIT STATEMENT.
    The trick of this solution is that calling new report via submit creates new SAP LUW, which can contain COMMIT WORK, that commit ONLY SAP LUW of the called report. When the report finishes and you return to the calling report/fm/trasaction/..., the SAP LUW of the calling rept/fm/transaction/... continue not affected by this COMMIT.
    It helped me to solve my problem.

  • ABAP Dump on "COMMIT WORK"

    The abap dump is occured in function module when the COMMIT WORK statement is executed.
    This function module updates a custom table.
    When creating a invoice through VF01 transaction this abap dump is occured.
    But for the next time the invoice is created successfully.
    What is the reason behind this.

    Hi,
      Refer
    https://forums.sdn.sap.com/click.jspa?searchID=11053241&messageID=5085300
    Regards
    Kiran Sure

  • COMMIT WORK - performance problem

    Dear Fellow SDNers,
    I seek your help on the following problem:
    Scenario : Inbound idoc which updates an Outbound delivery with Picked quantity, posts the goods issue and then creates billing document
    Approach : I am using the function module SD_DELIVERY_UPDATE_PICKING to update the delivery from the idoc data and to post goods issue. Thereafter, i use BAPI_BILLINGDOC_CREATEMULTIPLE to create the billing document. Before calling this BAPI, I use a COMMIT WORK statement to update the relevant tables so as to enable invoice creation properly.
    Problem: The COMMIT WORK statement takes a lot of time to execute (I have no update tasks that could lead to this), so much that the idoc (probably) has a timeout and ends up in status 64. As a result, the succeeding part of the code (after COMMIT WORK) is not executed and the billing document is not created.
    When I debug this, the COMMIT WORK statement leads to a strange screen (which looks like a blank report output screen, with its title as "UPDATE CONTROL". However (of course), there is no timeout while debugging and the billing document is successfully created.
    Could anyone provide some pointers to solve this problem?
    regards,
    Priyank

    i have a custom function module Y_IDOC_INPUT_WMSPICK001 which is responsible for idoc inbound processing. SAP PI sends the inbound data to ECC and once this is done, this function module is executed.
    This FM has the following code sequence inside it...
    1) Call the FM SD_DELIVERY_UPDATE_PICKING
    2) COMMIT WORK AND WAIT.
    3) Call the BAPI_BILLINGDOC_CREATEMULTIPLE
    Step1 is successfully executed,  the step 2 takes a long time, and after that, the step 3 is not executed at all and the idoc ends up with a yellow light (status 64).
    hope it clarifies what I am doing
    regards,
    Priyank

  • Commit work in FQevents in FICA(PERFORM commitroutine ON COMMIT )

    Hello Experts,
    i am trying to create an event to trigger a workflow using function module swe_event_create.
    i am doing this in an FICA event 5500 after triggering this workflow i need to stop the further processing so i am using Error message statement.
    when i am calling swe_event_create without commit work the event is not getting triggered .
    when i checked the documentation of this event it was written that
    To ensure the consistency of the system, note that you must not use the following language elements in events:
    COMMIT WORK
    ROLLBACK WORK
    CALL FUNCTION 'DEQUEUE ALL'
    Deletion of locks that you have not set yourself.
    If you update additional data in an event and use the construction PERFORM commitroutine ON COMMIT to do this, note that:
    At the end of the commitroutine, all internal tables from which data was updated must be initialized again to prevent a duplicate update in the next call.
    A PERFORM rollbacktroutine ON ROLLBACK must also be called. In the rollbackroutine initialize the same data that is initialized at the end of the commitroutine.
    If you want to carry out checks in an event, when you issue messages, note that background processing of the process terminates with warning messages. You should therefore avoid issuing warning messages if possible. However, you should definitely issue warning messages if the value of SY-BATCH is initial.
    how i can use PERFORM commitroutine ON COMMIT could you please paste the code for this
    also plz tell me
    why my event is not getting generated without commit work . do we have any better way to do it

    Hi Anit,
      The FM SWE_EVENT_CREATE does its job, only when 'COMMIT WORK' is executed, after it. Now, as per the general programming guidelines (quoted in your question), you can't write COMMIT WORK in your code. You shouldn't, because it would write half baked document into database. Something that's undesirable. The workaround prescribed in the event documentation (again, as quoted in your question) allows to achieve the goal in following manner-
    1. Do all calculations in your event and put the final values - that are necessary for the workflow - in global variables. Refer to the ABAP documentation for PERFORM ... ON COMMIT for choosing global variables over parameter passing.
    2. Once that's done, make the call to the FM, as given below-
    PERFORM start_wf ON COMMIT.   "Within the FM implementing the event 5500.
    *&      Form  start_wf
    *       The form routine to initiate the workflow
    FORM start_wf.
      CALL FUNCTION 'SWE_EVENT_CREATE'
        EXPORTING
          objtype           = objtype
          objkey            = objkey
          event             = event
        TABLES
          event_container   = event_container
        EXCEPTIONS
          objtype_not_found = 1
          OTHERS            = 2.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
      CLEAR: objtype.
      CLEAR: objkey.
      CLEAR: event.
      CLEAR: event_container.
      "And all other global variables that are used in your call for this FM
    ENDFORM.                    "start_wf
    3. Note that you need to clean up the global variable set up in step 1 (also mentioned in the event documentation) . It is to ensure that some other call to the same FM doesn't use those values.
    You needn't issue a COMMIT WORK statement anywhere in your code written in event 5500 implementation. The standard FMs, that update the SAP tables with document information have COMMIT WORK in them. As you have registered the FM 'start_wf' by PERFORM ... ON COMMIT, it would be executed along with the database update triggered by standard FM.

  • BDC commit work issue.

    Hi all,
    Im facing a issue in BDC:
    In a loop there is a select query called and if sy-subrc = 0 the call transaction using mode N is called in the next step.
    first time if the sy-subrc is ne 0 then call transaction is done which updates( considered as new entry )
    the table used in the select query.
    when the loop executes the second time the sy-subrc is still 4 instead of 0( previous data is not updated in DB ).
    So after all the execution only the last record exists in the transaction,
    that is the table control index is always 1 due to the select query failure.
    Here the problem is when using mode N, when mode A is used its working fine.
    The data is not getting updated in db in first loop cycle, so the select query in second loop cycle fails.
    The select query gets executed for the same material no's.
    I have also tried with explicit commit and synchrounous update is used
    Thanks,
    Keshav

    Hi Suhas,
    This applies when we open a cursor for select, use fetch to get the data. Ater the fetch if we commit, then it closes all the open cursors. So next fetch on the previously opened cursor will lead to dump.
    Perfect example could be.
    SELECT......
    Do processing.
    COMMIT WORK.
    ENDSELECT.
    Keshav,
    I beleive you are not using SELECT ENDSELECT in your case. If it is SELECT SIGLE/SELECT INTO TABLE,  OPEN, FETCH and CLOSE CURSOR operations happens at the back end during the select query execution. ( We can see ST05 trace for this). So as per my understanding COMMIT after the CALL TRANSACTION shouldn't cause any problem.
    Please correct if i am wrong any where.
    Thanks,
    Vinod.

  • Commit work

    Hi all,
    Please help me in this issue,
    When we using Update ABAP statement what is the need of using again a commit statement if we dont use commit statement.
    Thanks & Regards
    Reddy

    Hello Reddy,
    COMMIT is used when you code directly in ABAP and make changes in the database and want to reflect in the database immediately.
    When you perform COMMIT , all the LUW s work will be reflected to the database,
    COMMIT WORK is the key word to make the database change. And whereas ROLLBACK is the opposite to commit work,
    This statement will apply any outstanding database updates and wait until they have actually been put on the database before proceeding to the next statement.
    An ordinary commit work will initiate the process to update the databases in a separate task and will press on in your abap.
    COMMIT WORK: ( Asynchronous)
    Your program does not wait for any acknowledgement. it just start executing the next statment after COMMIT WORK.
    <u><b>For your kind reference please check the below link</b></u>
    <b>http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3b64358411d1829f0000e
    829fbfe/content.htm</b>
    <b>
    Reward points for all useful answers....
    Cheers !
    Moqeeth.</b>

  • COMMIT WORK: Timing of DB commit and update modules

    Hi all,
    Does anyone know categorically the order of starting the asynchronous update modules (CALL FUNCTION ... IN UPDATE TASK) and the database commit, when a COMMIT WORK is done?
    Does COMMIT WORK:
    - Do PERFORM ... ON COMMIT
    - Start asynchronous update processing
    - Do database commit
    Or does it:
    - Do PERFORM ... ON COMMIT
    - Do database commit
    - Start asynchronous update processing
    My reason for asking is some code (not written by me!) that essentially raises CREATED workflow events in the update task, but performs the corresponding database inserts in the current work process.
    It looks like we are getting the situation that sometimes the table entries do not exist when the update modules exist, which in turn suggests to me that perhaps the asynchronous update modules are started just before the database commit that is done when a COMMIT WORK statement is executed.
    Cheers,
    Scott

    Christian,
    Before the update module execution.  Here's some code to highlight and let's assume it runs in a dialog process. And to everyone else, yes, I know this is a poor way to implement updates!
    INSERT INTO zmyobject VALUES lv_myobject.
    CALL FUNCTION 'SWE_EVENT_CREATE_IN_UPD_TASK'
      IN UPDATE TASK
      EXPORTING
        objtype = 'ZMYOBJECT'
        objkey  =  lv_myobject-key
        event   = 'CREATED'.
    COMMIT WORK.
    So I meant to ask the question of whether we could guarantee that the new record in table ZMYOBJECT would be committed to the database <i>before</i> the update module was executed. It really is a theoretical question though it did not begin as one.
    I do not believe the answer to this problem can be determined by debugging, because given that these two steps occur so close in time to one another, by the time the update module appeared in the debugger, it would be unrealistic to expect that the DB insert performed in the dialog process had not been committed yet.
    I might be wrong, but I really don't think you're going to find ABAP logic embedded in SAPMSSY0 or elsewhere that invokes the update modules or performs a DB commit. Rather, it is my suspicion that the COMMIT WORK statement works like this:
    - Drop into the kernel
    - Does a callback to SAPMSSY0 to execute form %_BEFORE_COMMIT to raise a static OO event
    - Does a callback to SAPMSSY0 to execute form %_COMMIT and thereby process any PERFORM ... ON COMMIT
    - Does a database commit
    - Does a callback to SAPMSSY0 to execute form %_AFTER_COMMIT to raise another static OO event
    Further, I believe that it is the database commit that now makes the queued CALL FUNCTION ... IN UPDATE TASK now visible in VBLOG to other processes.
    Lastly, and this is of course wild speculation, I suspect that it is an update process running somewhere else that detects the new entries in VBLOG and grabs them for processing.
    So, I'm kind of changing my position from earlier to state that I believe the COMMIT WORK statement does not directly trigger the update modules at all, rather it just does the database commit and this makes visible the pending update modules to the dispatcher / update work processes which probably grab the update LUW's on a first come first served basis.
    At least, that is how I would design it :-).
    Cheers,
    Scott

Maybe you are looking for

  • DW Pop-Up / Drop-Down Menu Problems

    Hi. I am new to this forum and I am not a pro web designer (but am proficient with web / graphic design software), so bear with me... I am using Dreamweaver MX and Fireworks MX (not the 2004 versions) to re-design a new website for my photography biz

  • Problem since upgrade to 9.4.1

    Since the last upgrade, I cannot open a pdf file from the web. I get the error message 'Cannot find Acrobat External Window Handler'. I can still download the file. Anyone got any ideas? David

  • My iPhone doesn't load!

    My iPhone is loading forever!! I tried to turn it off and it doesn't work!! What should I do, wait till the batterie runs out and then turn it on?

  • HT201272 I purchased an album and parts of some songs are not there. Tried redownloading and get error -1202. Any idea what this means and how to fix it?

    I purchased an album and am missing parts of songs. Tried to re-download, but itune store is giving me error -1202. I also tried to transfer from iphone, but nothing changed. Any ideas on what else I can try?

  • Safari can't open https

    Hi, I need to acces several https cites, but the problem is that safari can't do this. I'm using the latest version of safari 5.0.1, there are no extension installed (except for Adblock), MacOs 10.5.8 I'm connected to the interned via wi-fi router, a