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

Similar Messages

  • Since 2012 I have Photoshop Elements always worked without any problem, however now the language is suddenly German how can this be changed, removed the program and re-installed, not working. Program is downloaded and updated via the apple app store?

    Since 2012 I have Photoshop Elements always worked without any problem, however now the language is suddenly German how can this be changed, removed the program and re-installed, not working. Program is downloaded and updated via the apple app store?

    I've done some research on the SQLite database. Whenever Aperture hangs up (like during auto-stack or opening the filter hud) there are thousands of SQLite queries happening. These SQLite queries cause massive file I/O because the database is stored on the disk as 1kb pages. However, the OS is caching the database file; mine's only 12MB. I'm trying to track down some performance numbers for SQLite on osx but having trouble.
    It's starting to look like most of the speed problems are in the libraries that Aperture uses instead of the actual Aperture code. Of course, that doesn't completely let the developers off the hook since they choose to use them in the first place.
    Oh, and if anyone is curious, the database is completely open to queries using the command line sqlite3 tool. Here's the language reference http://www.sqlite.org/lang.html
    Hmm, just found this. Looks like someone else has been playing around in the db http://www.majid.info/mylos/stories/2005/12/01/apertureInternals.html
    Dual 1.8 G5   Mac OS X (10.4.3)   1GB RAM, Sony Artisan Monitor, Sony HC-1 HD Camera

  • Do CIF BAdIs issue implicit COMMIT WORKS (for FM's called "in update task")

    I am calling the CIF BAdI:
    /SAPAPO/TR_TRANSFER.
    In the PUSH_LANE_DATA method of this BAdI, I want to call a function module "in update task".
    To trigger the actual execution of this function module, do I have to code an explicit COMMIT WORK in the BAdI or will SAP automatically generate a COMMIT WORK when the BAdI ends?

    Hope you have called the FM correctly with the additional importing parameter , also check if your FM is RFC enabled then check the "pass by value" option.

  • Gradebook website will not work on Safari after restore and update.

    Gradebook (via Education Solutions Development, Inc) will no longer permit me to log in. I was at the Apple store today to wipe my Macbook clean and they manually restored all of my files. They also updated my Macbook to OS X 10.9.5. The site worked fine prior to all of this. It loads normally, allowing me to enter my username and password. Once I hit "Enter" or click "Submit" however, the password disappears and I am left on the same log-in page. It does not go anywhere. All other websites are working fine. I tried downloading different browsers to access the site, but Gradebook is not compatible with those browsers. I really need to be able to access this site at home.

    I have this exact issue as well. I'm very confused! If this doesn't get resolved here I think we might have to go to the Genius bar. What a pain! To circumvent it for now, I've downloaded the Chrome app because it works fine there.

  • I need help working out my apple ids and updates

    Hey guys I use 2 apple ids on my iPad one of which is for free apps and does not have a credit card number the other one for paid apps which has a credit card number. I also never update apps unless I really need to. This way I never really used the update all function. Now, when I visit the app store I have 122 apps needing updates. I cannot update all as they have been purchased from different apple ids.Recently I acquired another problem.Upon logging out from my free Id
    And logging into the paid one to buy a new app(F1 2011) when I went back (to the free id) after each purchase it tells me that some apps were unable to be purchased. The exact error it shows is " unable to purchase F1 2011 and 5 other items ". Can someone help me out with this as I even want to update all of my apps. I have also got another iPad logged into the same free apple Id and purchase apps on that to.

    What happens when you try to log in? If there is an error message,
    what is the exact complete wording of that message?

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

  • Update was terminated when we do commit work twice in short time

    Hi Experts,
                i have one Data bas update problem. My requirement is to create contracts in CRM with new item category(suppose ZSFT) than what is determined(ZSRT). i am using CRM_ORDER_MAINTAIN FM to create contracts after that i am calling CRM_ORDER_SAVE to save transaction then COMMIT WORK key word to commit in data base. Since transaction is created with Determined item category(ZSRT) i  am calling change transaction bapi  BAPI_BUSPROCESSND_CHANGEMULTI to change item category after that BAPI_BUSPROCESSND_SAVE to save transaction and BAPI_TRANSACTION_COMMIT to commit the work. but second commit is not happening instead error message "Update was terminated" recieved from author "XXXX". when i created test program with BAPIs to change already created contracts to change item category it is working fine.
    Any body has any clue.
    Thanks in advance
    Siva

    Hello Siva, Is your problem solved ? I have the same error and unable to update the partner info on Service confirmation.
    Here is what I'm trying to acheive.. I'm working on an interface that creates a docflow and creates service confirmation against existing service order. In the confimation file when I have new ZAPP((partner function ZAPP) I need to delete ZAPP that gets copied over from service order into the confirmation in docflow. Right now, in my first CRM_ORDER_MAINTAIN call I have one entry for new ZAPP  and I have It_docflow populated. This creates two ZAPPs on the confirmation. I need to delete ZAPP on the confirmation that is copied over from service order.
    Right now I'm reading the confirmation and trying to delete the ZAPP but after my second crm_order_maintain,order save and commit call sequence I'm getting this error update was terminated.
    Experts any help on how to get around this issue would be highly appreciated.
    Thanks

  • COMMIT WORK AND WAIT USE

    Hi Friends,
    what is mean by COMMIT WORK AND WAIT.
    when we use ths syntax...??
    situation pls.
    regards,
    venu.

    Hi,
    To apply the changes made to the runtime objects of persistent classes to the actual persistent objects in the database, execute the COMMIT WORK statement. (Alternatively, use COMMIT WORK AND WAIT or SET UPDATE TASK LOCAL). Unless you are executing an object-oriented transaction from within the Transaction Service, you must include the COMMIT WORK statement explicitly in the program. Otherwise, it is encapsulated in the Transaction Service. (If you explicitly include the COMMIT WORK statement as described here, the t op-level transaction runs in compatibility mode).
    The function of the COMMIT WORK statement is extended when you use it in conjunction with Object Services. Before COMMIT WORK closes the SAP LUW and triggers an update, it calls internal methods of the Persistence Service. These methods bundle the changes made to managed objects of the Persistence Service and pass them to a special update function module using CALL FUNCTION ... IN UPDATE TASK. Thus the Persistence Service works with traditional update methods. The update module is usually registered after any update modules that have already been registered. The update is then triggered and the update task executes the update module in the order in which they were registered.
    After the system executes the COMMIT WORK statement, it sets the attributes of each persistent object in the ABAP program to initial. (That is, it calls the IF_OS_STATE~INVALIDATE method).
    Local Update
    If you want to change managed objects directly, rather than using the update module, you must change the update mode of the implicitly used Transaction Service. That is, the following statements must be executed before the COMMIT WORK statement:
    DATA TM type ref to IF_OS_TRANSACTION_MANAGER.
    DATA T type ref to IF_OS_TRANSACTION.
      TM = CL_OS_SYSTEM=>GET_TRANSACTION_MANAGER( ).
    T = TM->GET_CURRENT_TRANSACTION( ).
    T->SET_MODE_UPDATE( OSCON_DMODE_DIRECT ).
    COMMIT WORK.
    To ensure database consistency, the local update is activated internally using SET UPDATE TASK LOCAL. In such cases, the system raises an exception if there are already update modules registered in the update task. You can only register additional classical update modules after setting the mode. They will then also be updated locally.
    COMMIT
    Basic form
    COMMIT WORK.
    Addition
    ... AND WAIT
    Effect
    Executes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). This means that
    all database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and
    all database locks are released.
    COMMIT WORK also
    calls the subroutines specified by PERFORM ... ON COMMIT ,
    executes asynchronously any update requests (see CALL FUNCTION ... IN UPDATE TASK ) specified in these subroutines or started just before,
    processes the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK ,
    cancels all existing locks (see SAP locking concept ) if no update requests exist,
    closes all open database cursors (see OPEN CURSOR ) and
    resets the time slice counter to 0.
    COMMIT WORK belongs to the Open SQL command set.
    Return code value
    The SY-SUBRC is set to 0.
    Notes
    All subroutines called with PERFORM ... ON COMMIT are processed in the LUW concluded by the COMMIT WORK command. All V1 update requests specified in CALL FUNCTION ... IN UPDATE TASK are also executed in one LUW . When all V1 update requests have been successfully concluded, the V2 update requests ("update with start delayed") are processed, each in one LUW . Parallel to this, the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK are each executed in one LUW per destination.
    COMMIT WORK commands processed within CALL DIALOG processing
    - execute a database commit (see above),
    - close all open database cursors,
    - reset the time slice counter and
    - call the function modules specified by CALL FUNCTION IN
    BACKGROUND TASK in the CALL DIALOG processing.
    However, subroutines and function modules called with PERFORM ... ON COMMIT or CALL FUNCTION ... IN UPDATE TASK in the CALL DIALOG processing are not executed in the calling transaction until a COMMIT WORK occurs.
    Since COMMIT WORK closes all open database cursors, any attempt to continue a SELECT loop after a COMMIT WORK results in a runtime error. For the same reason, a FETCH after a COMMIT WORK on the now closed cursors also produces a runtime error. You must therefore ensure that any open cursors are no longer used after the COMMIT WORK .
    With batch input and CALL TRANSACTION ... USING , COMMIT WORK successfully concludes the processing.
    Addition
    ... AND WAIT
    Effect
    The addition ... AND WAIT makes the program wait until the type V1 updates have been completed.
    The return code value is set as follows:
    SY-SUBRC = 0 The update was successfully performed.
    SY-SUBRC <> 0 The update could not be successfully performed.
    Note
    Runtime errors
    COMMIT_IN_PERFORM_ON_COMMIT : COMMIT WORK is not allowed in a FORM callled with PERFORM ... ON COMMIT .
    COMMIT_IN_POSTING : COMMIT WORK is not allowed in the update task.
    if its useful reward points

  • Differences between commit work and commit work & wait

    Hi people,
    I have a theory question:
    What differences are there between commit work and commit work & wait?
    Thx

    Hi,
    <b>COMMIT WORK:</b>
    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.
    <b>COMMIT WORK and WAIT</b>: (Synchronous)
    Whereas For <b>COMMIT WORK and WAIT</b>, the system waits for the acknowledgment, and then moves to the next statement.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • BCS Email and Commit Work

    I created a small email class that is basically a wrapper around the BCS document classes.  Everything works fine when used in normal programs.  Then, I tried to update some code that was behind a smartform for our order confirmations.  When I tried to test this, I got a dump because of the Commit Work after the send.  The error I got was that I was doing a commit work during an update task, which SAP doesn't like.  Apparently the commit work is needed for the BCS send method.  Does anyone have any ideas I can get around this?  Any idea would be appreciated.
    Thanks in advance,
    Curtis

    What i understand is that your code is getting executed in an Update Work Process & as you've guessed SAP doesn't allow COMMIT WORK to be used inside an Update Task.
    What Gaurav is trying to suggest is may be there are some Implicit Commits later on which might trigger your email.
    Without further inputs it's difficult to analyse.
    BR,
    Suhas

  • Commit Work in MIGO BADI

    Hi,
    Can we use COMMIT WORK statement in BADI?  Hope its not advisable to use it.
    I am using MB_MIGO_BADI~POST_DOCUMENT  to update the GR Number in a custom table.
    Sometimes the GR number is not getting updated in the custom table.
    The modify statement given below does not updates the table sometime.
    IF WA_ZMM_GATE_ENTRY-GR_NUMBER IS INITIAL.
          WA_ZMM_GATE_ENTRY-REFERENCE = GS_EXDATA_HEADER-REFERENCE.
          WA_ZMM_GATE_ENTRY-REFWERKS  = GS_EXDATA_HEADER-WERKS.
          WA_ZMM_GATE_ENTRY-GR_NUMBER = IS_MKPF-MBLNR.
         WA_ZMM_GATE_ENTRY-GR_YEAR   = IS_MKPF-MJAHR.
         MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY .u201Dupdating the Z-table
    ELSE.
          MESSAGE E901(ZMM) WITH GS_EXDATA_HEADER-GATEENTRYNO WA_ZMM_GATE_ENTRY-GR_NUMBER.
        ENDIF.
    Is there any other option to replace the commit work in BADI?
    Plz suggest...
    Regards,
    P.S.Chitra
    Edited by: Chitra Karthik on Aug 10, 2010 11:19 AM

    Hi,
    I don't think even you do commit work it makes much difference and also Commit work also we can eliminate in the code.one more option is selecting the data from table to check whether it is updated or not.
    IF WA_ZMM_GATE_ENTRY-GR_NUMBER IS INITIAL.
          WA_ZMM_GATE_ENTRY-REFERENCE = GS_EXDATA_HEADER-REFERENCE.
          WA_ZMM_GATE_ENTRY-REFWERKS  = GS_EXDATA_HEADER-WERKS.
          WA_ZMM_GATE_ENTRY-GR_NUMBER = IS_MKPF-MBLNR.
         WA_ZMM_GATE_ENTRY-GR_YEAR   = IS_MKPF-MJAHR.
         MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY .u201Dupdating the Z-table
      IF sy-subrc eq 0.
      do.
    select gr_number from ZMM_GATE_ENTRY where reference = GS_EXDATA_HEADER-REFERENCE.
    if sy-subrc eq 0 and if gr_number is not initial. (record Found)-> means updated.
    exit.
    else.
    MODIFY ZMM_GATE_ENTRY FROM WA_ZMM_GATE_ENTRY.
    endif.
    enddo.
    endif.
    ELSE.
          MESSAGE E901(ZMM) WITH GS_EXDATA_HEADER-GATEENTRYNO WA_ZMM_GATE_ENTRY-GR_NUMBER.
        ENDIF.
    Regards,
    Nagaraj

  • Commit work in BAPI

    Hi Experts,
    Why should not use COMMIT WORK in BAPI ? If I give COMMIT WORK in BAPI what is will happen?

    Hi,
    1. Why should not use COMMIT WORK in BAPI
    I suppose you are asking this in context of Z BAPI and not standard BAPI.
    The reason why we should not use is bcos SAP has recommended the design for BAPI in that manner.
    2. If I give COMMIT WORK in BAPI what is will happen?
       Well, as such there is nothing wrong going to happen. (Unless there is some dependent update in database)
    To give you an example.
    Suppose we have to update ZTABLE1 and ZTABLE2- the code for which is in TWO SEPARATE BAPIs.
    Also it is requierd that if one fails, then other should not get updated. Either All or Either None case.
    ZBAPI1 - TABLE1
    ZBAPI2  - TABLE2
    If ZBAPI1 is called and we have written commit work inside that, TABLE1 will get updated.
    Then if there is any error in ZBAPI2, then TABLE2 will not get updated in hence the information will be INCONSISTENT.
    3. Hence, the flow should be like this; (No commit work inside the bapi)
    Main Program.
    Call ZBAPI1.
    Call ZBAPI2.
    COMMIT WORK.
    This will ensure that ALL or NONE happens.
    regards,
    amit m.

  • How Commit works?

    Hello all,
    A question:
    We are having some problem running a JOB. The job is taking too much time to finish. However at end the Commit occurs.
    Let´s suppose:
    We are running a Program (in BACKEND) that updates a table
    The Backend process has not finished (meaning: commit does not happen yet).
    At same time, in a FRONTEND (portal), user is doing changes that affect the same program above.
    The question is:
    At the moment user makes the change(s), can this change occurs in the Backend process which is running?
    Perhaps the question should be:
    “The entry(ies) in the Backend Process is LOCK when program is running? Then in this case if user makes a change in Frontend the change is not gonna happen in the Backend process? “
    Can someone help me out to understand this process.
    Thanks in advance!
    Regards,
    Barbara

    Hello Naimesh
    Many thanks for your replay!!!! I am new in this subject and I have some little questions to be totally clear.
    Following what you said in your last statement:
    <i>“…when you JOB is modifying some data and the commit work doesn't happen yet and somebody changes those data and save...then the data which was entered by user will be overwritten by the job's COMMIT WORK.”</i>
    Questions:
    1) In this case this will happen if the program is running without LOCK object, isn’t it?
    In our situation here: The JOB is take too much time to run
    2) Is that possible that this occurs because the program is running without LOCK object?
    3) Is there anyway to check if the program did run with or without LOCK object?
    Many Thanks,
    Barbara

  • 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 not working in Routine for Transaction because of LUW

    Hi all,
    i have req to send adobe PDF as attachement by email.
    Basically i am calling adobe from output type of VL02n .
    Inside this i can not use commit work because of LUW.Please suggest what should i do.
    so not able to send email in green status.
    i am using below code
    TRY.
          zlcl_send_request->set_document( zlcl_document ).
        CATCH cx_send_req_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
    Email sender
      TRY.
          zlcl_sender =  cl_sapuser_bcs=>create( sy-uname ).
        CATCH cx_address_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
      TRY.
          CALL METHOD zlcl_send_request->set_sender
            EXPORTING
              i_sender = zlcl_sender.
        CATCH cx_send_req_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
    Create the Reciever address
      TRY.
          zlcl_recipient = cl_cam_address_bcs=>create_internet_address(
                                             gv_email ).
        CATCH cx_address_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
      TRY.
          zlcl_send_request->add_recipient( EXPORTING i_recipient =
          zlcl_recipient ).
        CATCH cx_send_req_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
      TRY.
          zlcl_send_request->set_send_immediately( gc_x ).
        CATCH cx_send_req_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.
    Send the mail
      TRY.
          zlcl_send_request->send( ).
        CATCH cx_send_req_bcs INTO zicl_oref_cast.
          CLEAR gv_text_cast .
          gv_text_cast = zicl_oref_cast->get_text( ).
      ENDTRY.

    Hi
    From abap help:
    SY-ONCOM
    On Commit flag. This system field is set to different values depending on the call status of an ABAP program. Of these, only the value of u2018Pu2019 is guaranteed. If at all, SY-ONCOM must only be queried for u2018Pu2019.
    The value 'P' means that the program is already executing a subroutine started using PERFORM u2026 ON COMMIT and therefore a
    further subroutine call using PERFORM ... ON COMMIT would cause a runtime error.
    That means the variable SY-ONCOM has the information if a process "ON COMMIT" is working and so it determines if a dump has to be raised.
    Now it's clear the meaning of that correction: if before calling a new commit the value of SY-ONCOM is changed the dump will be avoided.
    I've done the following texts:
    REPORT  ZCOMMIT.
    WRITE: 'Calling routine on commit'.
    PERFORM DO_SOMETHING ON COMMIT.
    COMMIT WORK.
    FORM DO_SOMETHING.
      DATA: ONCOM TYPE SY-UCOMM.
      MOVE SY-ONCOM TO ONCOM.
      SY-ONCOM = 'S'.
      COMMIT WORK.
      MOVE ONCOM TO SY-ONCOM.
    ENDFORM.
    The code above is very dangerous, because it triggeres a ricorsive loop: no dump, but the form is continuously called, just as help says SY-ONCOM is equal to P
    REPORT  ZCOMMIT.
    WRITE: 'Calling routine on commit'.
    CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
    COMMIT WORK.
    FUNCTION Z_MAX_COMMIT.
      DATA: ONCOM TYPE SY-UCOMM.
      MOVE SY-ONCOM TO ONCOM.
      SY-ONCOM = 'S'.
      COMMIT WORK.
      MOVE ONCOM TO SY-ONCOM.
    ENDFUNCTION.
    I expected the same behavior as above, but here no dump and no infinite loop, SY-ONCOM = V
    Now your process working in update task, but probably many function are called, I mean the system creates a queue of functions to be run in update task, so what happens here?
    I've tried this:
    FUNCTION Z_MAX_COMMIT.
    *"*"Function module di reg.:
    *"*"Interfaccia locale:
    *"  IMPORTING
    *"     VALUE(NO_COMMIT) TYPE  FLAG DEFAULT SPACE
      CHECK NO_COMMIT IS INITIAL.
      DATA: ONCOM TYPE SY-UCOMM.
      MOVE SY-ONCOM TO ONCOM.
      SY-ONCOM = 'S'.
      COMMIT WORK.
      MOVE ONCOM TO SY-ONCOM.
    ENDFUNCTION.
    REPORT  ZCOMMIT.
    WRITE: 'Calling routine on commit'.
    CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
      EXPORTING
        NO_COMMIT = 'X'.
    CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK.
    CALL FUNCTION 'Z_MAX_COMMIT' IN UPDATE TASK
      EXPORTING
        NO_COMMIT = 'X'.
    COMMIT WORK.
    Here no dump and no infinite loop too, but also no impact on the rest of the functions,
    I can suppose the impact will be on the saving of data on database only, because your COMMIT ends the LUW, so it's very important the routine for printing is called at the end, after all saving routines.
    Max

Maybe you are looking for

  • Acrobat Pro 9 with comments crashes

    I'm having problems with consistant crashes from acrobat files marked with comments. They are PDF files that have been sent to several users and commented on. Crashes when InDesign CS4 (6.0.2) is open and go back and forth between InDesign and Acroba

  • JBO datasources: avoiding literal SQL in where clause

    I understand that it is possible to set the where clause when defining a datasource with datatags: e.g. <jbo:DataSource id="ds" appid="wms_bc4j.Wms_bc4jModule" viewobject="WebUsersView" whereclause="USER_ID = 1"/> However this results in literal SQL

  • How to manually provide checksum in URL

    Hi -- I've just enabled session state protection in my application. All pages: Arguments must have checksum All page items: Checksum required - session level All application items: Checksum required - session level I have a javascript header that doe

  • No measurement unit is assigned to ISO-Code SEC

    hI ALL,, am getting this error No measurement unit is assigned to ISO-Code SEC when is use ny bapi bapi_shipment_create. to avoid this what i need to pass and where? Please advise.... am unable to create shipment because of this..

  • Problem with sending email from Acrobat Reader X Version 10

    Hello all I recently purchased a new Dell laptop with Windows 8 as its OS. I had two email clients installed, one is outlook 2007, that has no contacts and then purchased outlook 2014 which I am using. When I installed Acrobat and tried to send a PDF