MB_DOCUMENT_BADI (MB_DOCUMENT_BEFORE_UPDATE)

Hi,
I implemented the BADI MB_DOCUMENT_BADI - Method MB_DOCUMENT_BEFORE_UPDATE. Inside the method I called a custom Function Module which calls a BAPI (BAPI_BATCH_CHANGE). However, it was reported that users sometimes encounter an update termination when using MIGO.When I opened an OSS message, they told me that the BADI implementation caused it.
My question is, should the FM (which contains the call to the BAPI) be called in BACKGROUND TASK AS SEPARATE UNIT ? If it is going to be called in this mode, do I need to also add an explicit BAPI_COMMIT after the BAPI_BATCH_CHANGE is called ? In the current version of the method, the FM is called as a normal function module.
Thanks.

Hi,
this BADI is really weird. You have to be really careful what you put in it. There is even OSS note related to this problem -  Note 1284654. I briefly checked BAPI BAPI_BATCH_CHANGE and I found the following code
* End of transaction - IDOC-creation or directly COMMIT WORK
  IF sy-subrc IS INITIAL.
    CALL FUNCTION 'TRANSACTION_END'
         EXPORTING
              transaction_id = f_transaction_id
         EXCEPTIONS
              OTHERS         = 1.
So it calls COMMIT WORK automatically. Therefore you don't have to call BAPI_COMMIT.
Cheers

Similar Messages

  • MB_DOCUMENT_BADI - MB_DOCUMENT_BEFORE_UPDATE : how to check serial number

    Hello,
    we would like to check serial numbers just before saving our document.
    How could we read the serial numbers from memory ?
    The GET_SERNOS_OF_DOCUMENT does not return data from memory !
    Do you know a function to catch those datas ?
    Best regards

    Hello Kesav,
    If we use the customer exit EXIT_SAPLIPW1_008, we have a select in SER05 and OJBK for each serial numbers.
                                     => 200 serial = 200 select.
    The use of the BADI would be a better solution  => only one SELECT .... into t_tab and then one READ for each SN.
    The use of GET_SERNOS_OF_DOCUMENT  :
    data : ls_rser  TYPE rserob,
              lt_sernos TYPE TABLE OF rserob.
        move: x_mkpf-mblnr to ls_rser-mblnr,
                   x_mkpf-mjahr to ls_rser-mjahr,
                  'SER03'            to ls_rser-taser.
      CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'
        EXPORTING
          KEY_DATA            = ls_rser
        TABLES
          sernos                   = lt_sernos
        EXCEPTIONS
          KEY_PARAMETER_ERROR = 1
          NO_SUPPORTED_ACCESS = 2
          NO_DATA_FOUND              = 3.
      Result = NO_DATA_FOUND (True, because we have no SN in SER03 for the specified document => not saved).
    This function seems not to be the good way to catch our SN from memory !
    Joce

  • Call BAPI in BADI 'MB_DOCUMENT_BADI'

    Hi all,
    How can i call a BAPI in MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE ? I wrote code below but got  "GOODSMVT_CODE" is the correct type, its length is incorrect." error.
      DATA:
            goodsmvt_header       TYPE TABLE OF  bapi2017_gm_head_01,
            goodsmvt_code         TYPE TABLE OF  bapi2017_gm_code,
            goodsmvt_headret      TYPE TABLE OF  bapi2017_gm_head_ret,
            matdocumentyear       TYPE  bapi2017_gm_head_ret-doc_year,
            goodsmvt_item         TYPE TABLE OF  bapi2017_gm_item_create, " OCCURS 0 WITH HEADER LINE,
            goodsmvt_serialnumber TYPE TABLE OF  bapi2017_gm_serialnumber. " OCCURS 0.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header  = goodsmvt_header
            goodsmvt_code    = goodsmvt_code
            testrun          = ''
          IMPORTING
            goodsmvt_headret = goodsmvt_headret
            materialdocument = materialdocument
            matdocumentyear  = matdocumentyear
          TABLES
            goodsmvt_item    = goodsmvt_item
            return           = messages.
    Best regards,
    Munur

    Hi,
      I think field GOODSMVT_CODE is not table type, you mension it type table of 'BAPI2017_GM_CODE'.
    Thanks,
    Anmol.

  • Issue in stock transfer with BAPI_GOODSMVT_CREATE

    Hi Experts,
    In LQ02 with movement type 321 Q, when a transfer stock from Quality inspection project to Unrestricted project is made, our requirement is to further transfer the stock from Unrestricted project to Unrestrcited using movmt type 411 Q.
    i.e. Run LQ02 with Movt type 321 Q => should also trigger goods movmt with 411 Q.
    for this we have used badi method MB_DOCUMENT_BADI ~MB_DOCUMENT_BEFORE_UPDATE to trigger an update function module ZFM with start delayed. i.e. this ZFM will be triggered in update task to transfer stock from unres proj to Unres using 411 Q from LQ02.
    Now the issue is, when some one runs LQ02 with movmt 321 Q, I can see in MMBE that stock is perfectly moved to unrestricted ( QI PRoj to Project and then Proj to Unrest.). However, when I look at the stock overview in LS26 , I still see the stock in Project Unrestricted. ( instead of unrestricted)The movmt ocde I use for bapi is 06.
    I have tried using different movement types and codes, however i have the same result. stock overview is perfect in MM and not correct in WM.  I''m out of ideas.  Please help. I appreciate any suggestions.
    Thanks,
    Amber

    Hi david,
    Thanks for the hint. I did check in LU04 and unfortunately I don't see any open TO created nor to be confirmed.
    now, I did observe some strange behaviour while testing. When I again run LQ02 with movt type 309 or 411, I could see that the material is very well transfered from project unrest to Unrest.
    This is surprising , since I supply the same data in Badi, however it does not do the same for WM (LS26 Transaction ) but does for MM (MMBE).
    Do you think any customizing tables underlying are causing this. please help.
    Thanks,
    Amber

  • Enhancement of MIGO

    Hi all,
    I have a requirement to post  an accounting entry into 2 gl accounts when a migo (Good Reciept [both posting and rversal] ) is done on a particular type of purchase order (this is apart from the normal ones which have been added by the MM person). This I did through a BDC program on F-02 and added it through an enhancement. But now, the requirement is that the DOCUMENT NUMBERs of the normal accounting entry and that of my new posting should be same so that when they click on accounting documents for that particular migo, it should display all the postings; both the normal one and that which i have just added. I have tried all i could but have not gotten a right way to do this.
    Please any body in the house with any sound advise on how to do this?????

    Of course, you realize it is not possible to get two accounting documents with the same document number, you need two different accounting (FI, BKPF) documents referencing the same material document. (MM, MKPF)
    In your batch-input (BAPI would be better) give reference to the material movement document:
    - AWTYP = 'MKPF'
    - AWKEY = MKPF-BELNR + MKPF-GJAHR
    Sample: (in an implementation of MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE "Exit after Writing a Material Document. Not in 'update task'")
      DATA : lv_awtyp TYPE awtyp,
             lv_awkey TYPE awkey,
             ls_mkpf_awkey TYPE mkpf_awkey.
        WRITE 'MKPF' TO lv_awtyp.
        ls_mkpf_awkey-belnr = i_mkpf-mblnr.
        ls_mkpf_awkey-mjahr = i_mkpf-mjahr.
        WRITE ls_mkpf_awkey TO lv_awkey.
          CLEAR ls_bdcdata.
          ls_bdcdata-fnam = 'BKPF-AWTYP'.
          ls_bdcdata-fval = lv_awtyp.
          APPEND ls_bdcdata TO lt_bdcdata.
          CLEAR ls_bdcdata.
          ls_bdcdata-fnam = 'BKPF-AWKEY'.
          ls_bdcdata-fval = lv_awkey.
          APPEND ls_bdcdata TO lt_bdcdata.
    Regards,
    Raymond

  • MIGO : How to identify post is for Goods Recipt of outbound delivery.

    Hi,
    I am working with MIGO Transaction,
    My requirement is that while posting the Goods recipt with outbound delivery, If Movement type is not eqaul to 861, display a msg to change movemnet type to 861.
    for this requirement I am using the BADI
    MB_DOCUMENT_BADI - >  MB_DOCUMENT_BEFORE_UPDATE  .
    My Querry is that How can I Identify that the posting is for Goods reciept with outbound delivery.
    thr r three importing parameter for the BADI
    MSEG
    MKPK
    & vm07m.
    I try mkpf-tcode2 field.
    but for both  goods recipt and cancellation , the value of this field is MIGO_GR.
    Please help me regarding identification of the same.

    Hi,
      Goods Receipt normally gets stored in MKPF & MSEG tables..
    Regards
    Kiran Sure

  • Excess GR posting through MIGO

    Hi,
    I have a requirement where i have to make the excess GR posting for a given PO quantity through MIGO. I am doing this by adding a extra scheduling line item in the PO with the excess quantity. The code is written in the BADI MB_DOCUMENT_BADI - MB_DOCUMENT_BEFORE_UPDATE.
    Everything seems to be working fine and a new scheduling line is getting created with the excess quantity, but the same quantity is getting added to the previous shecduling lines 'GR QTY'(EKET-WEMNG). Something like below:
    Del.date           Sched.qty             GR.qty                  Open.Qty   
    20.11.2011         100                       155                          -
    06.03.2012           55                        -                               55
    Please suggest me a way to rectify this.
    Thanks.
    Note: i am adding extra delivery scheduling line using BAPI_PO_CHANGE. Which is working fine when i run it through SE37, here i am using it exactly the same way but above mentioned issue is ocurring.
    Edited by: topcoder on Mar 5, 2012 5:10 PM

    Hi,
    If you are posting the GR from the external tool, then try to use External break point instead of normal break point.
    Another thing, is try to post the GR manually from SAP login itself and check if the error is coming or not.
    regards,
    amit m.

  • Get Serial numbers when saving a good receipt in MIGO

    Hello,
    I am working on a requirement to get the serial numbers entered manually or automatically while posting a goods receipt in tcode MIGO.
    I have tried to use the some of the steps suggested in earlier threads..ie, using the FM GET_SERNOS_OF_DOCUMENT' within the BADI MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE. But the FM returns NO_DATA_FOUND exception. The BADI MB_MIGO_BADI is not trieggered during the save..
    Can you suggest a way to get the serial numbers entered on the screen or generated automatically..
    Thanks

    We are facing the same problem now... Did you finally accomplished this?
    Regards,
    Idoia

  • Error message in MB_DOCUMENT_BEFORE_UPDATE

    Hi All,
    I have implemented one implementation to the badi MB_DOCUMENT_BAD.
    while performing the 101 I have used two checks in my program.if In case chek failed I have to raise a error and stop the 101.
    I Have used the code in following manner.
    ROLLBACK WORK.
    ERROR MESSAGE.
    After getting the error message if user trying to come out from the left arrow we got a short dump.
    In short dump its mentioned that we can not use the ERROR MESSAGE to the MB_DOCUMENT_BEFORE_UPDATE.
    Can any one please suggest me what are the other ways to reaise a message in the user exit??
    Thanks.
    Sandeep.

    Hi !
    I allways use this BADI. There may be other ways but it works fine and not complex to implement.
    Here comes the docu of the BADI:
    Business Add-In: Check Line Before Copying to the Blocking Table                                                                               
    Use                                                                               
    This Business Add-In (BAdI) is used in the application component MM-IM         
        (MM-Bestandsführung).                                                                               
    You can use this BAdI to perform checks at item level when you post            
        goods movements. The structures MKPF (header data) and MSEG (item data)        
        are returned.                                                                               
    The structures DM07M (dialog control) and VM07M (update control) are           
        also available. However, the data from these structures is not stored in       
        a database table, but instead is only used for internal control. For           
        this reason, SAP reserves the right to change the use of these fields as       
        required.                                                                               
    Regards
    Rainer

  • BADI MB_DOCUMENT_BADI

    Hi All,
    I have created one implementation to the BADI MB_DOCUMENT_BADI. This badi will hit while creation of material document.I have write the code in method MB_DOCUMENT_BEFORE_UPDATE such  that it will act only for certain movement types specially for t-codeMb1a and MB31.
    What problem I am facing i have used a error message "MB_DOCUMENT_BEFORE_UPDATE" in this method.If we got the erroe message then we dont need to post the material dcoument,but here problem is that if the material document could not posted then it corrupt the material and when we performing 261/101 we got error message like " Inconsistency between MM and ML for material and plant"
    Can anybody elebrate the problem why its happining and what will be the solution to the issue.
    Thanks ,
    sandeep.

    Hi,
      This needs to be handled in the program based on the user action, you can either 'exit' the program or 'continue' processing, refer the sample code below,
    CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
             TITLEBAR                    = 'Confirm'
            TEXT_QUESTION               = 'Do you want to continue or exit'
             TEXT_BUTTON_1               = 'Continue'
             TEXT_BUTTON_2               = 'Exit'
             DISPLAY_CANCEL_BUTTON       = ' '
           IMPORTING
             ANSWER                      = LV_ANSWER.
          IF LV_ANSWER = 1.
                Handle the error,
          endif.
    Hope this helps,
    Rgds,

  • MB_DOCUMENT_BADI not triggring in ECC 6.0 version

    Hi All,
    We are upgrading our SAP R3 from 4.6c to ECC 6.0.
    In the new system, Transaction SE18 now has two options
    1. Enhancement spot
    2. BAdI Name
    When I display my BADI MB_DOCUMENT_BADI
    Attributes tab shows BAdI migrates to enhancement spot MB_GOODSMOVEMENT
    When I display Enhancement spot Technical details Tab shows Enhancement Implementation Status shows "Initial".
    We have implemented this BADI in our 4.6c version. And it’s triggering when I run MIGO transaction.
    In the new system BADI is not triggering when I run the MIGO.
    Above is the only difference I found in the new system when compared with our old system settings.
    Can any one suggest me what all the things I need to take care to get working this BADI
    Thanks,
    Satish

    Hi
    Also please read this.
    Business Add-In: Create a Material Document
    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.
    Business Add-In: Change Item Data in Transaction MIGO
    Use
    Application component: MM-IM-GR-MIGO
    The Business Add-In (BAdI) MB_MIGO_ITEM_BAdI enables you to set the storage location and item text in the transaction for goods movements ( MIGO).
    The Business Add-In is called when a new item is inserted in MIGO or when an existing item is changed.
    If changes are made at header-level, the Business Add-In does not run; the header data is then transferred to the external application for information.
    All available header and item data is transferred from MIGO to the external application.
    The determined storage location and item text of a material document item is transferred back from the external application.
    Note
    The Business Add-In is called in MIGO at different times. The external application must be prepared for this.
    Standard settings
    In the standard system, the Business Add-In is not active.
    There is no default code that would run without an active implementation.
    The Business Add-In is not filter-dependent.
    The Business Add-In cannot be used more than once.
    Activities
    To activate the Business Add-In, you must create an active implementation. Do this in Inventory Management and Physical Inventory Customizing and choose the relevant activity under Maintain Customer-Exits and Business Add-Ins.
    For more information about this procedure, see the SAP Library under
    Basis Components -> ABAP Workbench -> Changing the SAP Standard -> Business Add-Ins -> Implementing Business Add-Ins.
    Example
    Storage location determination
    The Business Add-In should be used for a customer-specific storage location determination.
    Item text
    Goods receipt for purchase order with account assignment: As the purchase order item does not have a material number, the material short text in the puchase order should be adopted as the item text.
    Example of source text:
      IF IS_GOITEM-MATNR IS INITIAL.
        E_ITEM_TEXT = IS_GOITEM-MAKTX.
      ENDIF.
    If the material short text is to be adopted as the item text for all goods movements, the source text only consists of the following line:
    Example of source text:
        E_ITEM_TEXT = IS_GOITEM-MAKTX.
    Further notes
    Documentation on the BAdI method:
    Change particular fields of a line (GOITEM)
    ITEM_MODIFY
    You can also call the documentation on the BAdI method via the menu, by carrying out the following steps:
    1. Choose the tab page Interface.
    2. Double-click on the relevant method.
    3. Click on the right mouse button and choose Component documentation.
    Change a Row from Certain Fields (GOITEM)
    Functionality
    The ITEM_MODIFY method makes it possible to set the storage location and item text in the transaction for goods movements ( MIGO).
    The method is called if a new item is added in MIGO or if an existing item is changed.
    If changes are made to the header, the method will not run; however, the header data is transferred to the external application for information.
    All available header and item data is transferred from MIGO to the external application.
    The external application then transfers back the determined storage location and the item text of a material document item.
    Requirements
    Note that the Business Add-In can run several times for each material document item if entries are changed on the entry screen, or if error messages are outputted.
    Result
    The storage location and item text is returned from the external application to MIGO. The item text is also saved in the accounting document.
    Note:
    Data is only copied into MIGO, if the corresponding fields are visible and ready for input.
    Parameters
    The following structures are transferred:
    IS_GOHEAD: contains the header data for the goods movement
    IS_GOITEM: contains the itemd ata for the goods movement
    E_STGE_LOC: storage location
    E_ITEM_TEXT: item text
    Exceptions
    None
    Notes
    GOITEM includes all information on an item, in other words, both business data (material number) and technical data (for example, whether or not a tab page is to be shown for an item). We recommend you only analyze the business data of an item, as the technical data may be changed due to new developments at SAP.
    Documentation for Business Add-In:
    BAdI in MIGO for Changing Item Data (MB_MIGO_ITEM_BADI)
    <b>Also try out the BADI - MB_MIGO_BADI</b>
    Business Add-In: Maintain External Detail Subscreens for Transaction MIGO
    Use
    Application component: MM-IM-GR; MM-IM-GI
    With the Business Add-In (BAdI) MB_MIGO_BADI, you can extend the interface of the goods movements transaction ( MIGO) with additional tabstrip controls for the detailed information (detail tabstrips) and header information (header tabstrips). It is possible for an external application
    to display an additional detail tabstrip with own subscreen (max. 10 lines) in MIGO
    to display an additional header tabstrip with own subscreen (max. 3 lines) in MIGO
    The program name, screen number and tab page text can be determined dynamically. Different screens can therefore be controlled according to the mode (for example, change mode, display mode, goods receipt, goods issue).
    Pushbuttons
    It is not possible to implement pushbuttons in the MIGO menu, but you can, however, implement pushbuttons directly on the external subscreen. The OK code from MIGO is forwarded to the external application so it can react.
    Cursor Control
    So that the cursor stays on the same subscreen after you press Continue, if it was positioned there before, the external application in the own PAI must hold the cursor positioning (on the same screen 'yes'/'no'; if 'yes', on which field), to set the cursor in PBO again.
    Requirements
    If you use the BAdI MB_MIGO_BADI in MIGO to update customer-own data, in addition to the material document, to the database, you should note the following:
    The BAdI MB_MIGO_BADI is only active in transaction MIGO.
    If you post goods movements with other transactions (for example, with MB01, MB1C, VL02N), you must ensure that customer data is also updated, if necessary.
    You can do this by using the BAdI MB_DOCUMENT_BADI (Creating a material document) to post the goods movements with the transactions mentioned above.
    Note that otherwise, posting the goods movements will lead to inconsistencies between SAP system data (for example, in stocks, material documents, FI documents) and customer data.
    To avoid these inconsistencies, we recommend posting all goods movements with transaction MIGO.
    Standard settings
    In the standard system, the Business Add-In is not active.
    There is no default code.
    The Business Add-In is not filter-dependent.
    The Business Add-In can be used more than once.
    Activities
    To activate the Business Add-In, you must create an active implementation. Do this in Inventory Management and Physical Inventory Customizing and choose the relevant activity under Maintain Customer-Exits and Business Add-Ins.
    For more information about this procedure, see the SAP Library under
    Basis Components -> ABAP Workbench -> Changing the SAP Standard -> Business Add-Ins -> Implementing Business Add-Ins.
    Note that the Business Add-In can be used multiple times and therefore all active implementations are called and run through.
    Create Implementations
    BAdI definition MB_MIGO_BADI was created with transaction SE18.
    Using transaction SE19, you can create an implementation for this BAdI. You can provide the methods with customer-defined code.
    The BAdI definition can be used several times. In MIGO, five additional tabstrip control were defined for the detail screen, and five additional tabstrip controls for the header information. In other words, up to five different implementations can be created.
    Recommendation
    We recommend that you do not install the external application data directly in the implementation, but enclose it in function modules. You assign the screen with the subscreens to the corresponding function group; see the example implementation.
    Example
    For easier comprehension, an example code has been created for the BAdI MB_MIGO_BADI. The example implementation class isCL_EXM_IM_MB_MIGO_BADI.
    To activate the example implementation, use transaction SE19 to create a new implementation and then activate it. Copy the example code with Goto -> Sample Code -> Copy.
    The tabstrip controls MIGO BAdI Example are then displayed in MIGO for the header and detail information.
    On the tabstrip control for the detail information, you can enter an additional quantity (and unit of measure). Both are saved in table MIGO_BADI_EXAMPL.
    The text field SGTXT can also be changed. An example shows how an external application can change the data from the GOITEM (item data in MIGO) structure.
    On the tabstrip control for the header information, you can enter an additional number. This is saved in table MIGO_BADI_EXAMP2.
    Further notes
    Documentation for BAdI methods:
    Initialization and registration of external detail screens:
    INIT
    PBO of detail screen
    PBO_DETAIL
    PAI of detail screen
    PAI_DETAIL
    Insert / change line (GOITEM)
    LINE_MODIFY
    Delete line (GOITEM)
    LINE_DELETE
    MIGO reset (delete all internal data)
    RESET
    Post a goods movement
    POST_DOCUMENT
    Check item data for goods movement
    CHECK_ITEM
    Mode of transaction MIGO (action, reference document, etc.)
    MODE_SET
    Status information and header data
    STATUS_AND_HEADER
    Save held data
    HOLD_DATA_SAVE
    Load held data
    HOLD_DATA_LOAD
    Delete held data
    HOLD_DATA_DELETE
    PBO of header screen
    PBO_HEADER
    PAI of header screen
    PAI_HEADER
    Check item data for goods movement
    CHECK_HEADER
    You can also call the documentation on the BAdI method via the menu, by carrying out the following steps:
    1. Choose the tab page Interface.
    2. Double-click on the relevant method.
    3. Click on the right mouse button and choose Component documentation.
    Hope this will help.
    Please reward suitable points.
    Regards
    - Atul

  • MB_DOCUMENT_BADI badi is not poping up the error message

    hi friend,
    i m using the badi MB_DOCUMENT_BADI for MIGO transaction code to check batch condition for that i m using the method MB_DOCUMENT_BEFORE_UPDATE. in this method i have given the condition like
       if wa_XMSEG-charg <> wa_mseg-charg.
        message 'Batch is different' type 'I'.
            LEAVE PROGRAM.
       endif.
    now my problem is when this condition is true its going to "message 'Batch is different'  type 'I'" this statment but it is not poping up
    the message, after this it is directly going to the "LEAVE PROGRAM" and comming out of transaction. i want to pop up this message first and then it shoul come out of the transaction.
    pl suggest me some thing to get out of this problem.
    regards,
    vicky.

    HI ,
    Use the following piece of code for message...
    if wa_XMSEG-charg wa_mseg-charg.
    message I368(00) with 'Batch is different'.
    LEAVE PROGRAM.
    endif.
    Hope this helps.
    Regards,
    Rohan.

  • BADI MB_DOCUMENT_BADI dump error

    Hi all,
    am using BADI : MB_DOCUMENT_BADI,method MB_DOCUMENT_BEFORE_UPDATE,to have checks in MB1A(Goods Issue transaction).I have written a code to check some values,after checking and raising an error message if I press enter the following dump error is coming:
    Error analysis
        Short text of error message:
        Internal error: Multiple call of update function module
        Long text of error message:
         Diagnosis
             In the FORM routine Buchen_Ausfuehren (program SAPMM07M), an error
             message was issued by a Business Add-In (BAdI) or function module.
             This is not permitted, because it could lead to data
             inconsistencies. For this reason, the update of the material
             document was also terminated with a termination message (dump).
             Note that this message (M7 372) is not the responsible error
             message.
         System Response
         Procedure
             Contact your system administrator.
         Procedure for System Administration
             If there is an active implementation of the Business Add-In
             MB_DOCUMENT_BADI, check that no error message is issued in the
             MB_DOCUMENT_BEFORE_UPDATE method.
        Technical information about the message:
        Message class....... "M7"
        Number.............. 372
        Variable 1.......... " "
        Variable 2.......... " "
        Variable 3.......... " "
        Variable 4.......... " "
    Hope am clear in my questian,
    Thanks & Regards,
    Rock.

    Hi,
    This BADI is called in update task.
    So as a result when you call your error message, SAP is retuning it as message type 'X" and an update termination occurs.
    I was facing a similar problem becuase i was trying to update measurment doc via this badi.
    Incase the measuring document was locked by some user my FM used to throw an error message and that would lead to a message type 'X' in this badi.
    So if you want to do some validations only; please use the following BADI.
    MB_MIGO_ITEM_BADI in the method ITEM_MODIFY.
    Regards,
    Ankur Parab

  • How to raise error message in MB_DOCUMENT_BEFORE_UPDATE?

    Dear Friends,
    I have a situation like, need to thro an error Message inside the BADI: MB_DOCUMENT_BEFORE_UPDATE.
    Based on some validations on XMSEG parameter inside the above BADI, I am raising an Error Message as usual.
    Message E208(00) with 'Posting error..'.
    When I raise the above error, the system ends with Short Dump.
    Could anyone please let me know, how to handle the above?
    Thanks in advance,
    Ramani N

    >
    Gaurav Gupta wrote:
    > Hi
    > I would like to suggest you to check whether you have used MESSAGE-ID addition in your REPORT statement or not. We are supposed to use it whenever we are trying to display error messages like *Message E208(00) with 'Posting error..' *.
    > Hope this solves your Problem.
    >
    > Regards
    > Gaurav.
    Hi Gaurav,
    My query is about BADI.  Hence, we can not use REPORT statement.
    Rgds,
    Ramani N

  • Use of enque and deque function in BADI MB_DOCUMENT_BADI

    Hi All,
    I have implemented one implementation to the BADI MB_DOCUMENT_BADI.I have to use update command in this implementation to update on ZTABLE,In order to update I need to use enqueue and dequeue function before updating the table.
    My concern is that in the documentation to the BADI it specifies that Unlocking the data( DEQUEUE_ALL) will be not used in this implementation.
    Please let me know Can  I use enqueue and deques function for this table to this BADI.
    Thanks,.
    Sandeep.

    Hi,
      I think field GOODSMVT_CODE is not table type, you mension it type table of 'BAPI2017_GM_CODE'.
    Thanks,
    Anmol.

Maybe you are looking for

  • Customer name appears with prefix '1' in sales order

    Dears, When I enter sold to / ship to in sales order, name field in the header is prefixed with '1' example: 123455 -  ABCD & Co (in customer master) but in sales order sold to party field 123455 - 1ABCD & Co This is happening for all the cases. plea

  • Oracle 9i and 8.0.2 connection

    We have Oracle 9.2.0.1 database running on win 2k server. At the client end we have 8.0.2 client inst . How do i establish communication between 8.0.2 client and 9i(server databse)? Through net80 easy config it gives me follwing error? -12203 - desti

  • Anonymous sequence an clientgen

    Hi there! The clientgen ant-task has problems when using anonymous sequences like <element... <complexType> <sequence maxOccurs="unbounded"> <element name="...".. <element name="...".. </sequence> </complexType> </element> It will generate only one s

  • White balance in LR5

    Where are they hiding the white balance tool in LR5?  I can't find it. Al

  • Booting problem in 3745 router

    Hii.. I m facing problem in cisco3745 multiaccess router.when i boot the router i get the garbage type of char.from console terminal.plz find the attachment. Plz guide me wt is the problem and hw to resolve that.