COMMIT WORK on BADI BUPA_GENERAL_UPDATE

Hi all,
We're trying to propagate partner functions from the BP to associated business transactions.
We're using the instruction commit work in the BUPA_GENERAL_UPDATE. The problem comes when we propagate the partner functions more than once in the BP, because the first time works but the second causes a short dump (only in PC-UI, in SAP GUI it works properly).
We need to commit to unlock the modified opportunities.
Anyone knows the adecuate method to commit the work in PC-UI for transaction BP?
Thanks in advance, any help will be appreciated.
David

Hi David,
My first try would be to issue the COMMIT statement inside a Form (<i>commitroutine</i>)and call this form in as
PERFORM <i>commitroutine</i> ON COMMIT.
Let me know if it works.
Hope it helps.
Thanks, Debasish

Similar Messages

  • COMMIT work in BADI

    Hi all,
    Can anyone tell me about, is COMMIT WORK is allowed in BADI or USER EXIT?
    If not, what is the aalternative for that?
    Thanks in advance.
    Best Regards,
    Prasad

    Hi Prasad.
    I would like to suggest a couple of references,
    [SDN - Reference - Call Transaction / Bapi and Commit work in a Update task|Call Transaction / Bapi plus Commit work in a Update task?;
    [SDN - Reference - COMMIT WORK on BADI BUPA_GENERAL_UPDATE|COMMIT WORK on BADI BUPA_GENERAL_UPDATE;
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • Does SAP generate COMMIT WORKS when BAdIs end?

    I want to call a function module "IN UPDATE TASK" from within a BAdI.
    Will SAP generate a "COMMIT WORK" when the BAdI ends, so that the function module is triggered ?
    If I do have to code a COMMIT WORK in the BAdI to trigger execution of the FM, won't this interfere with any commit schedules that SAP has in mind ????

    Hi Narendran -
    I agree with you  - that's why I asked the question about whether I had to code my own "commit" in the BAdI - I have never had to do this before.
    But the good news is - even though I'm calling the FM "IN UPDATE TASK" from an SCM-APO CIF BAdI, SAP generates a commit work because my FM fires even when I don't have an explicit commit work in the BAdI.
    So all is well that ends well. 
    Thanks again.
    djh

  • 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

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

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

  • Reg. commit work in a follow-up action

    friends
       i am using the following approach to solve a requirement which is posted in this thread..How to send a mail after a usage decision is made in QA11?
    got a nice reply too
      i have defined a follow-up action and assigned a customized mail-sending fm to it..my doubts are, i am on 4.7..am able to send the mail to an internal id, but the problem is without using commit work and submit rsconn01 commands, am failing in doing the same...i have read in a thread that commit work or submit (if the called program uses commit work) will cause data inconsistencies and will trigger locks if it's used in any user-exit or badi...but in my case, when will a follow-up action actually take place? will it happen after all the database commits? if so, then i believe that even i use commit work and submit commands in my z mail sending fm, it wouldn't cause any problems...am just sort of afraid whether this approach is the correct one? or triggering the mail code from the last user exit or badi itself will solve the purpose? i believe not..please guide me on this friends...helpful replies will be appreciated and awarded..thanks in advance
    Regards,
    Sathish. R

    less views and no answers:-(

  • 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

  • Need help: Sending mail to internet address without commit work statement

    Dear Experts,
            I have a problem in sending mails from sap to internet address.Am using the function module
    SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              OPERATION_NO_AUTHORIZATION = 4
              OTHERS                     = 99.
    submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
    My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
    i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
    Thanks in advance.

    There is a parameter Commit_Work pass it as 'X'
    <code>
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_TYPE = 'RAW'
    DOCUMENT_DATA = DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    commit_work = 'X'
    TABLES
    OBJECT_CONTENT = OBJCONT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    </code>
    Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM

  • Commit statement in badi method

    hi all,
    i am using commit statement in badi method save_data, it is put after function module,
    in function module i have used insert and update statement, if i do like that then the commit statement refresh the global data but update the table,
    if i create one perform inside function module and put commit statement in that perform, then it shows message update was terminated,
    i also want the global data for processing thats why i can't use commit statement after FM in method, please give Suggestion,
    Points will be awarded.

    Hi,
    sounds as if you call that FM in update task. Update function modules do not allow all actions. They should only include the neccessary SQL statements and must include any COMMIT.
    For more information read SAPDOCU of COMMIT WORK and everything of SAPS update concept (start immed. V1, start delayed V2 and so on).
    ATTENTION. Most BADIs designed to save customers data may be used several times and standard data may be saved after them. To avoid inconsistent data inside those BADIs normally no COMMIT should be done.
    Kind regards,
    HP

  • Invalid COMMIT WORK in an update function module.

    Hi,Experts,
         Currently We got a problem for posting PO's GR with t-code MIGO. Our requirement is that can create Delivery by automaitcly after PO's GR is saving. Then I have tailored a program for creating delivery.The program will be triggered in an output type when saving action is done.
    Error info is as below
    "Calling a COMMIT WORK in an update process is not allowed
    because the function modules triggered in a Logical Unit
    of Work cannot then be processed correctly."
    Any help will be appreciated
    Thanks in advance
    Richard Zhou

    Hi Richard,
    First create an implementation for the BADI in se19,
    then in any of the methods put break point and run MIGO
    You can clearly see in the debugger what all values come
    Please note that u have 2 methods
    one works in update task and another as normal function module..to view the documentation of the BADI->go to se18 -> enter the name of the BADI -> Display -> click on documentation to View the purpose and use of the BADI you have mentioned,Please note that all BADIs may not have documentations.............
    Also if u feel that the replies are helping you out please reward points....this way the SDN members will be willing to do a bit more homework for you and help you out...
    To proceed with the BADI
    Please check the documentation below
    Business add-ins when creating a material document
    The enhancement MB_DOCUMENT_BADI has two methods that are called up by the same interface, though at different times. All material document data from the following tables is transferred to this business add-in:
    MKPF (material document header)
    MSEG (material document items)
    VM07M (update data)
    This data can be used in other programs, but cannot be changed.
    The methods differ according to the time at which they are called up:
    The method MB_DOCUMENT_BEFORE_UPDATE is called up before the FI document is created. This means that it is called up even if the program is terminated by an error during the subsequent processing. The update of data in separate tables should always be contained in function modules that are called up with the addition 'in update task'. This ensures that all the data is updated consistently.
    The method MB_DOCUMENT_UPDATE is not carried out until update. This means that all updates are carried out immediately in their own tables and do not have to be contained in 'update task' in function modules. For performance reasons, you should not re-read the tables or carry out any time-consuming routines at this point.
    You should always call up MB_DOCUMENT_BEFORE_UPDATE before MB_DOCUMENT_UPDATE, particularly if time is a critical factor when posting the material documents. The method MB_DOCUMENT_UPDATE is processed after the FI document numbers are called. As a result, no other FI documents can be posted until this document is completely updated.
    Even if the two methods are in the same class, you cannot access the same global fields, as the methods are called up at different times and are therefore carried out in another roll area.
    From the business add-in display, you can go to coding examples for both methods by choosing Goto -> Example coding -> Display
    Note
    The enhancement does not transfer any data to the material document, that is, you cannot change material document data before it is updated.
    If this business add-in is not set up properly, it may result in an inconsistency between the documents and the stocks and between the material documents and the accounting documents. Inconsistencies like these may be caused by the following elements in the business add-in:
    COMMIT WORK
    Remote function call (CALL FUNCTION ... DESTINATION)
    Own updates in document tables or stock tables (for example, update in tables MBEW, MARD, MSEG)
    The unlocking of data (for example, via DEQUEUE_ALL)
    Before the two business add-ins are called up, data is already flagged for the UPDATE. If a COMMIT WORK or a Remote Function Call is transmitted in the enhancement, these are written in the database. If another error occurs after the business add-ins are processed, you cannot carry out a complete ROLL BACK, as the data up to the COMMIT or Remote Function Call has already been written in the database. This can result in an inconsistent status (for example, material document without accounting document), which can only be repaired with considerable cost and effort.
    The business add-ins are not suitable for customer-specific updates in the stock tables, as updates like these destroy the standard stock update.
    Unlocking the data (for example, via DEQUEUE_ALL) is also critical, as the data that is to be updated is no longer protected from updates from external systems, and inconsistencies can result from parallel updates.
    Before you activate an enhancement, check carefully that the business add-in does not contain any critical coding places.
    If data inconsistencies have already occurred in your system as a result of the business add-in, remove the critical coding so that it does not cause any further inconsistencies.
    Regards
    Byju

  • HR_INFOTYPE_OPERATION not working in badi HRBAS00INFTY

    Hi All,
    I need to create a record in IT0019 when IT0024 is updated.
    For that purpose I have created an implementation of badi HRBAS00INFTY and added my code in method IN_UPDATE.
    I try to create the record in IT0019 using FM HR_INFOTYPE_OPERATION.
    The problem is that the record is not created but the FM doesn't return any error( return param is empty ).
    I added 'commit WORK.' after the FM but this doesn't work neither.
    Do you have any idea why ths FM is not working in the badi.
    kr
    Karim

    Hi,
    Try with the BADI HRPAD00INFTY, If it not working try creating dynamic action for INFTY 0024.
    Dynamic actions : SPRO -> SAP Reference IMG -> Personnel Management -> Personnel Administration - >Customizing procedures -> Dynamic Actions.
    ~~~ Ganesh Kumar K.

  • BAPI BAPI_OUTB_DELIVERY_CREATE_STO  cannot work in BAdI  DELIVERY_PUBLISH

    Hi Experts:
    In BAdI  DELIVERY_PUBLISH  Method PUBLISH_AFTER_SAVE.
    I called BAPI BAPI_OUTB_DELIVERY_CREATE_STO to create a new delivery when PGI for one exist delivery by referring to a PO.
    I test this FM in SE37 and it has no problem, but in the BAdi, it gave me below message 'No instance of object type OutboundDelivery has been created. External reference:'..
    Would you please let me know why?
    Thank you.
    Richard

    Hi Richard,
    Make sure you do not have commit work statement (or bapi_transaction_commit call) in the BADI. I believe commit will be called by the standard transaction at the end.
    Also, you could try moving your code in a funciton module and call it in update task (The actual execution is triggered by the statement COMMIT WORK).
    Hope this helps.
    Regards,
    Shyam

  • Implementing BADI BUPA_GENERAL_UPDATE

    Hi all.
    I'm trying to implement the BADI BUPA_GENERAL_UPDATE in CRM. I'm using the Function Module BUP_BUPA_MEMORY_GET_ALL for getting the data but after make changes how i can set it to the buffer ?

    Maybe i have not been explicit.
    I'm trying to set some information when a BP is being created or modified. I need an user-exit or BADI for using before update where i can fill BU_SORT1 and BU_SORT2 with predefined texts. I was trying with the BADI mentioned before and the function module BUP_BUPA_MEMORY_GET_ALL but how i can put the modified data in memory after make changes ?
    I was trying with the BADI BUPA_UPDATE where the BP is in Data Base but is waiting for a COMMIT, when i call the BAPI_BUPA_CHANGE it is raising an exception.
    Any ideas ? What i need to do ?
    Message was edited by: Armando Rodríguez
    Message was edited by: Armando Rodríguez

  • COMMIT WORK AND WAIT

    Message opened on behalf of colleague:
    I just have a quick inquiry regarding COMMIT WORK AND WAIT, I
    understand that this method performs the following:
    "This form specifies synchronous processing. The COMMIT statement waits
    for the end of processing. Control returns to your program after all
    high priority (V1) function modules have run successfully."
    "The AND WAIT form is convenient for switching old programs to
    synchronous processing without having to re-write the code.
    Functionally, using AND WAIT for update-task updates is just the same
    as dialog-task updates with PERFORM ON COMMIT."
    It says that before doing the actual commit it will wait for the end of
    processing for all related updates against the transaction. However
    does it also wait for any "user exits" to finish or does it go ahead
    and performs the commit and updates then the user exit happens?
    Thanks.

    Hi User exit is part of the  transaction where you call a subroutine, or another function module or BADI method. So in my opinion it will wait. Unless there is a explicit commit work coded inside the user exit.
    regards,
    Advait

Maybe you are looking for