Help to use BAPI_GOODSMVT_CREATE in BAdI MB_DOCUMENT_BADI

Hi frnds ,
  I want use BAPI_GOODSMVT_CREATE in BAdI MB_DOCUMENT_BADI,
can any one have any code related this ?
i have also writeen my code but it is giving error that itab is not an inatertable occurs n misiing , but when i  m creting internal table with occurs staement it is not suppoertd by OO concept.
Dont worry about points.
Mahesh.

Hello
Use the syntax
data : itab type table of <xmseg> with header line.
regards

Similar Messages

  • Help with use bapi_Goodsmvt_create

    I follow the ducument of bapi_Goodsmvt_create
    GM_Code 01
    using
    Purchase order  '4500014500'
    Purchase order item  '10'
    Movement type    '101'
    Movement indicator  'B'  (according to the ducument)
    return error "Special Stock B not supported"  WHY?
    Best Regards
    Message was edited by: Sheng Wang

    Hi !!!
      I'm trying to do the same, transaction mb01, movement 101, order purchase.... i fill the next fields:
       MATERIAL
       PLANT   
       STGE_LOC
       STCK_TYPE
       ENTRY_QNT
       PO_NUMBER
       PO_ITEM 
       The system, show the next message:
        E, M7, NUM. 256. 
       Update control movement type incorrect entry (101)
       I don't know if this is a problem of information that
       i give o is a problem of configuratión or i need use
       other bapi for do this.
        You can use this bapi ?
       Can you share your code ?
         Thanks,
        Best Regards !!

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

  • Posting a goods Receipts by using 'BAPI_GOODSMVT_CREATE'

    Hi experts,
    For a Handling Unit number, im Posting a goods Receipts by using 'BAPI_GOODSMVT_CREATE'
    Im passing the below values to the BAPI, to create a Material document and transfer order.
    GOODSMVT_HEADER- PSTNG_DATE (System Date)
    GOODSMVT_HEADER - DOC_DATE (System date)
    GOODSMVT_HEADER- PR_UNAME (SY-NAME)
    GOODSMVT_CODE- GM_CODE ( 01)
    GOODSMVT_ITEM-MOVE_TYPE (Movement type): movement type '101'
    GOODSMVT_ITEM- DELIV_NUMB_TO_SEARCH (Delivery)
    GOODSMVT_ITEM-DELIV_ITEM_TO_SEARCH (Delivery item)
    GOODSMVT_ITEM-PLANT (Plant) VEPO- WERKS
    GOODSMVT_ITEM-STGE_LOC (Storage location) VEPO- LGORT
    GOODSMVT_ITEM-ENTRY_QNT (Quantity)
    GOODSMVT_ITEM-ENTRY_UOM (Unit of measure)
    GOODSMVT_ITEM-PO_NUMBER (Purchase order)
    GOODSMVT_ITEM-PO_ITEM (Purch. order item)
    GOODSMVT_ITEM-UNLOAD_PT ( HU number)
    GOODSMVT_ITEM-MVT_IND (Movement indicator) = 'B'
    I dont know what values has to be passed to the following fields in BAPI
    *GOODSMVT_ITEM-SU_PL_STCK_1*
    *GOODSMVT_ITEM-SU_PL_STCK_2*
    *GOODSMVT_ITEM-ST_UN_QTYY_1*
    *GOODSMVT_ITEM-ST_UN_QTYY_2*
    *GOODSMVT_ITEM-UNITTYPE_1*
    *GOODSMVT_ITEM-UNITTYPE_2*
    All those values has to be updated in the Material document.
    Please help me on this.
    Thanks & regards,
    Leo
    Edited by: Thomas Zloch on Nov 17, 2011 10:11 AM

    I konw that I'm digging an old thread but let's have a look. I have the same problrm (filling the DMBTR field from the BAPI). I have not tried yet but checking the code of the BAdI I found that the EXTENSIONIN_TO_MATDOC method of the MB_BAPI_GOODSMVT_CREATE BAdI is called before creating the material posting and it has the IMSEG table as changing parameter. I will give it a try soon. Hope that it will work.
    Has anyone experience with it by any chance?
    Adam

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

  • Problem with badi MB_DOCUMENT_BADI

    Hi experts
    i have a problem with the badi, MB_DOCUMENT_BADI this is i am using for MIGO transaction
    my requirement is i need to call MR22 transaction in this badi but as this badi is calling in up date task i cann't use the call transaction statement and there is no BAPI available for MR22 transaction so could you please tell me is there any any way to process the session automatically after creating the session for MR22 transaction.
    it would be great help for me
    thanks in advance

    Lets the FM created is Z_Call_transaction_data. ( Make this FM as RFC enabled by selecting radiobutton Remote- Enabled Module in Attributes of the FM)
    Call this FM in ur BADiI Method as :
    Call function 'Z_Call_transaction_data.' starting new task 'TASK1'.
    Import ...
    Export...
    You can ginve any name to this task.
    If you want to debug it , execute ur code and when control reaches to FM , press F5 a new session will be opened .
    Starting new task starts the code in new LUW.

  • Goods Receipt Report With 101 movement type using bapi_goodsmvt_create

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

  • Post GM with reference to Production Order using BAPI_GOODSMVT_CREATE

    Hi Experts,
    We need to post Goods Movement with reference to Production order. In brief, we have to get the functionality of MB1A done. I'm trying to use BAPI_GOODSMVT_CREATE, but its not reflecting the Documented Goods Movements in the Production Order.
    Here is the data i'm using:
    goodsmvt_header : posting date, document date
    goodsmvt_code : 03
    goodsmvt_item:
    material
    plant
    storage loc
    batch
    mov typ : 261
    ENTRY_QNT
    ENTRY_UOM
    ENTRY_UOM_ISO
    order id
    Sometimes it generates material doc and year in exporting parameter, and sometimes it gives message "Content of order zzzzzzz : yyyyyyy transferred to interface (IMSEG): xxxxxxx".
    But despite of this I cannot see the Documented Goods Movements reflecting in the Production Order.
    Can anyone help on this. Is there anything else to be passed or I'm missing any process ?

    Experts,
    I could get the postings done with BAPI_GOODSMVT_CREATE. I was executing BAPI_GOODSMVT_CREATE and then BAPI_TRANSACTION_COMMIT separately, thus the generated Material doc number was not getting posted. When I used the Test Sequence option from SE37 menu, it worked.

  • I have bought a used macbook, to bad i do not have the admin password. is there any way to bypass this issue with out the Mac OS X disk? (without loosing my obtained files?)

    i have bought a used macbook, to bad i do not have the admin password. is there any way to bypass this issue with out the Mac OS X disk? (without loosing my obtained files?)   I NEED HELP BADLY PLEASE....

    What version of the Mac OS X are you running. Go to the Apple in the upper left corner and select About This Mac and post the version.

  • BADI MB_DOCUMENT_BADI and method only working in debug mode

    Hi SAP Experts,
    I have a problem with badi MB_DOCUMENT_BADI. I implemented method MB_DOCUMENT_UPDATE, which  is called from update
    task.
    My implementation calls a BAPI to update a standard sap table and I also update a custom table. When I put a breakpoint and the debugger gets to it, it runs wells. Everything gets updated properly.
    With no breakpoints it doesnu2019t update anything. Iu2019m not sure what is causing this. Any help would be greatly appreciated.
    << Moderator message - Everyone's problem is important. But the answers in the forum are provided by volunteers. Please do not ask for help quickly. >>
    Miguel
    Edited by: Rob Burbank on Oct 28, 2011 2:18 PM

    Hi,
    Please see below:
    CALL FUNCTION 'BAPI_EQUI_CHANGE'
                      EXPORTING
                         EQUIPMENT               =  <FS_UPD>-EQUNR  "->equnr of looped table
                         DATA_GENERAL            =  K_DATA_GENERAL
                         DATA_GENERALX           =  K_DATA_GENERALX
                         DATA_SPECIFIC           =  K_SPECIFIC_DATA
                         DATA_SPECIFICX          =  K_SPECIFIC_DATAX
                      IMPORTING
                         DATA_GENERAL_EXP        =  K_DATA_GENERAL_EXP
                         RETURN                  = I_MESSAGE.
    ***This is called inside a loop, after the loop...
      UPDATE "Z_MY_TABLE" FROM TABLE I_UPD_FM.
    Inside the loop the data gets prepared for the custom and standard table.
    Thanks all!
    Miguel

  • Cannot use BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BEFORE_UPDATE

    Hi experts,
    I need to do enhance to post additional 313 movement after post 962 movement.
    I picked up MB_DOCUMENT_BEFORE_UPDATE to be triggered after press save button and used BAPI_GOODSMVT_CREATE to post 313.
    The problem is BAPI_GOODSMVT_CREATE returned error 'Enter Plant'!.
    All parameters were already tested with SE37 and it worked great.
    I did a lot debugging and found that all MSEG data were mysteriously cleared after it run 'PERFORM fusszeile_wa_pruefen(sapmm07m) USING x.' in source code SAPLMBWL.
    After that, I tried a new way. I submitted my Z program ,which call BAPI_GOODSMVT_CREATE with exactly same parameter, in BADI and it returned error that material ... batch ... is already locked.
    I'm not sure that is it possible to post additional material document in this BADI(MB_DOCUMENT_BEFORE_UPDATE).
    Best regards,
    Amornpon

    Thanks for reply.
    I did create FM and called it in BADI but it gave the same result as I called BAPI directly from enhance program.
    and what do you mean 'NEW TASK'  Is that you mean call function in update task?
    I did try call function in update task but it didn't work.
    The problem is BAPI function returned that Mat XXX  Batch XXX is alreay locked by XXX and also cannot get created material doc number.

  • 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

  • OSA:Help needed to make a BAdi work

    Hi All..
    I need a help regarding the BAdi..i am using the Average BAdi in a column...I have a criterion group called critical attributes and under this there are 5 criterions..i need to insert the BAdi in the Criterion group Critical Attributes and the BAdi needs to calculate the values of the criterions and show the result in the criterion group...
    I had done the same thing for the other criterion group and the BAdi was working fine..but the BAdi is not working when i insert it in Critical Attributes criterion group....I contacted some people and they told that it is a configuration issue..so please help me out with a solution...and also the configuration which i need to do to make the BAdi work....

    Hi Maurice..
    I am using the BAdi in an enabled column..i have already used the average Badi in a different criterion group called Performance Rating..It is working fine there...there is no difference between the 2 criterion groups...but somehow it is not working here...i really dont know what is the configuration issue since i am a technical guy...
    I will tell u the issue using an example...
    I have a criterion group Critical Attributes in which i have inserted the BAdi in the score column......
    Under this i have 5 attributes like Accountability,Communication...etc..
    The manager appraises the above attributes in the FAPP column...The Badi has to calculate the average of the 5 columns...
    I have used the same average BAdi in another criterion group and it is working fine..
    so please help me out with the answer..we r using ECC 5.0 version...

  • Z implementation not getting picked for BADI  - MB_DOCUMENT_BADI

    Hi,
    I have a done a z implemenatation for standard badi MB_DOCUMENT_BADI in ECC6.In Tcode MIIGO after giving  2 line items when i save it that Zimplemen is not getting picked.
    In 4.6c the same Z implementation is getting picked.
    can you please help me out in this.

    Hi Rajeev,
    I am not sure about the definition of Badi and hence am assuming that the filter is set....and the value for the z implementation does not match the value passed from the call point. Can you please check this and confirm
    Regards,
    Jemin

  • Error in updating 311 movement using BAPI_GOODSMVT_CREATE

    Hi All,
    I need hlep to understand the problem in doing a transfer.
    SAP MII is doing a 311 type movement using BAPI_GOODSMVT_CREATE. BAPI is returning the response back to MII. Once the BAPI is commited it shall make transfer inside SAP. But it does not reflect the movement while checking under HUMO.
    under SM13 it say " SSFCOMPOSER 323"  error in address output (name not filled)
    MII is getting this reponse back as a result of BAPI execution.
    <?xml version="1.0" encoding="UTF-8"?>
    <BAPI_GOODSMVT_CREATE>
    <INPUT><GOODSMVT_CODE><GM_CODE>04</GM_CODE></GOODSMVT_CODE><GOODSMVT_HEADER><PSTNG_DATE>2010-07-03</PSTNG_DATE><DOC_DATE>2010-07-03</DOC_DATE><REF_DOC_NO/><BILL_OF_LADING/><GR_GI_SLIP_NO/><PR_UNAME/><HEADER_TXT/><VER_GR_GI_SLIP/><VER_GR_GI_SLIPX/><EXT_WMS/><REF_DOC_NO_LONG/><BILL_OF_LADING_LONG/><BAR_CODE/></GOODSMVT_HEADER><GOODSMVT_REF_EWM><REF_DOC_EWM/><LOGSYS/><GTS_SCRAP_NO/></GOODSMVT_REF_EWM><TESTRUN/></INPUT>
    <OUTPUT><GOODSMVT_HEADRET><MAT_DOC/><DOC_YEAR>0000</DOC_YEAR></GOODSMVT_HEADRET><MATDOCUMENTYEAR>0000</MATDOCUMENTYEAR><MATERIALDOCUMENT/></OUTPUT>
    <TABLES><EXTENSIONIN/><GOODSMVT_ITEM><item><MATERIAL>130116</MATERIAL><PLANT>2715</PLANT><STGE_LOC>LINE</STGE_LOC><BATCH>96</BATCH><MOVE_TYPE>311</MOVE_TYPE><STCK_TYPE/><SPEC_STOCK/><VENDOR/><CUSTOMER/><SALES_ORD/><S_ORD_ITEM>000000</S_ORD_ITEM><SCHED_LINE>0000</SCHED_LINE><VAL_TYPE/><ENTRY_QNT>96.000</ENTRY_QNT><ENTRY_UOM/><ENTRY_UOM_ISO/><PO_PR_QNT>0</PO_PR_QNT><ORDERPR_UN/><ORDERPR_UN_ISO/><PO_NUMBER/><PO_ITEM>00000</PO_ITEM><SHIPPING/><COMP_SHIP/><NO_MORE_GR/><ITEM_TEXT/><GR_RCPT/><UNLOAD_PT/><COSTCENTER/><ORDERID/><ORDER_ITNO>0000</ORDER_ITNO><CALC_MOTIVE/><ASSET_NO/><SUB_NUMBER/><RESERV_NO>0000000000</RESERV_NO><RES_ITEM>0000</RES_ITEM><RES_TYPE/><WITHDRAWN/><MOVE_MAT/><MOVE_PLANT>2715</MOVE_PLANT><MOVE_STLOC>J01</MOVE_STLOC><MOVE_BATCH>96</MOVE_BATCH><MOVE_VAL_TYPE/><MVT_IND/><MOVE_REAS>0000</MOVE_REAS><RL_EST_KEY/><REF_DATE>0000-00-00</REF_DATE><COST_OBJ/><PROFIT_SEGM_NO>0000000000</PROFIT_SEGM_NO><PROFIT_CTR/><WBS_ELEM/><NETWORK/><ACTIVITY/><PART_ACCT/><AMOUNT_LC>0</AMOUNT_LC><AMOUNT_SV>0</AMOUNT_SV><REF_DOC_YR>0000</REF_DOC_YR><REF_DOC/><REF_DOC_IT>0000</REF_DOC_IT><EXPIRYDATE>0000-00-00</EXPIRYDATE><PROD_DATE>0000-00-00</PROD_DATE><FUND/><FUNDS_CTR/><CMMT_ITEM/><VAL_SALES_ORD/><VAL_S_ORD_ITEM>000000</VAL_S_ORD_ITEM><VAL_WBS_ELEM/><GL_ACCOUNT/><IND_PROPOSE_QUANX/><XSTOB/><EAN_UPC/><DELIV_NUMB_TO_SEARCH/><DELIV_ITEM_TO_SEARCH>000000</DELIV_ITEM_TO_SEARCH><SERIALNO_AUTO_NUMBERASSIGNMENT/><VENDRBATCH/><STGE_TYPE/><STGE_BIN/><SU_PL_STCK_1>0</SU_PL_STCK_1><ST_UN_QTYY_1>0</ST_UN_QTYY_1><ST_UN_QTYY_1_ISO/><UNITTYPE_1/><SU_PL_STCK_2>0</SU_PL_STCK_2><ST_UN_QTYY_2>0</ST_UN_QTYY_2><ST_UN_QTYY_2_ISO/><UNITTYPE_2/><STGE_TYPE_PC/><STGE_BIN_PC/><NO_PST_CHGNT/><GR_NUMBER/><STGE_TYPE_ST/><STGE_BIN_ST/><MATDOC_TR_CANCEL/><MATITEM_TR_CANCEL>0000</MATITEM_TR_CANCEL><MATYEAR_TR_CANCEL>0000</MATYEAR_TR_CANCEL><NO_TRANSFER_REQ/><CO_BUSPROC/><ACTTYPE/><SUPPL_VEND/><MATERIAL_EXTERNAL/><MATERIAL_GUID/><MATERIAL_VERSION/><MOVE_MAT_EXTERNAL/><MOVE_MAT_GUID/><MOVE_MAT_VERSION/><FUNC_AREA/><TR_PART_BA/><PAR_COMPCO/><DELIV_NUMB/><DELIV_ITEM>000000</DELIV_ITEM><NB_SLIPS>000</NB_SLIPS><NB_SLIPSX/><GR_RCPTX/><UNLOAD_PTX/><SPEC_MVMT/><GRANT_NBR/><CMMT_ITEM_LONG/><FUNC_AREA_LONG/><LINE_ID>000000</LINE_ID><PARENT_ID>000000</PARENT_ID><LINE_DEPTH>00</LINE_DEPTH><QUANTITY>0</QUANTITY><BASE_UOM/><LONGNUM/></item></GOODSMVT_ITEM><GOODSMVT_SERIALNUMBER/><GOODSMVT_SERV_PART_DATA><item><LINE_ID>000000</LINE_ID><RET_AUTH_NUMBER/><DELIV_NUMBER/><DELIV_ITEM>000000</DELIV_ITEM><HU_NUMBER>115934300024</HU_NUMBER><INSPOUT_GUID/><EVENT/><DATE>0000-00-00</DATE><TIME>00:00:00</TIME><ZONLO/><TIMESTAMP>0</TIMESTAMP><SCRAP_INDICATOR/><KEEP_QUANTITY>0</KEEP_QUANTITY><GTS_STOCK_TYPE/><MOVE_GTS_STOCK_TYPE/></item></GOODSMVT_SERV_PART_DATA><RETURN><item><TYPE>S</TYPE><ID>L9</ID><NUMBER>514</NUMBER><MESSAGE>Delivery 80817129 created</MESSAGE><LOG_NO/><LOG_MSG_NO>000000</LOG_MSG_NO><MESSAGE_V1>80817129</MESSAGE_V1><MESSAGE_V2/><MESSAGE_V3/><MESSAGE_V4/><PARAMETER>GOODSMVT_HEADER</PARAMETER><ROW>0</ROW><FIELD/><SYSTEM>SP1330</SYSTEM></item></RETURN></TABLES>
    </BAPI_GOODSMVT_CREATE>

    PL Stock in transit exceeded by 200 UNT : 10000000125 3065 0005"
    the code does not matter, it is the process and the stock situation that does not allow the creation of the movement.
    you cannot receive e.g. 200 from in-transit stock  if you only have nothing in transit.
    First the goods issue has to be  performed in the shipping plant.

Maybe you are looking for