BAPI_GOODSMVT_CREATE - Amount_SV Error

Dear All
I am creating the material movement documetn 561 (MB1C) using BAPI_GOODSMVT_CREATE. 
I am passing Price to the field AMOUNT_SV.
Howeever, the BAPI returns me the error saying
IMSEG-WAERS initial v., currency amount 100.0000 in AMOUNT_SV was transferred without a currency
Can someone help me where to set the Currenty reference in this BAPI. 
I searched the forum and not able to find it.
<removed by moderator>
Regards,
Venkat
Edited by: Thomas Zloch on Jan 9, 2012

Hi
I verified the above function in SE37 and it returns SAR .. which is correct.
Upon debugging, in curency determination routine it is returning Blank.
Is there anything related to the move ment indicator - B.. 
I am doing this for movement type 561
Regards,
Venkat

Similar Messages

  • 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 costcenter error

    Hi,
    I try to use BAPI_GOODSMVT_CREATE for goods movement of type 201.
    When I had to send COSTCENTER parameter with the BAPI, Iit started to give errors such like "Cost center xxxx/yyyy does not exist on dd.mm.yyyy." but I'm sure that cost center exists in this period. Probabily error is something else. So I think I have to send some other parameters to BAPI but I'm not sure which one. Here I my parameters :
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date   = sy-datum.
    gmhead-pr_uname   = sy-uname.
    gmhead-ref_doc_no = DOC_ID.
    gmcode-gm_code  = GM_CODE.
    itab-mvt_ind    = ''.
    itab-plant      = '0001'.
    itab-material   = PART_NO.
    itab-entry_qnt  = AMOUNT.
    itab-entry_uom  = ''.
    itab-move_type  = MOVE_TYPE.
    itab-stge_loc   = STORAGE.
    itab-move_stloc = STORAGE_MOVE.
    itab-batch      = BATCH.
    itab-spec_stock = SPEC_STOCK.
    itab-vendor     = CONS.
    itab-costcenter = COSTCENTER.
    So do you have any idea what can be the error? Before I sent costcenter to the BAPI, everything was correct.
    Thanks...

    Unfortunately I have another problem now.
    When the SPEC_STOCK is "K", I give the vendor to the BAPI. But this time I get error
    "Account XXXXXXXXXX requires an assignment to a CO object"
    And again it is possible to make goods movement by MB1A transaction. And also it was possible to run BAPI before I give COSTCENTER parameter with special stock "K". So I think it has to be given a default value for some parameter. But I have no idea which one..
    Thanks...

  • BAPI_GOODSMVT_CREATE giving error  purchase order is locked by user

    I am calling multiple times BAPI_GOODSMVT_CREATE for same Purchase order to post goods receipt.
    first goods receipt created successfully but second one has given the error the Purchase order is lockecd by USER 'XXXX' .
    i am calling 'BAPI_TRANSACTION_COMMIT after each BAPI BAPI_GOODSMVT_CREATE.
    i tried with passing parameter WAIT = 'X' in 'BAPI_TRANSACTION_COMMIT. then also getting same error message.
    please any one tell me the solution

    Hi
    1. Check all the call is handled the release function(JCO.releaseClient(client)) for each call.
    2. And check in finally
    finally {
         try {
         if (client != null) {
           JCO.removeClientPool(SID);
           JCO.releaseClient(client);
         if(client.isAlive()){
              client.disconnect();
           JCO.releaseClient(client);                    }
         } catch (JCO.Exception ex) { }
    Kind Regards
    Mukesh

  • Calling multiple times BAPI_GOODSMVT_CREATE getting error

    Hi Friends,
    I am calling multiple times BAPI_GOODSMVT_CREATE for same Purchase order to post goods receipt.
    for the first 4 times it is creating the GR successfully, but then it returning the message 'No goods receipt possible for purchase order 4500001004 01350'.
    Please help.
    Thanks
    Ravi

    Use Wait up to statement in loop.
    Ex:
    loop at it_filedir1.
        REFRESH I_TAB.
        CLEAR I_TAB.
       REFRESH I_TAB2.
       REFRESH ITAB1.
        data: g_file(100) type c .
        name = it_filedir1-name.
        concatenate: gfile '\' name into g_file.
        data : i_tab1(500).
        OPEN DATASET g_file FOR INPUT IN TEXT MODE
                                         ENCODING DEFAULT
                                         IGNORING CONVERSION ERRORS.
        IF SY-SUBRC EQ 0.
          DO.
            READ DATASET g_file INTO i_tab1.
            if sy-subrc = 0.
              split i_tab1 at ',' into  I_TAB-SOL_DOCNO I_TAB-SOL_DOCDT
               I_TAB-GI_TXN_TYPE I_TAB-WERKS I_TAB-LGOBE I_TAB-MATNR
               I_TAB-ERFMG I_TAB-ERFME.
            else.
              exit.
            endif.
            APPEND I_TAB.
            clear I_TAB.
          ENDDO.
        ENDIF.
        CLOSE DATASET g_file.
        concatenate: hfile '\' name into h_file.
        REFRESH I_MAIN.
        CLEAR I_MAIN.
        I_MAIN[] = I_TAB[].
        REFRESH I_OUT.
        CLEAR I_TAB.
        I_OUT[] = I_TAB[].
        DELETE ADJACENT DUPLICATES FROM I_TAB COMPARING SOL_DOCNO.
        SORT I_TAB BY SOL_DOCNO.
        LOOP AT I_TAB.
          count = sy-tabix.
          SELECT SINGLE * FROM ZMM_GI_WIP
                                    WHERE GI_NO = I_TAB-SOL_DOCNO AND
                                    GI_DATE = I_TAB-SOL_DOCDT.
          IF SY-SUBRC = 0.
            I_TAB-FLAG = 'C'.
            modify i_tab index count.
            CONCATENATE 'ERROR  GI : ' I_TAB-SOL_DOCNO
            '  WAS ALREADY UPLOADED' INTO I_MSG1.
            APPEND I_MSG1.
            CLEAR I_TAB-FLAG.
            CONTINUE.
          ELSE.
            CONCATENATE I_TAB-SOL_DOCDT+4(2)
                        I_TAB-SOL_DOCDT+6(2)
                        I_TAB-SOL_DOCDT+2(2)
                        I_TAB-SOL_DOCDT+0(2)
                        INTO G_DATE.
            gmhead-pstng_date = G_DATE.
            gmhead-doc_date = sy-datum.
            gmhead-pr_uname = sy-uname.
    "01 - MB01 - Goods Receipts for Purchase Order
            gmcode-gm_code = '03'.
            refresh itab.
            clear itab.
            SORT I_MAIN BY SOL_DOCNO.
            LOOP AT I_MAIN WHERE SOL_DOCNO = I_TAB-SOL_DOCNO.
              IF I_MAIN-GI_TXN_TYPE = 'RMGI'.
                itab-move_type  = '291'.
              ENDIF.
              itab-mvt_ind    = ' '.
              itab-plant      = I_MAIN-WERKS.
              itab-material   = I_MAIN-MATNR.
              itab-entry_qnt  = I_MAIN-ERFMG.
             itab-stge_loc   = 'OMR1'.
    itab-move_stloc = pcitab-recv_loc.
              itab-stge_loc   = I_MAIN-LGOBE.
              itab-ENTRY_UOM = I_MAIN-ERFME.
              IF I_MAIN-WERKS = 'OMR'.
                itab-TR_PART_BA = '11'.
              ELSEIF I_MAIN-WERKS = 'OMR'.
                itab-TR_PART_BA = '12'.
              ENDIF.
              append itab.
            ENDLOOP.
            if not itab[] is initial.
              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.
                move errmsg-message to i_msg1.
                append i_msg1.
              endloop.
              if errflag is initial.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT          =
              IMPORTING
                RETURN        =
               commit work and wait.
                if sy-subrc ne 0.
                  write:/ 'Error in updating'.
                  exit.
                else.
                  write:/ mthead-mat_doc, mthead-doc_year.
                  ZMM_GI_WIP-GI_NO = I_TAB-SOL_DOCNO.
                  ZMM_GI_WIP-GI_DATE = I_TAB-SOL_DOCDT.
                  INSERT ZMM_GI_WIP.
                  COMMIT WORK.
                  I_TAB-FLAG = 'C'.
                  MODIFY I_TAB INDEX COUNT.
                  CONCATENATE mthead-mat_doc  mthead-doc_year
                             into i_msg1.
                  append i_msg1.
                 perform upd_sta.
                endif.
              endif.
            endif.
          ENDIF.
           wait up to 20 seconds.
        ENDLOOP.

  • Goods issue using bapi  BAPI_GOODSMVT_CREATE getting error E M7

    HI  consultants,
    While  posting goods issue using bapi BAPI_GOODSMVT_CREATE . Running the batch job(zprogram) to post the goods issue . The goods issue is been posted by passing  goods receipt data's.
    while processing 3 goods receipt , 2 works fine one goods receipt getting  E M 7 300 NO ITEMS ARE TRANSFERED error.
    when i  processing one by one all the 3 goods receipt is working fine and process sucessfully. While processing in bulk ,i am getting this issue.
    If anybody faces this same problem or knows the solution .Please post the answer.
    The way i am passing the parameter to bapi given bellow.
        WA_GOODSMVT_CODE-GM_CODE = C_03.
    *--populate header data
        WA_GOODSMVT_HEADER-DOC_DATE   = WA_MKPF-BLDAT.
        WA_GOODSMVT_HEADER-PSTNG_DATE = WA_MKPF-BUDAT.
    *--populate item data      
    *-- call the bapi for posting goods issue
                 IT_GOODSMVT_ITEM-NETWORK     = WA_RESBP-AUFNR.
                IT_GOODSMVT_ITEM-RESERV_NO   = WA_RESBP-RSNUM.
                IT_GOODSMVT_ITEM-RES_ITEM    = WA_RESBP-RSPOS.
                IT_GOODSMVT_ITEM-ACTIVITY    = WA_RESBP-VORNR.
                IT_GOODSMVT_ITEM-MOVE_TYPE   = C_281.
                IT_GOODSMVT_ITEM-ENTRY_QNT   = WA_RESBP-NET.
    *--get the item details
                  IT_GOODSMVT_ITEM-MATERIAL   = WA_MSEG-MATNR.
                  IT_GOODSMVT_ITEM-PLANT      = WA_MSEG-WERKS.
                  IT_GOODSMVT_ITEM-STGE_LOC   = WA_MSEG-LGORT.
                  IT_GOODSMVT_ITEM-ENTRY_UOM  = WA_MSEG-ERFME.
                  CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
                    EXPORTING
                      INPUT  = WA_MSEG-PS_PSP_PNR
                    IMPORTING
                      OUTPUT = WA_PSPHI_TEMP.
                  IT_GOODSMVT_ITEM-WBS_ELEM   = WA_PSPHI_TEMP.
                  APPEND IT_GOODSMVT_ITEM.  
                CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
                  EXPORTING
                    GOODSMVT_HEADER  = WA_GOODSMVT_HEADER
                    GOODSMVT_CODE    = WA_GOODSMVT_CODE
                  IMPORTING
                    MATERIALDOCUMENT = WA_MATERIALDOCUMENT
                  TABLES
                    GOODSMVT_ITEM    = IT_GOODSMVT_ITEM
                    RETURN           = IT_RETURN.
    With Regards,
    Ambrose Mohandoss.

    Problem solved.

  • BAPI_GOODSMVT_CREATE new error

    Hi Gurus,
            I m trying to create a goods receipt thr'
    BAPI_GOODSMVT_CREATE,
    Here is the code-
    *& Header data
        REFRESH goodsmvmt_header.
        goodsmvmt_header-pstng_date = sy-datum.
        goodsmvmt_header-doc_date = sy-datum.
        goodsmvmt_header-ref_doc_no = 'Test'
        APPEND goodsmvmt_header.
    *& Process the type of movement
        REFRESH goodsmvmt_code.
        goodsmvmt_code-gm_code = '01'.
        APPEND goodsmvmt_code.
    *& Process the line items for the material document
        REFRESH goodsmvmt_item.
        goodsmvmt_item-PO_NUMBER = display_itab-ebeln.
        goodsmvmt_item-PO_ITEM = display_itab-ebelp.
        goodsmvmt_item-MVT_IND = 'B'.
        goodsmvmt_item-material = display_itab-matnr.
        goodsmvmt_item-plant = display_itab-werks.     
        goodsmvmt_item-stge_loc = display_itab-lgort. 
        goodsmvmt_item-entry_qnt = display_itab-menge.
        goodsmvmt_item-move_type = '101'.        
        goodsmvmt_item-STCK_TYPE = space.
       goodsmvmt_item-SPEC_STOCK = '+'.
        APPEND goodsmvmt_item.
    *& Refreshing document and return tables
        REFRESH goodsmvmt_document.
        REFRESH goodsmvmt_return.
    *& call function bapi....
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header  = goodsmvmt_header
            goodsmvt_code    = goodsmvmt_code
          IMPORTING
            goodsmvt_headret = goodsmvmt_document
          TABLES
            goodsmvt_item    = goodsmvmt_item
            return           = goodsmvmt_return.
    This is giving me following error in return parameter-
    <b>Inconsistency between a document field and the prof. segment number</b>
    Any help will be appriciated.
    Prasad

    Hi Prasad,
    Please go through the following code which is working good without any inconsistency errors.
    Hope this will be helpful for you.
    INITIALIZATION.
    START-OF-SELECTION.
    Mandatory Include for Client Check
      INCLUDE ZZIMANDT.
      E_HEADER-PSTNG_DATE = SY-DATUM.
      E_HEADER-DOC_DATE = SY-DATUM.
      APPEND E_HEADER.
    Opening the Data file
      PERFORM READ_WIRELESS_DATA.
      PERFORM MATCH_ORDERS.
      PERFORM CLEAR_INPUT_FILES.
    TOP-OF-PAGE.
      FORMAT COLOR COL_HEADING ON.
      WRITE : / SY-VLINE,
               15 'Wireless Resale Daily Processing Report',
               90 SY-VLINE.
      ULINE 0(90).
      WRITE : / SY-VLINE,
               2 'Svc Ord',
              13 SY-VLINE,
              14 'Material',
              25 SY-VLINE,
              26 'Qty',
              32 SY-VLINE,
              33 'Ord date',
              42 SY-VLINE,
              43 'Gl Acct',
              54 SY-VLINE,
              55 'Co',
              60 SY-VLINE,
              61 'Sub Mkt',
              68 SY-VLINE,
              69 'Result',
              85 SY-VLINE,
              86 'MVT',
              90 SY-VLINE.
    ULINE 0(90).
    END-OF-PAGE.
    END-OF-SELECTION.
    END OF PROGRAM ******************************
    FORM READ_WIRELESS_DATA.
      OPEN DATASET U_MERC FOR INPUT IN TEXT MODE.
      OPEN DATASET F_CSTR FOR INPUT IN TEXT MODE.
      OPEN DATASET F_CTEL FOR INPUT IN TEXT MODE.
      PERFORM SPLIT_FILE.
      CLOSE DATASET F_CSTR.
      CLOSE DATASET F_CTEL.
      CLOSE DATASET U_MERC.
    ENDFORM.
    *&      Form  SPLIT_FILE
          text
    -->  p1        text
    <--  p2        text
    FORM SPLIT_FILE.
      DO.
        READ DATASET U_MERC  INTO OMSDATA.
        IF OMSDATA-RECORD IS INITIAL.
          EXIT.
        ELSE.
          APPEND OMSDATA.
          CLEAR OMSDATA.
        ENDIF.
      ENDDO.
      LOOP AT OMSDATA.
        SPLIT OMSDATA-RECORD AT ',' INTO
           I_OMSW-ZSERVICE_ORD
           I_OMSW-ZMATNR
           I_OMSW-ZQTY
           I_OMSW-ZORD_DT
           I_OMSW-ZGL_ACCT
           I_OMSW-ZBUKRS
           I_OMSW-ZSUB_MKT
           I_OMSW-ZCURR_DT
           I_OMSW-ZCURR_TIME.
        I_OMSW-ZPROCESS_FLAG = ' '.
        UNPACK I_OMSW-ZMATNR TO I_OMSW-ZMATNR.
        UNPACK I_OMSW-ZGL_ACCT TO I_OMSW-ZGL_ACCT.
        APPEND I_OMSW .
        CLEAR I_OMSW.
      ENDLOOP.
      SELECT * FROM ZMMOMSW INTO I_OMSW WHERE ZPROCESS_FLAG = ' '.
        APPEND I_OMSW.
        CLEAR I_OMSW.
      ENDSELECT.
      SORT I_OMSW.
      DELETE ADJACENT DUPLICATES FROM I_OMSW.
      DO.
        READ DATASET F_CSTR  INTO CELLSTAR.
        IF CELLSTAR-RECORD IS INITIAL.
          EXIT.
        ELSE.
          APPEND CELLSTAR.
          CLEAR CELLSTAR.
        ENDIF.
      ENDDO.
      LOOP AT CELLSTAR.
        SPLIT CELLSTAR-RECORD AT ',' INTO
           I_WRLS-ZSERVICE_ORD
           I_WRLS-ZMATNR
           I_WRLS-ZQTY
           I_WRLS-ZORD_DT.
        CONCATENATE 'S' I_WRLS-ZSERVICE_ORD INTO I_WRLS-ZSERVICE_ORD.
        I_WRLS-ZCURR_DT = SY-DATUM.
        I_WRLS-ZCURR_TIME = SY-UZEIT.
        I_WRLS-ZPROCESS_FLAG = ' '.
        I_WRLS-ZMAT_TYPE = 'C'.
        UNPACK I_WRLS-ZMATNR TO I_WRLS-ZMATNR.
        APPEND I_WRLS.
        CLEAR I_WRLS.
      ENDLOOP.
      REFRESH CELLSTAR.
      FREE CELLSTAR.
      DO.
        READ DATASET F_CTEL  INTO CTEL.
        IF CTEL-RECORD IS INITIAL.
          EXIT.
        ELSE.
          APPEND CTEL.
          CLEAR CTEL.
        ENDIF.
      ENDDO.
      LOOP AT CTEL.
        SPLIT CTEL-RECORD AT ',' INTO
         I_WRLS-ZSERVICE_ORD
         I_WRLS-ZMATNR
         I_WRLS-ZQTY
         I_WRLS-ZORD_DT.
        I_WRLS-ZCURR_DT = SY-DATUM.
        I_WRLS-ZCURR_TIME = SY-UZEIT.
        I_WRLS-ZPROCESS_FLAG = ' '.
        I_WRLS-ZMAT_TYPE = 'O'.
        CONCATENATE 'S' I_WRLS-ZSERVICE_ORD INTO I_WRLS-ZSERVICE_ORD.
        UNPACK I_WRLS-ZMATNR TO I_WRLS-ZMATNR.
        APPEND I_WRLS.
        CLEAR I_WRLS.
      ENDLOOP.
      SELECT * FROM ZMMWRLS INTO I_WRLS WHERE ZPROCESS_FLAG = ' '.
        APPEND I_WRLS.
        CLEAR I_WRLS.
      ENDSELECT.
      SORT I_WRLS.
      DELETE ADJACENT DUPLICATES FROM I_WRLS.
      REFRESH CTEL.
      FREE CTEL.
    ENDFORM.                               " SPLIT_FILE
    *&      Form  MATCH_ORDERS
          text
    -->  p1        text
    <--  p2        text
    FORM MATCH_ORDERS.
      LOOP AT I_OMSW.
        OMS_INDX = SY-TABIX.
        LOOP AT I_WRLS WHERE ZSERVICE_ORD = I_OMSW-ZSERVICE_ORD
                             AND  ZMATNR = I_OMSW-ZMATNR
                             AND  ZPROCESS_FLAG = ' '.
                  WRLS_INDX = SY-TABIX.
        ENDLOOP.
        IF SY-SUBRC = 0.
          I_OMSW-ZPROCESS_FLAG = 'X'.
          PERFORM UPDATE_ZMMOMSW.
          I_WRLS-ZPROCESS_FLAG = 'X'.
          CONCATENATE I_OMSW-ZBUKRS I_OMSW-ZSUB_MKT+2(3)
                       INTO I_WRLS-ZKOSTL.
          PERFORM UPDATE_ZMMWRLS.
          PERFORM UPDATE_ZMMWMCH.
          CLEAR OMS_INDX.
          CLEAR WRLS_INDX.
          COMMIT WORK.
          IF I_WRLS-ZMAT_TYPE = 'C'.
            PERFORM BUILD_101_MVT.
            PERFORM GOODS_MVT.
            WAIT UP TO 5 SECONDS.
            PERFORM BUILD_201_MVT.
            PERFORM GOODS_MVT.
          ELSE.
            PERFORM BUILD_201_MVT.
            PERFORM GOODS_MVT.
          ENDIF.
          WAIT UP TO 5 SECONDS.
        ELSE.
          I_OMSW-ZPROCESS_FLAG = ' '.
          PERFORM UPDATE_ZMMOMSW.
        ENDIF.
      ENDLOOP.
      COMMIT WORK.
      LOOP AT I_WRLS WHERE ZPROCESS_FLAG = ' '.
         MOVE-CORRESPONDING I_WRLS TO ZMMWRLS.
         MODIFY ZMMWRLS.
      ENDLOOP.
      ULINE 0(90).
    ENDFORM.                               " MATCH_ORDERS
    *&      Form  GOODS_MVT
          text
    -->  p1        text
    <--  p2        text
    FORM GOODS_MVT.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
           EXPORTING
                GOODSMVT_HEADER       = E_HEADER
                GOODSMVT_CODE         = W_CODE
          IMPORTING
               GOODSMVT_HEADRET      = I_HEADER
               MATERIALDOCUMENT      = W_DOC_NUM
               MATDOCUMENTYEAR       = W_YEAR
           TABLES
                GOODSMVT_ITEM         = I_MSEG
            GOODSMVT_SERIALNUMBER =
                RETURN                = W_RETURN
      IF W_RETURN-TYPE = ' '.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
            WAIT    =
          IMPORTING
               RETURN  = W_COMMIT_RETURN.
          WRITE: / SY-VLINE,
                  2(10) I_OMSW-ZSERVICE_ORD,
                13 SY-VLINE,
                14(8) I_OMSW-ZMATNR,
                25 SY-VLINE,
                26(5) I_OMSW-ZQTY,
                32 SY-VLINE,
                33(8) I_OMSW-ZORD_DT,
                42 SY-VLINE,
                43(10) I_OMSW-ZGL_ACCT,
                54 SY-VLINE,
                55(4) I_OMSW-ZBUKRS,
                60 SY-VLINE,
                61(5) I_OMSW-ZSUB_MKT,
                68 SY-VLINE,
                69(15) 'Post Successful',
                85 SY-VLINE,
                86 W_MVT,
                90 SY-VLINE.
      ELSE.
         WRITE: / SY-VLINE,
                 2(10) I_OMSW-ZSERVICE_ORD,
                13 SY-VLINE,
                14(8) I_OMSW-ZMATNR,
                25 SY-VLINE,
                26(5) I_OMSW-ZQTY,
                32 SY-VLINE,
                33(8) I_OMSW-ZORD_DT,
                42 SY-VLINE,
                43(10) I_OMSW-ZGL_ACCT,
                54 SY-VLINE,
                55(4) I_OMSW-ZBUKRS,
                60 SY-VLINE,
                61(5) I_OMSW-ZSUB_MKT,
                68 SY-VLINE,
                69(15) 'Posting Failed',
                85 SY-VLINE,
                86 W_MVT,
                90 SY-VLINE.
      ENDIF.
      CLEAR W_MVT.
      IF W_COMMIT_RETURN-TYPE NE ' '.
        CLEAR W_COMMIT_RETURN.
        REFRESH W_COMMIT_RETURN.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
             IMPORTING
                  RETURN = W_COMMIT_RETURN.
    ENDIF.
      CLEAR W_DOC_NUM.
      CLEAR W_YEAR.
      CLEAR I_MSEG.
      REFRESH I_MSEG.
    ENDFORM.                               " GOODS_MVT.
    *&      Form  BUILD_101_MVT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_101_MVT.
      W_CODE = '01'.
      I_MSEG-MATERIAL = I_WRLS-ZMATNR.
      I_MSEG-PLANT = '1295'.
      I_MSEG-STGE_LOC = '2000'.
      I_MSEG-MOVE_TYPE = '101'.
      W_MVT = '101'.
      I_MSEG-ENTRY_QNT = I_WRLS-ZQTY.
      I_MSEG-ENTRY_UOM = 'EA'.
      I_MSEG-PO_NUMBER = P_PO.
      I_MSEG-MVT_IND = 'B'.
      SELECT SINGLE EBELP FROM EKPO INTO W_EBELP
                        WHERE EBELN = P_PO AND
                        MATNR = I_WRLS-ZMATNR.
      I_MSEG-PO_ITEM = W_EBELP.
      APPEND I_MSEG.
      CLEAR I_MSEG.
      CLEAR W_EBELP.
    ENDFORM.                               " BUILD_101_MVT
    *&      Form  BUILD_201_MVT
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_201_MVT.
      W_CODE = '03'.
      I_MSEG-MATERIAL = I_WRLS-ZMATNR.
      I_MSEG-PLANT = '1295'.
      I_MSEG-STGE_LOC = '2000'.
      I_MSEG-MOVE_TYPE = '201'.
      W_MVT = '201'.
      I_MSEG-ENTRY_QNT = I_WRLS-ZQTY.
      I_MSEG-ENTRY_UOM = 'EA'.
      I_MSEG-COSTCENTER = I_WRLS-ZKOSTL.
      I_MSEG-GL_ACCOUNT = I_OMSW-ZGL_ACCT.
      I_MSEG-MVT_IND = ' '.
      APPEND I_MSEG.
      CLEAR I_MSEG.
    ENDFORM.                               " BUILD_201_MVT
    *&      Form  clear_input_files
          text
    -->  p1        text
    <--  p2        text
    FORM CLEAR_INPUT_FILES.
      OPEN DATASET U_MERC FOR OUTPUT IN TEXT MODE.
      OPEN DATASET F_CSTR FOR OUTPUT IN TEXT MODE.
      OPEN DATASET F_CTEL FOR OUTPUT IN TEXT MODE.
      TRANSFER W_CELLSTAR TO F_CSTR.
      TRANSFER W_CELLSTAR TO F_CTEL.
      TRANSFER W_MERC TO U_MERC.
      CLOSE DATASET F_CSTR.
      CLOSE DATASET F_CTEL.
      CLOSE DATASET U_MERC.
    ENDFORM.                               " clear_input_files
    *&      Form  UPDATE_ZMMOMSW
          text
    -->  p1        text
    <--  p2        text
    FORM UPDATE_ZMMOMSW.
      MODIFY I_OMSW INDEX OMS_INDX.
      MOVE-CORRESPONDING I_OMSW TO ZMMOMSW.
      MODIFY ZMMOMSW.
    ENDFORM.                               " UPDATE_ZMMOMSW
    *&      Form  UPDATE_ZMMWRLS
          text
    -->  p1        text
    <--  p2        text
    FORM UPDATE_ZMMWRLS.
      MODIFY I_WRLS INDEX WRLS_INDX.
      MOVE-CORRESPONDING I_WRLS TO ZMMWRLS.
      MODIFY ZMMWRLS.
    ENDFORM.                               " UPDATE_ZMMWRLS
    *&      Form  UPDATE_ZMMWMCH
          text
    -->  p1        text
    <--  p2        text
    FORM UPDATE_ZMMWMCH.
      MOVE-CORRESPONDING I_OMSW TO ZMMWMCH.
      ZMMWMCH-ZKOSTL = I_WRLS-ZKOSTL.
      ZMMWMCH-ZMAT_TYPE = I_WRLS-ZMAT_TYPE.
      ZMMWMCH-ZPROCESS_FLAG = ' '.
      MODIFY ZMMWMCH.
    ENDFORM.                               " UPDATE_ZMMWMCH

  • BAPI_GOODSMVT_CREATE - printing error

    Hi,
          Iam using  "BAPI_GOODSMVT_CREATE" to create transfer posting document (for T-code MB1B). The document is created perfectly. My issue is, Iam not able to print that document in MB90.
         In MB1B transaction, there is a Print check box in screen. If it is ticked, document created via MB1B is able to print using transaction MB90. But when using above BAPI, I could not find any suitable field to pass this print tick value.
         How to print documents created through this BAPI. Any help is appreciated.
    regards,
    Nagaraj.

    hi
    good
    Please take a look at this links for sample coding of BAPI_GOODSMVT_CREATE.
    http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
    http://www.4ap.de/abap/bapi_goodsmvt_create.php
    thanks
    mrutyun^

  • Bapi_goodsmvt_create bapi error

    Hi friends,
                    I developed a bapi for Post Goods Issue (PGI). The BAPI is throwing an error at the Movement Type. The error is ' Goods movement is not possible with mvmt type 601'.
    This BAPI should be triggered in the background when VL01N transaction is run. Also please suggest me if we need any userexits / BADIs.  I went through badis. But of no use.
    Thanks and Regards,
    Murali Krishna .T

    Hi Vinod,
                   Thanks alot for your reply. I have used the BAPI    BAPI_OUTB_DELIVERY_CONFIRM_DEC. But when I run, it is not displaying any message from return table.
    I have passed both the header and item details.
    Thanks and Best regards,
    Murali

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

  • Unable to transfer post the document using BAPI "BAPI_GOODSMVT_CREATE"

    Hi Experts,
    I am unable to post the document using BAPI "BAPI_GOODSMVT_CREATE", getting error "_Sales order stock --- does not exist_"
    details are stated below:
    GM_CODE : 04, it is working fine for the scenario with same saleorder number and line item, but when i give same sale order number and different line item, then i am getting the above error.
    Example : Posting from Saleorder A with line item 100 to saleorder A with lineitem 100 its working fine, but when we are posting
                    from Saleorder A with lineitem 100 to saleorder A with line item 200 it is not working.
    Also When I trying to do with the transaction MB1B manually, it is working fine. kindly suggest me.
    Needed Urgently....
    Appreciate for you early response.
    Regards,
    Sathya.
    Edited by: Sathyanarayana Raghavendra on May 6, 2010 1:00 PM

    Hi,
    Hi Did you call Function BAPI_TRANSACTION_COMMIT' after calling the BAPI.    ?
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_x.
    Regards,
    Jovito.

  • Confirm PO updated in table before GR

    Hi All,
    I have program to create PO via BAPI_PO_CREATE and followed by BAPI_GOODSMVT_CREATE to do GR.
    When there is little PO line items, after PO created, no problem in create material document through BAPI_GOODSMVT_CREATE  but when PO line items alot (50 ~ 200 lines), even after PO created, BAPI_GOODSMVT_CREATE has error in create GR.
    Currently I use key word wait up to few seconds in do loop before BAPI_GOODSMVT_CREATE but i think in the loop to check total line items created in table is more secured.
    May I know what table I need to check to confirm all PO line item added in table and PO number created in table then only I proceed with BAPI_GOODSMVT_CREATE.
    Thanks
    Rgds

    Hello,
    PO line table is EKPO. But you may try the following:
    After PO is created through BAPI_PO_CREATE, you should make a synchronous commit (COMMIT WORK AND WAIT) before calling BAPI_GOODSMVT_CREATE.  This ensures PO has been saved before proceeding to make Goods Receipt.
    Thanks,
    Venu

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

  • Error while posting a document using  the  BAPI_GOODSMVT_CREATE

    Hi,
    i was trying to post the Goods Receipt document ( Tcode MB1C) using the bapi  BAPI_GOODSMVT_CREATE
    i am passing the item details and Serial number details.
    the error triggered was Maintain Serial Numbers for Total Quantity
    but i am passing the quantity as 1 ( in item data) and passing one serial number.
    is this error because of data problem or am i missing to pass the value to  some dependent parameter..?
    Please help me out.
    Thanks in advance.
    Sriram

    Hi David,
    i was tring to pass the same.
    in item table we have we have four item details ( below)
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    S_ORD_ITEM - Item Number in Sales Order ( length mismatch with serial  item number)
    PO_ITEM  - Item Number of Purchasing Document ( length mismatch with serial  item number)
    out 4 , 2 are ruled out because of length mismatch. and in the reaming two are
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    this is a Goods receipt document, please let me know which field is required to map with item number in the above two.
    Regards,
    Sriram.

  • BAPI_GOODSMVT_CREATE - Error while posting a Material Document

    Hi Experts,
    We are  trying to do the material document posting using the transaction "MB1C" manually in SAP. The movement type which we are using for the same is "261".  While doing this is, it is asking for a work order number and the Recipient number. We gave the Recipient Number as "123". Material document is created successfully.
    Again using the same transaction  "MB1C" , we are trying to do the reversal of the material document which we posted previously against another work order number for the same material and the serial number if the material is serialised and as well as for the non serialised material.
    Both this case, in SAP the material document is created succesfully. This is done manually in SAP.
    When we are trying to create the material document using the BAPI 'BAPI_GOODSMVT_CREATE', for the above scenario, posting the material document '261' movement type for one work order and the reversal for another work order '262' movement type for the same material (whether it is a serialised or non serialised) we are getting the eror as "RE Qty. transferred exceeded 1 PC: 50,003,695 C001 USED 1200".
    We are passing the following at the item level. MATERIAL Number, Plant, STGE_LOC, ENTRY_QNT, MOVE_TYPE, BATCH, ORDERID, RESERV_NO,  RES_ITEM, ACTIVITY, XSTOB for reversal.
    We are passing the GM_CODE as '05'.
    Please let us know what needs to be changed inorder to create the material document properly without getting errors.
    Thanks in Advance,
    Mohan.

    Hi,
    We fixed this issue by removing the reservation number of the material when we are trying to post the material document with the movement type "262".
    The reason for removing the reservation number for the movement type "262"
    The reservation number is getting created against a work order when we trying to create the work order in IW32. This reservation number is used for validating the stock while we are trying to consume and doing the reversal.
    SAP is allowing us to reverse the consumed quantities only based on the reservartion number and hence we got this error.
    To fix this error, if we are trying to reverse a particular material against a different work order for which it has been consumed previiously, remove the reservation number and item number and try posting the material document.
    Hope this solution will solve your issue:)
    Thanks and Regards,
    Mohan.

Maybe you are looking for