BAPI_GOODSMVT_CREATE .... GOODSMVT_CODE

Hi,
Does anybody knows what fields do i have to use when i try to use a GOODSMVT_CODE 05 ???
I belive i have to use that one cuz in MIGO i use A01 Goods Receipt R10 Other.
I'm also getting an error of my movement type (the one in the GOODSMVT_ITEM); i'm using a type 901 which was configured in SAP before. Maybe i'm missing some fields to fill.
Please help
Thx !

Hi,
Movement type 901 is not standard SAP, so is it a copy of a standard?  If so, which standard one?
Check to see if you can use 901 in transaction MB1C, if yes, GOODSMVT_CODE '05' is correct. 
Suggest you also check config OMJJ field selection to verify what fields are mandatory.  Then you know what needs to be filled.
Phyllis.

Similar Messages

  • Print GR slip using BAPI_GOODSMVT_CREATE

    Hi,
    My Output ype is configured but when i create GR via BAPI_GOODSMVT_CREATE (GOODSMVT_CODE = 03), the output is not determined.
    any help on it pls?

    Hi,
    have a look at note 520813. Especially, have a look at question 12 - "What do I have to keep in mind if I want to trigger the print output of a goods receipt or goods issue document when I execute the BAPI?".
    Cheers

  • BAPI_GOODSMVT_CREATE different VBUND error, MIGO works

    Hi,
    I am getting the following error trying to receipt goods via BAPI_GOODSMVT_CREATE.
    F5080 "Consolidated companies & and & are different". This is due to having 2 entries having vendors with different VBUNDs.
    I went through SAP notes 4152 and 183989 but they suggest to modify document type settings to allow cross-company postings. The problem is doing the same posting via MIGO works fine, but BAPI returns an error.
    Here is the (pseudo) code:
      items-material = material.
      items-plant = stany-zaklad.
      items-stge_loc = stany-sklad.          
      items-move_type = stany-rodzaj_ruchu. " 561
      items-spec_stock = stany-wskaznik_zapasow_spec. " 'O'
      items-batch = stany-numer_partii. " INITIAL
      items-entry_qnt = stany-ilosc.
      items-amount_lc = stany-kwota_w_wk.
      items-vendor = stany-dostawca.
      APPEND items.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            goodsmvt_code                 = '05'
    At document level I only set document date, posting date and header text.
    What am I missing ?
    Cheers,
    Bart

    Hi Mike,
    There is a BADI but it is not getting trigered(MB_DOCUMENT_UPDATE)while posting documents.
    Thanks,Thanks for responding.

  • Error in Bapi_GoodsMvt_Create using Purchase order

    Hi Friends,
    I am using Bapi_goodsmvt_create for Goods Receipts against Purchase order.
    The below code i have given for Goods receipts
    It shows the error like
    ID : 8J
    Err No.:182
    Message : Entry 4500000344 00040 0000 not valid; correct entry
    Please help me to correct this error.
    Thanks
    Shankar
    ===================================
    Heading Structure
    st_gm_code-gm_code          = '01'.
    st_gm_header-pstng_date = '20070930'.
    st_gm_header-doc_date = '20070930'.
    st_gm_header-gr_gi_slip_no = '970015'.
    st_gm_header-bill_of_lading = '527213'.
    st_gm_header-header_txt = 'AIR'.
    st_gm_header-ref_doc_no = '4500000344'.
    Tables - ITEM CREATE.
    itab_afs_gm_itemx-plant = '2000'.
    itab_afs_gm_itemx-deliv_numb = '80100121'.
    itab_afs_gm_itemx-stge_loc = '2110'.
    itab_afs_gm_itemx-move_stloc = '2110'.
    itab_afs_gm_itemx-po_number = '4500000344'.
    itab_afs_gm_itemx-po_item = '00040'.
    itab_afs_gm_itemx-vendor = '0000650003'.
    itab_afs_gm_itemx-vendrbatch = 'ABC123'.
    itab_afs_gm_itemx-move_type = '101'.
    itab_afs_gm_itemx-mvt_ind = 'B'.
    itab_afs_gm_itemx-material = '000000000030000227'.
    itab_afs_gm_itemx-entry_qnt = 10.
    APPEND itab_afs_gm_itemx .
    ****&& Grid values
    gr_afs-matdoc_itm     = '0001'.
    gr_afs-grid_value = '205'.
    gr_afs-withdrawn_sku = 'X'. "Final issue at sku level
    gr_afs-stock_cat = '0000000001000366'.
    APPEND gr_afs.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header           = st_gm_header
        goodsmvt_code             = st_gm_code
      TESTRUN                     = ' '
    IMPORTING
       goodsmvt_headret           = st_gm_headret
       materialdocument            = mat_doc
       matdocumentyear             =  doc_year
      TABLES
        goodsmvt_item             = itab_afs_gm_itemx
       afs_goodsmvt_sku           = gr_afs
        return                    = bapi_return.
    IF sy-subrc = 0.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDIF.
    CLEAR itab_afs_gm_itemx.
    REFRESH itab_afs_gm_itemx.
    CLEAR gr_afs.
    REFRESH gr_afs.

    Hi,
    Here is some sample code from one of my programs, which does a 551 movement type. This should get you started. Just check the RETURN table for messages, they should tell you what you are missing.
    code
    Structures for BAPI
    data: gm_header type bapi2017_gm_head_01.
    data: gm_code type bapi2017_gm_code.
    data: gm_headret type bapi2017_gm_head_ret.
    data: gm_item type table of
    bapi2017_gm_item_create with header line.
    data: gm_return type bapiret2 occurs 0.
    data: gm_retmtd type bapi2017_gm_head_ret-mat_doc.
    clear: gm_return, gm_retmtd. refresh gm_return.
    Setup BAPI header data.
    gm_header-pstng_date = sy-datum.
    gm_header-doc_date = sy-datum.
    gm_code-gm_code = '06'. " MB11
    Write 551 movement to table
    clear gm_item.
    move '551' to gm_item-move_type .
    move '000000000040001234' to gm_item-material.
    move '1' to gm_item-entry_qnt.
    move 'EA' to gm_item-entry_uom.
    move '0004' to gm_item-plant.
    move '4000' to gm_item-stge_loc.
    move '201' to gm_item-move_reas.
    Determine cost center per plant
    case xresb-werks.
    when '0004'.
    move '0000041430' to gm_item-costcenter.
    when '0006'.
    move '0000041630' to gm_item-costcenter.
    when '0007'.
    move '0000041731' to gm_item-costcenter.
    when '0008'.
    move '0000041830' to gm_item-costcenter.
    endcase.
    append gm_item.
    Call goods movement BAPI
    call function 'BAPI_GOODSMVT_CREATE'
    exporting
    goodsmvt_header = gm_header
    goodsmvt_code = gm_code
    importing
    goodsmvt_headret = gm_headret
    materialdocument = gm_retmtd
    tables
    goodsmvt_item = gm_item
    return = gm_return.
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'.
    [/code]
    Welcome to SDN! Please remember to award points for helpful answers and mark you post as solved when solved completely. Thanks.
    REgards,
    Raj.

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

  • How to post Excise Invoice in GR using BAPI BAPI_GOODSMVT_CREATE ?

    Hi,
    I want to post Goods Receipt job (MB01) through BAPI 'BAPI_GOODSMVT_CREATE'.
    But is there any parameter to post 'Excise Information' through (this/any) BAPI ?
    Pls...... answer me soon.
    thanks by advance.

    SEE THE FOLLOWING EXAMPLE
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
                                     'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
                                     'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
            include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
            include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
            include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
            include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
          errflag.
    data: begin of pcitab occurs 100,
            ext_doc(10),           "External Document Number
            mvt_type(3),           "Movement Type
            doc_date(8),           "Document Date
            post_date(8),          "Posting Date
            plant(4),              "Plant
            material(18),          "Material Number
            qty(13),               "Quantity
            recv_loc(4),           "Receiving Location
            issue_loc(4),          "Issuing Location
            pur_doc(10),           "Purchase Document No
            po_item(3),            "Purchase Document Item No
            del_no(10),            "Delivery Purchase Order Number
            del_item(3),           "Delivery Item
            prod_doc(10),          "Production Document No
            scrap_reason(10),      "Scrap Reason
            upd_sta(1),            "Update Status
          end of pcitab.
    call function 'WS_UPLOAD'
      exporting
        filename                      = p-file
        filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
      itab-move_type  = pcitab-mvt_type.
      itab-mvt_ind    = 'B'.
      itab-plant      = pcitab-plant.
      itab-material   = pcitab-material.
      itab-entry_qnt  = pcitab-qty.
      itab-move_stloc = pcitab-recv_loc.
      itab-stge_loc   = pcitab-issue_loc.
      itab-po_number  = pcitab-pur_doc.
      itab-po_item    = pcitab-po_item.
      concatenate pcitab-del_no pcitab-del_item into itab-item_text.
      itab-move_reas  = pcitab-scrap_reason.
      append itab.
    endloop.
    loop at itab.
      write:/ itab-material, itab-plant, itab-stge_loc,
              itab-move_type, itab-entry_qnt, itab-entry_uom,
              itab-entry_uom_iso, itab-po_number, itab-po_item,
                                                  pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
      TESTRUN                     = ' '
    IMPORTING
        goodsmvt_headret            = mthead
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    clear errflag.
    loop at errmsg.
      if errmsg-type eq 'E'.
        write:/'Error in function', errmsg-message.
        errflag = 'X'.
      else.
        write:/ errmsg-message.
      endif.
    endloop.
    if errflag is initial.
      commit work and wait.
      if sy-subrc ne 0.
        write:/ 'Error in updating'.
        exit.
      else.
        write:/ mthead-mat_doc, mthead-doc_year.
        perform upd_sta.
      endif.
    endif.
          FORM UPD_STA                                                  *
    form upd_sta.
      loop at pcitab.
        pcitab-upd_sta = 'X'.
        modify pcitab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          filename                      = p-file
          filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
        tables
          data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    ENDFORM.

  • BAPI_GOODSMVT_CREATE Closing scheduling line items when errors

    Hello all,
    I have an issue when running BAPI_GOODSMVT_CREATE.  If someone for instance is in a scheduling agreement when running my code.  I get a locked by user return error from the BAPI.  This is fine but the problem is the line item is closed not allowing for reprocessing when the entry is no longer locked.  When reprocessing I will get a PU Ordered quantity exceeded by 1 EA : MS9556-08 2 error message
    Any advice? Is there a way to reopen a scheduling line item?
    Here is what Im sending the BAPI  Its looped so one Goods receipt per line in my custom z table.
      ls_header-pstng_date  = sy-datum.
       ls_code-gm_code       = c_01.
       LOOP AT i_ztab ASSIGNING <lfs_ztab>.
         IF <lfs_ztab>-zgr_status IS NOT INITIAL.
           <lfs_ztab>-zgr_status  = SPACE.
           <lfs_ztab>-zgr_error   = SPACE.
           <lfs_ztab>-return_code = SPACE.
         ENDIF.
         lv_index = sy-tabix.
         ls_header-doc_date  = <lfs_ztab>-zload_dt.
         lw_goods-material   = <lfs_tab>-ematn.
         lw_goods-plant      = <lfs_ztab>-werks.
         lw_goods-stge_loc   = s_loc-low.
         lw_goods-move_type  = c_101.
         lw_goods-mvt_ind    = c_b.
         lw_goods-vendor     = <lfs_ztab>-lifnr.
         lw_goods-entry_qnt  = <lfs_ztab>-menge.
         READ TABLE li_ekpo INTO lw_ekpo
             WITH KEY ebeln = <lfs_ztab>-ebeln
                      ebelp = <lfs_ztab>-ebelp
             BINARY SEARCH.
         IF sy-subrc = 0.
           lw_goods-po_number  = <lfs_ztab>-ebeln.
           lw_goods-po_item    = <lfs_ztab>-ebelp.
           lw_goods-entry_uom  = lw_ekpo-meins.
         ELSE.
           <lfs_ztab>-zgr_status  = c_f.
           <lfs_ztab>-zgr_error   = TEXT-003. "Contract not found error
           <lfs_ztab>-return_code = c_e.
           MOVE-CORRESPONDING <lfs_ztab> to w_ztab_up.
           APPEND w_tab_up TO i_ztab_up.
           CONTINUE.
         ENDIF.
         APPEND lw_goods TO li_goods.
         CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
           EXPORTING
             GOODSMVT_HEADER               = ls_header
             GOODSMVT_CODE                 = ls_code
           IMPORTING
             MATERIALDOCUMENT              = lv_matdoc
           TABLES
             GOODSMVT_ITEM                 = li_goods
             RETURN                        = li_return.

    Hi Vinod,
            Actually there are two line items in the PO and manually when I try to create a GR for both line items,  it creates a GR but when I pass it thr' BAPI, it is generating a GR only for one Line item.
    Thanks,
    Prasad

  • BAPI_GOODSMVT_CREATE ERROR: A System Error Has Occurred While Locking

    Hi All,
    I am having a problem with a Z program that I am writing.
    Basically, it uses the BAPI mentioned in the title. The program will read excel file that is being uploaded, and then will segregate the line items by 200 lines.
    That means, if I were to upload 1000 line items, the BAPI will be called and executed 5 times (1000/200 = 5).
    However, when trying to upload 10000 line items, I received this error after around 3000 line items.
    "A system error has occurred while locking".
    This happens when IMPORT parameter TEST_RUN is set to 'X'.
    I found this after some googling: http://sap.ittoolbox.com/groups/technical-functional/sap-basis/lock-entry-system-error-1674434
    I am hoping for your expert thoughts on this.
    Thank you.

    BAPI TO Upload Inventory Data
    * GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
    *                      02 - MB31 - Goods Receipts for Prod Order
    *                      03 - MB1A - Goods Issue
    *                      04 - MB1B - Transfer Posting
    *                      05 - MB1C - Enter Other Goods Receipt
    *                      06 - MB11
    * Domain: KZBEW - Movement Indicator
    *      Goods movement w/o reference
    *  B - Goods movement for purchase order
    *  F - Goods movement for production order
    *  L - Goods movement for delivery note
    *  K - Goods movement for kanban requirement (WM - internal only)
    *  O - Subsequent adjustment of "material-provided" consumption
    *  W - Subsequent adjustment of proportion/product unit material
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
                                     'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
                                     'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
            include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
            include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
            include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
            include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
          errflag.
    data: begin of pcitab occurs 100,
            ext_doc(10),           "External Document Number
            mvt_type(3),           "Movement Type
            doc_date(8),           "Document Date
            post_date(8),          "Posting Date
            plant(4),              "Plant
            material(18),          "Material Number
            qty(13),               "Quantity
            recv_loc(4),           "Receiving Location
            issue_loc(4),          "Issuing Location
            pur_doc(10),           "Purchase Document No
            po_item(3),            "Purchase Document Item No
            del_no(10),            "Delivery Purchase Order Number
            del_item(3),           "Delivery Item
            prod_doc(10),          "Production Document No
            scrap_reason(10),      "Scrap Reason
            upd_sta(1),            "Update Status
          end of pcitab.
    call function 'WS_UPLOAD'
      exporting
        filename                      = p-file
        filetype                      = 'DAT'
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = pcitab
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   OTHERS                        = 6
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
      itab-move_type  = pcitab-mvt_type.
      itab-mvt_ind    = 'B'.
      itab-plant      = pcitab-plant.
      itab-material   = pcitab-material.
      itab-entry_qnt  = pcitab-qty.
      itab-move_stloc = pcitab-recv_loc.
      itab-stge_loc   = pcitab-issue_loc.
      itab-po_number  = pcitab-pur_doc.
      itab-po_item    = pcitab-po_item.
      concatenate pcitab-del_no pcitab-del_item into itab-item_text.
      itab-move_reas  = pcitab-scrap_reason.
      append itab.
    endloop.
    loop at itab.
      write:/ itab-material, itab-plant, itab-stge_loc,
              itab-move_type, itab-entry_qnt, itab-entry_uom,
              itab-entry_uom_iso, itab-po_number, itab-po_item,
                                                  pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
    *   TESTRUN                     = ' '
    * IMPORTING
        goodsmvt_headret            = mthead
    *   MATERIALDOCUMENT            =
    *   MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = itab
    *   GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    clear errflag.
    loop at errmsg.
      if errmsg-type eq 'E'.
        write:/'Error in function', errmsg-message.
        errflag = 'X'.
      else.
        write:/ errmsg-message.
      endif.
    endloop.
    if errflag is initial.
      commit work and wait.
      if sy-subrc ne 0.
        write:/ 'Error in updating'.
        exit.
      else.
        write:/ mthead-mat_doc, mthead-doc_year.
        perform upd_sta.
      endif.
    endif.
    *       FORM UPD_STA                                                  *
    form upd_sta.
      loop at pcitab.
        pcitab-upd_sta = 'X'.
        modify pcitab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          filename                      = p-file
          filetype                      = 'DAT'
    * IMPORTING
    *   FILELENGTH                    =
        tables
          data_tab                      = pcitab
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   OTHERS                        = 6
    endform.
    Code Formatted by: Alvaro Tejada Galindo on Dec 26, 2008 10:20 AM

  • Error while using BAPI_GOODSMVT_CREATE wiht movement type 311.

    Hi All experts,
    i am geting error msg, while using BAPI_GOODSMVT_CREATE wiht movement type 311.
    the error msg is " For reservation 0000443815 0000, no movements can be posted".
    Here is my code.
    IF I_ZMM_S_MBIB_LOT[] IS NOT INITIAL.
    *moving posting date and document date  to header
        GOODSMVT_HEADER-PSTNG_DATE = ZMM_S_MBIB_311-BUDAT.
        GOODSMVT_HEADER-DOC_DATE   =  ZMM_S_MBIB_311-BUDAT.
        LOOP AT I_ZMM_S_MBIB_LOT WHERE MENGE NE '0'.
          IF I_ZMM_S_MBIB_LOT-IND = 'X'.
    *moving material and plant ,stge_loc,qty and movement type  to header
            GOODSMVT_ITEM-MATERIAL       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-PLANT          = I_ZMM_S_MBIB_LOT-WERKS.
            GOODSMVT_ITEM-BATCH          =  I_ZMM_S_MBIB_LOT-CHARG.
            GOODSMVT_ITEM-STGE_LOC       = I_ZMM_S_MBIB_LOT-SLGORT.
            GOODSMVT_ITEM-MOVE_TYPE      = '311'.
            GOODSMVT_ITEM-ENTRY_QNT      = I_ZMM_S_MBIB_LOT-MENGE.
            GOODSMVT_ITEM-ENTRY_UOM      = I_ZMM_S_MBIB_LOT-MEINS.
            GOODSMVT_ITEM-MOVE_MAT       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-MOVE_PLANT     = I_ZMM_S_MBIB_LOT-RWERKS.
            GOODSMVT_ITEM-MOVE_BATCH     = I_ZMM_S_MBIB_LOT-UMCHA.
            GOODSMVT_ITEM-MOVE_STLOC     = I_ZMM_S_MBIB_LOT-UMLGO.
            GOODSMVT_ITEM-RESERV_NO      = I_ZMM_S_MBIB_LOT-RSNUM.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              GOODSMVT_HEADER               = GOODSMVT_HEADER
              GOODSMVT_CODE                 = '04'
          TESTRUN                       = ' '
          GOODSMVT_REF_EWM              =
            IMPORTING
          GOODSMVT_HEADRET              =
              MATERIALDOCUMENT              = MATERIALDOCUMENT
              MATDOCUMENTYEAR               = MATDOCUMENTYEAR
            TABLES
              GOODSMVT_ITEM                 = GOODSMVT_ITEM
          GOODSMVT_SERIALNUMBER         =
              RETURN                        = RETURN.
          GOODSMVT_SERV_PART_DATA       =
          EXTENSIONIN                   =
        ELSE.
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Feb 23, 2011 11:46 AM

    Hi Sachin,
    Pass the Item Number of Reservation to GOODSMVT_ITEM-RES_ITEM .
    Regards
    DKS

  • 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

  • BAPI_GOODSMVT_CREATE - Account Assignment Error

    Hi,
    I have to issue a material from unrestricted project stock to a reservation on a service order(Txn : IW32 ). I'm performing Goods issue with ref to Reservation. For this I'm using the  BAPI_GOODSMVT_CREATE
    and passing the following parameters.
    GOODSMVT_HEADER-PSTNG_DATE                     05/07/2007      
    GOODSMVT_HEADER-DOC_DATE                       05/07/2007      
    GOODSMVT_HEADER-PR_UNAME                      USERS     
    GOODSMVT_CODE                      03
    GOODSMVT_ITEM:                                             
                MATERIAL                      MAT1
                PLANT                            2000                          
                STGE_LOC                     1000                          
                BATCH                            0000001490                    
                MOVE_TYPE                   221                           
                SPEC_STOCK                     Q                             
                VAL_TYPE                       AS_RECVD                      
                ENTRY_QNT                                 1.000              
                ENTRY_UOM                      EA                            
                ENTRY_UOM_ISO                  EA                            
               RESERV_NO                      0000012829
               RES_ITEM                       0005      
    GOODSMVT_SERIALNUMBER :
               MATDOC_ITM                     0001
               SERIALNO                       12  
    When I execute this BAPI it returns me this error message:
    "Enter only one true account assignment  "  (Msgid = KI , Msgno = 249 )
    I did some analysis of this error and found that BAPI internally is finding two account assignment (1. Service order 2. Project)
    When I try to perform this goods issue from txn MB1A it executes perfectly.
    I may be missing some interface parameters.
    Does anyone have any idea about this?
    Thanks,
    Ste

    Hello Delo Celo,
    Please, take a look on fololwing note:
    1046794 FAQ: BAPI for outline agreement
    3.  Question:
    You use either BAPI_SAG_CREATE or BAPI_CONTRACT_CREATE to create a scheduling agreement or a contract with some accounting data. Why is the accounting data not always taken into account?
    Answer:
    Please revise your accounting test data and ensure that a valid value for the serial number is given. Please observe that even for single account assignment the value '01' has to be provided in the field
    corresponding to SERIAL_NO in both tables ACCOUNT and ACCOUNTX.
    Also, please refer following note:
    1339645 BAPI_SAG_CREATE - E06 076
    Hope it helps to solve the issue.
    Cheers,
    Eduardo Junior

  • Regarding BAPI_GOODSMVT_CREATE

    Hi Experts!
    I am using BAPI_GOODSMVT_CREATE to create a material document in migo screen using mb01 transaction.
    I am getting one error that is whenever i put the quantity in , for example
    if ordered quantity is 20 and i put quantity in unit of entry 21 it does not qive me error that p0 exceeded by 1. and post the data.
    but after 24 it gives me an error which it has to given earlier 'po exceeded by 4'.
    i am using gm_code = 01
    with kzbew = B.
    also populating fields like
    matnr, po, po item, entry_qnt, movement type = 101
    posting date, document date and reference document.
    so plz help me out with that.
    thanks in advance

    Hi
    Check this and do accordingly
    REPORT ZRICH_0001 .
    Structures for BAPI
    DATA: GM_HEADER  TYPE BAPI2017_GM_HEAD_01.
    DATA: GM_CODE    TYPE BAPI2017_GM_CODE.
    DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
    DATA: GM_ITEM    TYPE TABLE OF
                     BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
    DATA: GM_RETURN  TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: GM_RETMTD  TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
    CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
    Setup BAPI header data.
    GM_HEADER-PSTNG_DATE = SY-DATUM.
    GM_HEADER-DOC_DATE   = SY-DATUM.
    GM_CODE-GM_CODE      = '04'.                                " MB1A
    Write 971 movement to table
    CLEAR GM_ITEM.
    MOVE '412'                 TO GM_ITEM-MOVE_TYPE     .
    MOVE 'Q'                 TO GM_ITEM-SPEC_STOCK.
    MOVE '3800533484'  TO GM_ITEM-MATERIAL.
    MOVE '1'     TO GM_ITEM-ENTRY_QNT.
    *MOVE 'PC'    TO GM_ITEM-ENTRY_UOM.
    MOVE '1060'  TO GM_ITEM-PLANT.
    MOVE '0007'  TO GM_ITEM-STGE_LOC.
    *MOVE '0901'   TO GM_ITEM-MOVE_REAS.
    MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
    MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
    APPEND GM_ITEM.
    Call goods movement BAPI
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         EXPORTING
              GOODSMVT_HEADER  = GM_HEADER
              GOODSMVT_CODE    = GM_CODE
         IMPORTING
              GOODSMVT_HEADRET = GM_HEADRET
              MATERIALDOCUMENT = GM_RETMTD
         TABLES
              GOODSMVT_ITEM    = GM_ITEM
              RETURN           = GM_RETURN.
    IF NOT GM_RETMTD IS INITIAL.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ELSE.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ENDIF.
    WRITE:/ GM_RETMTD.
    LOOP AT GM_RETURN.
      WRITE:/ GM_RETURN.
    ENDLOOP.
    check the BAPI_GOODSMVT_CREATE.
    Functionality
    You can use this method to create a material document for a goods movement.
    You can only create one material document each time you call up the method.
    You can use a simulation function before posting the goods movement to check how the data is updated in the database. The standard system is configured so that the goods movement is posted immediately without simulating beforehand.
    Ensure that you transfer the data in the same way as it is run in the database, for example,
    Material number 18-figure with leading zeros
    Batches with uppercase letters
    Note that for all transactions/events listed below, the posting date is entered in the header data of the material document. In the BAPI2017_GM_HEAD_01 interface, fill the PSTNG_DATE (import structure GOODSMVT_HEADER) field.
    Notes
    Authorization check check
    In the MM Inventory Management component, the method does not execute any authorization checks.
    Note that during a posting of a goods movement, depending on the business transaction of the system, authorization objects of other applications can also be checked.
    Transfer
    The following information about the material document that is to be created is transferred to the method:
    a structure with header data
    a structure with the code for the movement
    a table with the item data
    a table with the serial numbers
    The posting is carried out in the SAP R/3 via the MB_CREATE_GOODS_MOVEMENT function module.
    Confirmations
    Messages are returned in the Return parameter. The parameter documentation shows the return codes and their meanings.
    Further Information
    The method can only carry out your function if no error messages were generated in the Return table. This is the case if the header data and all the items were processed successfully.
    Transaction control is not implemented. The calling program therefore has to execute the Commit Work itself after this method has been successfully called (in other words, if no errors were reported in the Return parameter).
    Which fields have to be filled during the various transactions/ events?
    The following sample scenarios demonstrate which fields have to be filled for which business transactions/events (code).
    There are the following types of transactions/events:
    1. GM_Code 01: Goods receipt for purchase order
    2. GM_Code 02: Goods receipt for production order
    3. GM_Code 03: Goods issue
    4. GM_Code 04: Transfer posting
    5. GM_Code 05: Other goods receipts
    6. GM_Code 06: Reversal of goods movements
    7. GM_Code 07: Subsequent adjustment to a subcontract order
    Entering the movement indicator
    Depending on the transaction, you must enter the following in the movement indicator:
    GM_Code 01 (Goods receipt for purchase order): B
    GM_Code 02 (Goods receipt for production order): F
    For all other transactions, you leave the field blank.
    For 1: GM_Code 01: Goods receipt for purchase order
    Purchase order known
    The following fields have to be filled:
    Purchase order
    Purchase order item
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry or
    quantity proposal
    The following fields may have to be filled in some cases (incomplete listing):
    Shelf life expiration date (if it has been configured like this in the system)
    Reason for movement (if it has been configured like this in the system)
    Batch (if the material is handled in batches and batch numbers are not assigned automatically)
    Storage location (if a storage location has not been specified in the purchase order item)
    The following fields can be filled (incomplete listing):
    Stock type
    Item text
    Unloading point
    Delivery completed indicator
    You cannot fill the following fields (incomplete listing):
    Account assignment fields (account assignment is adopted from the purchase order)
    Reservation
    Receiving/issuing material
    Receiving/issuing plant
    Receiving/issuing storage location
    In the case of a purchase order item with the "subcontracting" item category, only the GR item in the interface is to be transferred. The system automatically determines GI items.
    Purchase order unknown: Shipping notification known
    The following fields have to be filled:
    Delivery
    Delivery item
    Movement type
    Other fields, such as those under "Purchase order known". The system determines the relevant purchase order item via the delivery/delivery item.
    Purchase order unknown: Purchase order should be created automatically
    The following fields have to be filled:
    Material number
    Plant
    Storage location
    Vendor
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    The following fields may have to be filled in some cases (incomplete listing):
    Shelf life expiration date (if it has been configured like this in the system)
    Reason for movement (if it has been configured like this in the system)
    Batch (if the material is handled in batches and batches are not assigned automatically)
    The following fields can be filled (incomplete listing):
    Stock type
    Item text
    Unloading point
    You cannot fill the following fields (incomplete listing):
    Account assignment fields (automatic creation of purchase order items with account assignment is not supported)
    Reservation
    Receiving/issuing material
    Receiving/issuing plant
    Receiving/issuing storage location
    Purchase order unknown: A purchase order should not be created
    The following fields have to be filled:
    Material number
    Plant
    Storage location
    Vendor
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    The following fields may have to be filled in some cases (incomplete listing):
    Shelf life expiration date (if it has been configured like this)
    Reason for movement (if it has been configured like this)
    Batch (if the material is handled in batches and automatic assignment of batch numbers is not set)
    The following fields can be filled (incomplete listing):
    Special stock indicator
    Item text
    Unloading point
    Goods recipient
    The following fields cannot be filled (incomplete listing):
    Account assignment fields (automatic creation of purchase order items with account assignment is not supported)
    Reservation
    Receiving/issuing material
    Receiving/issuing plant
    Receiving/issuing storage location
    Receiving/issuing batch
    The input combinations listed above for the GM_CODE 01 can be combined within an input table so that they can be posted in a material document. Items can also be posted for different purchase orders, provided that all the purchase orders refer to the same vendor.
    Transfer of subcontracting components
    During the posting of the ordered material of a subcontract order with movement type 101, for the transfer of the subcontracting components, the filled unique identification of the document line (LINE_ID) is also required.
    More information on LINE_ID and PARENT_ID
    The following fields have to be filled for the components:
    Unique identification of the document line
    Identification of the immediately superior line
    Material number
    Plant
    Storage location
    Quantity in unit of entry
    The following fields can be filled for the components:
    All other fields in the method that are included in this list.
    The following fields cannot be filled for the components:
    All fields that are not included in the list above. The movement indicator must be initial.
    Additional fields in goods-receipt-based invoice verification
    When you post a goods receipt to purchase order with movement type 102, an issue with reference to a previously posted goods issue, the following fields must also be transferred:
    REF_DOC_IT (LFPOS): Item of a reference document
    REF_DOC (LFBNR): Document number of a reference document
    REF_DOC_YR (LFBJA): Fiscal year of a reference document
    Only when you transfer these fields is it guaranteed that the reference to the original goods movement stay the same.
    For 2 GM_Code 02: Goods receipt for production order
    The following fields have to be filled:
    Order
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry or
    quantity proposal
    The following fields may have to be filled in some cases (incomplete listing):
    Shelf life expiration date (if the system has been configured like this)
    Reason for movement (if the system has been configured like this)
    Batch (if the material is handled in batches and automatic batch number assignment is not set)
    Storage location (if storage location has not been specified in the order)
    The following fields can be filled (incomplete listing):
    Order item (co-product)
    Stock type
    Item text
    Unloading point
    "Delivery completed" indicator
    The following fields cannot be filled (incomplete listing):
    Account assignment fields (the account assignments are adopted from the purchase order)
    Reservation
    Receiving/issuing material
    Receiving/issuing plant
    Receiving/issuing storage location
    Receiving/issuing batch
    For 3 GM_Code 03: Goods issue
    Goods issue without reference to a reservation
    The following fields have to be filled:
    Material number
    Plant
    Storage location
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    The following fields may have to be filled in some cases (incomplete listing):
    Special stock (e.g. sales order, project, vendor etc.)
    Shelf life expiration date (if the system is configured like this)
    Reason for movement (if the system has been configured like this)
    Batch (if the material is handled in batches and automatic batch number assignment is not set)
    Account assignment fields
    The following fields can be filled (incomplete listing):
    Special stock indicator
    Item text
    Unloading point
    Goods recipient
    The following fields cannot be filled (incomplete listing):
    Reservation
    Receiving/issuing material
    Receiving/issuing plant
    Receiving/issuing storage location
    Receiving/issuing batch
    Goods issue with reference to a reservation
    The following fields have to be filled:
    Reservation number
    Reservation item
    Record type of the reservation
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    The following fields may have to be filled in some cases (incomplete listing):
    Shelf life expiration date (if this has been configured in the system)
    Reason for movement (if this has been configured in the system)
    Batch (if the material is handled in batches and automatic batch number assignment is not set)
    Storage location (if not planned in the reservation)
    The following fields can be filled (incomplete listing):
    Special stock indicator
    Item text
    Unloading point
    Goods recipient
    The following fields cannot be filled (incomplete listing):
    Movement type
    Material
    Plant
    Account assignment fields
    For 4 GM_Code 04: Transfer posting
    Transfer posting without reference to a reservation
    The following fields have to be filled:
    Material number
    Plant
    Storage location
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    The following fields may have to be filled in some cases (incomplete listing):
    Receiving material
    Receiving plant
    Receiving storage location
    Receiving batch (if material is handled in batches and you want to change batches)
    Receiving/issuing special stock (e.g. sales order, project, vendor etc.)
    Shelf life expiration date (if this has been configured in the system)
    Reason for movement (if this has been configured in the system)
    Batch (if the material is handled in batches and automatic batch number assignment is not set)
    The following fields can be filled (incomplete listing):
    Special stock indicator
    Item text
    Account assignment fields (for automatic posting lines: Expense/income from stock transfer)
    The following fields cannot be filled (incomplete listing):
    Reservation
    Transfer posting with reference to a reservation
    See goods issue with reference to a reservation
    For 5 GM_Code 05: Other goods receipts
    Other goods receipt without reference to a reservation
    See goods issue without reference to a reservation
    Other goods receipt with reference to a reservation
    See goods issue with reference to a reservation
    For 6 GM_Code 06: Reversal of goods movements
    You can use the Cancel method to reverse goods movements. But you may also want to cancel a goods movement without referring to a material document (see the Cancel method).
    If you want to work without referring to the document, you have to fill the field BAPI_GM_ITEM_CREATE-XSTOB in the interface (import table GOODSMVT_ITEM). In this case, the system converts the movement type assigned in the interface to the reversal movement type. Alternatively, you can set the reversal movement type in the interface. In this case, the BAPI_GM_ITEM_CREATE_XSTOB field must be transferred blank.
    If you want to cancel a goods movement with reference to a reservation (without using the Cancel method) you can only transfer the field BAPI_GM_ITEM_CREATE_XSTOB if it is filled. Movement types are not transferred when you post with reference to a reservation, as the movement type is contained in the reservation item.
    For 7. GM_Code 07: Subsequent adjustment to a subcontract order
    Ordered material of subcontract order
    The following fields have to be filled:
    Unique identification of document line (can be assigned to anything)
    Posting date in document header
    Document number of purchasing document
    Item number of purchasing document
    Material number check
    Plant check
    Movement type (select movement type 121)
    Movement indicator (must be O)
    Further entries are not allowed. The entry quantity for the ordered material of a subcontract order must be zero.
    Components
    The following fields have to be filled:
    Unique identification of document line (can be assigned to anything)
    Identification of the immediately superior line
    Plant
    Material number check
    Quantity in unit of entry; can also be negative
    The following fields can be filled:
    Storage location
    All other fields in the method that are included in this list.
    The following fields may not be filled:
    All fields that are not in the list above. The movement indicator must be blank.
    More information on LINE_ID and PARENT_ID
    Additional fields in goods-receipt-based invoice verification
    When you post a subsequent adjustment, the following fields must also be transferred:
    REF_DOC_IT (LFPOS): Item of a reference document
    REF_DOC (LFBNR): Document number of a reference document
    REF_DOC_YR (LFBJA): Fiscal year of a reference document
    Only when you transfer these fields is it guaranteed that the reference to the original goods movement stays the same.
    Regards
    Anji

  • BAPI_GOODSMVT_CREATE - posting extra lines (amount being multiplied by 100)

    Hello Gurus,
    I am using BAPI_GOODSMVT_CREATE for posting.
    When I check FBL3N, i see 2 lines:
    The first one is correct while the second is a copy of the first one, with the exeception that the amount in Local Currency has been multiplied by 100. And this second line is not required.
    I am passing only one line to the BAPI and I get 2 lines as output.
    Has anyone encountered this problem before?
    Thanks for your precious help.
    Regards,
    Parvez

    Hello,
    Here are some more information:
    goodsmvt_code-gm_code    = '02'.
    goodsmvt_item-move_type      = '101'.
    The posting done in NISL is in fact done twice in SAP ECC6 :
    a)      at normal standard price of the materials
    b)      at standard price * 100 (current issue).
    In 46C version, the posting was done only once at the standard price of the material. (correct)
    In SAP ECC6, 2 postings are done:
                - Posting a) correct.
                - Posting b) multiplied by 100 should not exist. This error should be corrected.
    seem to be related to the upgrade?
    Any hint on this?
    Thanks

  • Bapi_goodsmvt_create: no error return, but no document created!

    Hi guys!
    I have i weired problem.
    I'm using the bapi_goodsmvt_create to create a goods receipt document for a standard order.
    The simulation works fine, no error or warning return, the bapi_goodsmvt_create  without simulation flag works fine, bapi_transaction_commit returns no error as well, BUT: the document was not created.
    Any idea about the problem?

    Commit the work ..
    This code might help u
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header       = wa_header
          goodsmvt_code         = wa_gm_code
        IMPORTING
          goodsmvt_headret      = tbl_export
          materialdocument      = matdoc
          matdocumentyear       = year
        TABLES
          goodsmvt_item         = tbl_item
          goodsmvt_serialnumber = tbl_serial
          return                = return.
      WRITE AT 10 'STATUS OF BAPI UPLOAD' COLOR 2 INTENSIFIED ON .
      SKIP 2.
      LOOP AT return ASSIGNING <fs_return>.
        IF <fs_return>-type EQ 'E'.
          WRITE AT 10 'Error in function:' COLOR 6 INTENSIFIED OFF.
          WRITE AT 28 <fs_return>-message .
          SKIP 1.
          err_flag = 'X'.
        ELSE.
          WRITE AT 10 <fs_return>-message .
          SKIP 1.
        ENDIF.
      ENDLOOP.
      IF err_flag IS INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        IF sy-subrc NE 0.
          WRITE:/ 'Error in updating'.
          EXIT.
        ELSE.
          WRITE:/
    'Number of Material Document created through BAPI:',tbl_export-mat_doc.
          WRITE:/ 'Material Document Year':, tbl_export-doc_year.
        ENDIF.
      ENDIF.

  • BAPI_GOODSMVT_CREATE Material Document Posting against Process Order

    Dear Experts,
                        I want to post more than one documents from BAPI "BAPI_GOODSMVT_CREATE". It is working fine for GR(gmcode = 02) 101 Mvt. type. But the problem is that when there is a GI (gmcode = 03), serial numbers document comes; it display an error as " Content of order 1000400: 40000134 transferred to interface (IMSEG)".
    My Question is that: Is this a correct BAPI for serial numbers assigned materials, OR I should use another bapi for these serial number materials.
    Will you please let me know the name of the BAPI which I should use in this regards.
    ***** I am using BAPI_GOODSMVT_CREATE as follows for Process Orders:::::
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header               = gmhead
            goodsmvt_code                 = gmcode
    *   TESTRUN                       = ' '
    *   GOODSMVT_REF_EWM              =
    * IMPORTING
    *   GOODSMVT_HEADRET              =
    *   MATERIALDOCUMENT              =
    *   MATDOCUMENTYEAR               =
          TABLES
            goodsmvt_item                 = fitab "bapi_itab
            goodsmvt_serialnumber         = itab_serials
            return                        = errmsg
    *   GOODSMVT_SERV_PART_DATA       =
    *   EXTENSIONIN                   =
    Thanks,
    Sohail

    The function is intended to create a single document , Here is an excerpt from the FM documentation :
    Functionality
    You can use this method to create a material document for a goods movement.
    You can only create one material document each time you call up the method.
    You can use a simulation function before posting the goods movement to check how the data is updated in the database. The standard system is configured so that the goods movement is posted immediately, without prior simulation.

Maybe you are looking for

  • Oracle Query Performance While calling a function in a View

    Hi, We have a performance issue in one of our Oracle queries. Here is the scenario We use a hard coded value (which is the maximum value from a table) in couple of DECODE statements in our query. We would like to remove this hard coded value from the

  • Raw files in aperture photo books

    Hi, I'm creating my first aperture photo book. I uploaded raw files to aperture, made adjustments, and then placed the versions into the book. It is these versions (with all crops, adjustments, etc.) that will show up in my photo book, correct? (That

  • Error -29400ORA-29400: data cartridge error IMG-00714: internal error

    Hi, I have a table with a blob column containing images, not intermedia column. I am using intermedia process method to change some images, change maxScale and compression. I get this error when I try to change certain images -29400ORA-29400: data ca

  • App-V 4.6 Powershell script deleteting all shortcuts

    Hello, °not sure if this is more of a powershell issue or app-v issue, feel free to move my topic to the right forum° Now we have a nice script in production that is supposed to delete all obsolote App-v shortcuts, once  a pc starts. this does very w

  • Multiline element through Mail

    Hi Friends, I am trying to send a multiline attribute value through send mail in workflow. The attribute has a line type TLINE (Char 79). I have it as an event parameter. Whenever i raise an event i pass a table with 3 lines through the INPUT_CONTAIN