BAPI_GOODSMVT_CREATE for MIGO

HI I want to use BAPI_GOODSMVT_CREATE to to MIGO,
gmcode-gm_code    = '01', itemitab-mvt_ind    = 'B'.
and I want to use the Delivery note, but I didn't find this field in the BAPI? Can anyone tell me how to add delivery note in the BAPI?
Thanks in advance!

Hi Friend,
Add in BAPI2017_GM_HEAD_01-REF_DOC_NO in GOODSMVT_HEADER Parameter of that BAPI.
Hope it will solve ur problem.
Regards
Krishnendu

Similar Messages

  • How to populate cusotom fields using BAPI_GOODSMVT_CREATE  for MIGO

    Hi,
    I was to update custom field using BAPI_GOODSMVT_CREATE for MIGO and store it is MSEG table.
    Please tell me how to proceed.
    Moderator message: last warning, if you continue to post the same thread again, I will submit your user ID for deletion. See my comments in your previous posts.
    Edited by: Thomas Zloch on Jul 14, 2011 4:38 PM

    Hi ANID,
    Thanks for the reply.
    I have checked in the documention of the bapi and no communication structure regarding to the bapi is there so i am not able to figure out where to add the custom field so that it can be added in the MKPF table.
    Regads
    Dipak

  • BAPI_GOODSMVT_CREATE for GRN posting

    Hi Experts,
    I am using BAPI_GOODSMVT_CREATE for posting GRN against Purchase Order.
    I want to post Quantity in Delivery note(LSMNG) and Unit of Measure From Delivery Note(LSMEH) also.
    I used itab-QUANTITY = '1'.
    itab-BASE_UOM = 'L'.
    but it is not getting updated properly.
    I am getting document number and GRN has been done against Purchase Order using this BAPI.All other fields are properly getting updated except these 2 fields Qty in delivery note and unit of delivery note. Can i pass these 2 field values using this BAPI or do I need to use any other BAPI. Is there any BAPI for MIGO instead of MB01?
    Can any one help me to pass these values through BAPI
    Regards,
    Sam

    Hi,
    you can update LSMNG quantity using EXTENSIONIN structures of BAPI_GOODSMVT_CREATE.
    The steps are the following:
    Add LSMNG field in BAPI_TE_XMSEG structure create an appending structure (char field)
    By SE19 transaction create the Enhancement Spot starting from MB_GOODSMOVEMENT
    Define the Badi Implementation choosing MB_BAPI_GOODSMVT_CREATE Badi Definition implementing a new customer class.
    Remember to choose to copy the class with the source code of methods.
    In The method IF_EX_MB_Hi, you can update LSMNG quantity using EXTENSIONIN structures of BAPI_GOODSMVT_CREATE. The steps are the following: Add LSMNG field in BAPI_TE_XMSEG structure create an appending structure (char field) By SE19 transaction create the Enhancement Spot starting from MB_GOODSMOVEMENT Define the Badi Implementation choosing MB_BAPI_GOODSMVT_CREATE Badi Definition implementing a new customer class.
    Remember to choose to copy the class with the source code of methods.
    In the method IF_EX_MB_BAPI_GOODSMVT_CREATE~EXTENSIONIN_TO_MATDOC you will find the following source code:
      DATA:     c_lenstruc          TYPE i VALUE 30,    
       wa_bapi_mb_header   TYPE bapi_te_xmkpf,    
       wa_bapi_mb_item     TYPE bapi_te_xmseg,    
       wa_extension_in     TYPE bapiparex.  
       FIELD-SYMBOLS:               TYPE imseg.  
       CHECK NOT extension_in[] IS INITIAL.
      * Analyze IMSEG for document structure and assign LINE_IDs if necessary  
       CALL METHOD cl_mmim_line_id_manager=>analyze_mb_create    
              CHANGING       ct_imseg          = ct_imseg[]    
                 EXCEPTIONS       duplicate_line_id = 1      
                 OTHERS            = 2.  
      LOOP AT extension_in INTO wa_extension_in.    
         CASE wa_extension_in-structure.
    * extension of MKPF      
         WHEN 'BAPI_TE_XMKPF'.        
         MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_header.        
         MOVE-CORRESPONDING wa_bapi_mb_header TO cs_imkpf.
    * extension of MSEG      
        WHEN 'BAPI_TE_XMSEG'.        
        MOVE wa_extension_in+c_lenstruc TO wa_bapi_mb_item.        
        READ TABLE ct_imseg           WITH KEY line_id = wa_bapi_mb_item-matdoc_itm           ASSIGNING   <fs_imseg>.        
          IF sy-subrc EQ 0.          
             MOVE-CORRESPONDING wa_bapi_mb_item TO   <fs_imseg>.       
           ENDIF.   
         ENDCASE.  
        ENDLOOP.
    Then you have to call BAPI_GOODSMVT_CREATE using extensionin in the following way:
    * Fill   goodsmvt_header structures
      goodsmvt_header-........
    * Fill    goodsmvt_item-position
      Loop at it_position.
             goodsmvt_item-..........
              wf_line_id = wf_line_id + 1.
              goodsmvt_item-line_id = wf_line_id.
              APPEND goodsmvt_item.
            CLEAR extensionin.
            MOVE 'BAPI_TE_XMSEG'    TO extensionin-structure.
            MOVE wf_line_id+2(4)    TO extensionin-valuepart1+14(4).
            MOVE LSMNG              TO extensionin-valuepart1+18(16).
            APPEND extensionin.
    endloop.
            CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              goodsmvt_header               = goodsmvt_header
              goodsmvt_code                 = goodsmvt_code
    *         TESTRUN                       = ' '
              goodsmvt_ref_ewm              = goodsmvt_ref_ewm
            IMPORTING
    *         GOODSMVT_HEADRET              =
              materialdocument              = materialdocument
              matdocumentyear               = matdocumentyear
            TABLES
              goodsmvt_item                 = goodsmvt_item
    *         GOODSMVT_SERIALNUMBER         =
              return                        = return
              extensionin                   = extensionin.
    Hope it helps
    Lorenzo

  • Bapi for migo transaction

    i have created a bapi to upload data for MIGO transaction.. (GOODS RECEIPT-->PURCHASE ORDER)
    i am getting the error " stock posting is not possible for this material "'.
    when i create directly, it is posted.. while uploading through the program it shows the above error.
    please suggest if anyone knows....
    Thanks in advance,
    Dhivya N.

    *& Report  ZR_MIGO_UPLOAD
    *& package name : zabap
    *& transport request number : MIDK901443
    *& program to upload goods movement
    REPORT ZR_MIGO_UPLOAD.
    ***DATA DECLARATION***
    type-POOLs:  icon.
    TYPES: BEGIN OF TY_GR_PO,
            EBELN(10) TYPE c ,     "'PO NUMBEr
            EBELP(10) TYPE c,     "PO ITEM NUMBER
    *       LGOBE TYPE LGOBE,     "STORAGE LOCATION DESCRIPTION
            LGORT(10) TYPE c,     "STORAGE LOCATION
            XFELD TYPE c,     "ITEM OK
            GERNR(10) TYPE c,     "SERIALNUMBER
            END OF TY_GR_PO.
    DATA: TA_GR_PO TYPE TABLE OF TY_GR_PO,    "TABLE FOR GOODS RECEIPT PURCHASE ORDER
           WA_GR_PO TYPE TY_GR_PO.
    DATA: BLDAT TYPE BLDAT,     "DOCUMENT DATE
            BUDAT TYPE BUDAT,     "POSTING DATE
            WEVER TYPE WEVER.     "VERSION FOR PRINTING GR SLIP
    ***BAPI DECLARATION***
    DATA: BEGIN OF GM_HEAD OCCURS 0.                    "Material Document Header Data
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_01.
    DATA: END OF GM_HEAD.
    DATA: BEGIN OF GM_CODE OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_CODE.          "Assign Code to Transaction for Goods Movement
    DATA: END OF GM_CODE.
    DATA: BEGIN OF GM_RET OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_HEAD_RET.       "Material Document Number/Material Document Year
    DATA: END OF GM_RET.
    DATA: BEGIN OF GM_ITEM OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE.    "Material Document Items
    DATA: END OF GM_ITEM.
    DATA: BEGIN OF GM_SER OCCURS 0.
             INCLUDE STRUCTURE BAPI2017_GM_SERIALNUMBER.    "Serial Number
    DATA: END OF GM_SER.
    data: BEGIN OF ta_bapireturn OCCURS 0.
            INCLUDE STRUCTURE BAPIRET2.
    data: END OF ta_bapireturn.
    ***declaration of excel file handling table***
    FIELD-SYMBOLS: <fs> type any.    "field symbol for alsm_excel
    DATA: TA_EXCEL TYPE TABLE OF ALSMEX_TABLINE,  "table to contain excel sheet values
           WA_EXCEL TYPE ALSMEX_TABLINE.
    ***declaration of other parameters***
    data:       V_brow type i VALUE    2,    "BEGIN OF ROW
                 V_bcol type i value   1,     "BEGIN OF COL
                 V_erow type i value 65536,   "END OF ROW
                 V_ecol type i value 256.     "END OF COLUMN
    DATA:  V_sear type string,
            V_INDEX TYPE i,
            V_tabix type sy-tabix,     "current line.
            v_lines type i.          "total number of records
    DATA: DATE TYPE DATS.
    ***SELECTION SCREEN***
    ***SELECTION SCREEN DESIGN***
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 3.
    PARAMETERS: zCODE(2) TYPE C MATCHCODE OBJECT H_T158G,
                 zrefdoc type REFDOC,
                 version type WEVER.
    SELECTION-SCREEN skip 5.
    PARAMETERS: p_file type ibipparms-path.
    SELECTION-SCREEN SKIP 3.
    SELECTION-SCREEN END OF BLOCK b1.
    ***SELECTION SCREEN VALUE REQUEST***
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
       CALL FUNCTION 'F4_FILENAME'                                    "f4 help for file name
         EXPORTING
           PROGRAM_NAME  = SYST-CPROG
           DYNPRO_NUMBER = SYST-DYNNR
           FIELD_NAME    = 'P_FILE'
         IMPORTING
           FILE_NAME     = P_FILE.
    ***SELECTION SCREEN EVENT***
    AT SELECTION-SCREEN.                                 "validation
       if p_file <> ''.
         V_sear = p_file.
         SEARCH V_sear for '.xls'.
         if sy-subrc <> 0.
           message 'please provide excel file. it is not valid' type 'E'.
         ENDIF.
       ENDIF.
    INITIALIZATION.
    *   DATE = '17.04.14'.
       GM_HEAD-PSTNG_DATE = SY-DATUM.
       GM_HEAD-DOC_DATE   = SY-DATUM.
       gm_head-pr_uname = sy-uname.
    ***START OF SELECTION***
    START-OF-SELECTION.
       gm_head-REF_DOC_NO = zrefdoc.
       gm_head-VER_GR_GI_SLIP = version.
       GM_CODE-GM_CODE = zCODE.
       PERFORM EXCEL_UPLOAD.
       PERFORM EXCEL_CONVERSION.
       PERFORM NO_RECORDS.
    END-OF-SELECTION.
       PERFORM BAPI_ASSIGNMENT.
       PERFORM BAPI_FM.
    *&      Form  EXCEL_UPLOAD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_UPLOAD .
       CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
         EXPORTING
           FILENAME                = P_FILE
           I_BEGIN_COL             = V_BCOL
           I_BEGIN_ROW             = V_BROW
           I_END_COL               = V_ECOL
           I_END_ROW               = V_EROW
         TABLES
           INTERN                  = TA_EXCEL
         EXCEPTIONS
           INCONSISTENT_PARAMETERS = 1
           UPLOAD_OLE              = 2
           OTHERS                  = 3.
    ENDFORM.                    " EXCEL_UPLOAD
    *&      Form  EXCEL_CONVERSION
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM EXCEL_CONVERSION .
       if ta_excel is NOT INITIAL.
         sort ta_excel by row col.
         clear wa_excel.
         clear wa_GR_PO.
         LOOP AT ta_excel INTO wa_excel.
           move wa_excel-col to v_index.
           ASSIGN COMPONENT v_index OF STRUCTURE wa_GR_PO to <fs>.
           if sy-subrc = 0.
             move wa_excel-value to <fs>.
           ENDIF.
           at END OF row.
             append wa_GR_PO to ta_GR_PO.
             clear wa_GR_PO.
           ENDAT.
         ENDLOOP.
       else.
         MESSAGE 'no data for conversion' type 'I'.
       ENDIF.
    ENDFORM.                    " EXCEL_CONVERSION
    *&      Form  NO_RECORDS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM NO_RECORDS .
       DESCRIBE TABLE ta_GR_PO LINES v_lines.
       if v_lines = 0.
         MESSAGE 'NO RECORDS TO UPLOAD' TYPE 'E'.
       ENDIF.
    ENDFORM.                    " NO_RECORDS
    *&      Form  BAPI_ASSIGNMENT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_ASSIGNMENT .
       IF TA_GR_PO IS NOT INITIAL.
         LOOP AT TA_GR_PO INTO WA_GR_PO.
           gm_item-PO_NUMBER = wa_gr_po-ebeln.
           GM_ITEM-STGE_LOC = WA_GR_PO-LGORT.
           GM_ITEM-PO_ITEM = WA_GR_PO-EBELP.
           GM_ITEM-NO_MORE_GR = 'X'."WA_GR_PO-XFELD'.
    *      GM_SER-SERIALNO = WA_GR_PO-GERNR.
           gm_item-NO_MORE_GR =  1.
           gm_item-ENTRY_QNT = 2.
           gm_item-MOVE_TYPE = 101.
    *      gm_item-MVT_IND = 'B'.
           gm_item-plant = 'P001'.
           gm_item-move_stloc = 'FG01'.
    *      GM_ITEM-SPEC_STOCK = 'K'.
           APPEND GM_ITEM.
           APPEND GM_SER.
         ENDLOOP.
        ELSE.
          MESSAGE 'DATA IS NOT UPLOADED' TYPE 'I'.
        ENDIF.
    ENDFORM.                    " BAPI_ASSIGNMENT
    *&      Form  BAPI_FM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BAPI_FM .
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
       EXPORTING
         GOODSMVT_HEADER               = gm_head
         GOODSMVT_CODE                 = gm_code
    *   TESTRUN                       = ' '
    *   GOODSMVT_REF_EWM              =
      IMPORTING
        GOODSMVT_HEADRET              = gm_ret
    *   MATERIALDOCUMENT              =
    *   MATDOCUMENTYEAR               =
       TABLES
         GOODSMVT_ITEM                 = gm_item
        GOODSMVT_SERIALNUMBER         =  gm_ser
         RETURN                        = ta_bapireturn
    *   GOODSMVT_SERV_PART_DATA       =
    *   EXTENSIONIN                   =
    if ta_bapireturn-type = 'S'.
         write:/ icon_green_light as icon,
                 'success: Material document',gm_ret-mat_doc,  'is created for the GOODS RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ELSEIF ta_bapireturn-type = 'E'.
         write:/ icon_red_light as icon,
                 'error: Material document',gm_ret-mat_doc , 'is not created for the GOOD RECEIPT- po number : ', wa_gr_po-ebeln,
               / 'reason:' , ta_bapireturn-message.
    ENDIF.
    ENDFORM.                    " BAPI_FM

  • Regarding Bapi for Migo

    Hi ,
          I want to do Good receipt against the delivery order . This is for Migo .iam using BAPI_GOODSMVT_CREATE . Iam unable to get all the mandatory . iam geting an error saying goods movement is not possible for 101 movement type.
    Thanks.

    hi,
    u can use 501 type.
    hope it will work .But i am not sure
    thnks and rgds,
    raghul

  • BDC for MIGO for GR OutBound Delivery( A01 & R05 ) from Movement Type 107 to 109

    Hi,
    I am stuck with a very typical situation need all your expertise and advices for a solution.
    We are basically trying to create change the movement type from 107 to 109 through MIGO.
    I have made a BDC recording for MIGO ( because we would like to track each delivery specifically under shipment , I know that there is a BAPI which is there to do this but it works fine if we do the shipment with Purchase Order as input which dont want in that manner )
    Process:
    1. Creating Production Order
    2. Creating Purchase Order
    3. Creating STO
    4. Deliveries
    5. PGI for Deliveries
    6. Shipment for group of outbound Deliveries
    I have created a z program where i am passing shipment number in the selection screen.
    Then it would take all the deliveries for that shipment and pass each delivery to MIGO and process it and change the status from 107 to 109.
    Interesting part here is, the code works absolutely perfect only from my ID. But when I test from other ID it is not executing, so to check where is the problem I have added mess_tab to the CALL TRANSACTION to capture what message is been populated for my ID comparing with others
    Message Captured on Others ID's:
    MSGID: 00
    MSGNR: 344
    MSGV1: SAPLMIGO
    MSGV2: 1300
    Message Captured on MY ID:
    MSGID: MIGO
    MSGNR: 012
    MSGV1: 5000005802
    MSGV2: (empty)
    This is the problem this program is executing only on MY ID, rest all ID's it is not processing.
    We have cross verified with security and basis regarding any authorization issues but nothing came up.
    Please help me what could be the issue ( WHY it is processing successfully for my and WHY NOT for other ID's)
    Below is the main code :
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'                     " Converting Date format to DD/MM/YYYY
         EXPORTING
           DATE_INTERNAL            = sy-datum
         IMPORTING
           DATE_EXTERNAL            = lv_date_external
         EXCEPTIONS
           DATE_INTERNAL_IS_INVALID = 1
           OTHERS                   = 2.
           IF SY-SUBRC <> 0.                                     "#EC NEEDED
    * Implement suitable error handling here
           ENDIF.
    *   Validating input shipment number with database table VTTP
           SELECT VTTP~TKNUM
                  VTTP~TPNUM
                  VTTP~VBELN
             FROM VTTP INNER JOIN VTTK
             ON VTTP~TKNUM = VTTK~TKNUM
             INTO TABLE IT_VTTP
             WHERE VTTK~TKNUM = P_TKNUM
               AND VTTK~STDIS = 'X'.
           IF sy-subrc = 0.
    *   Validating all deliveries having same Delivery type or not
             SELECT * FROM likp INTO TABLE it_likp FOR ALL ENTRIES IN it_vttp WHERE vbeln = it_vttp-vbeln
                                                                                AND vbtyp = 'J'.
             IF sy-subrc = 0.
               CLEAR lv_lines.
               LOOP AT it_likp INTO wa_likp.
                 REFRESH:it_vbfa,BDCDATA.
    *   Validating if Delivery Type = 109 (GR already done), or Delivery Type = 107 (must process for GR )
                 SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
    *                                                AND vbtyp_v = 'J'
                                                         AND bwart = '109'.
                 IF sy-subrc = 0.
                   lv_flag1 = 'X'.
                 ELSE.
                   SELECT * FROM vbfa INTO TABLE it_vbfa WHERE vbelv = wa_likp-vbeln
    *                                                  AND vbtyp_v = 'J'
                                                           AND bwart = '107'.
                   IF sy-subrc NE 0.
                     MESSAGE 'No Deliveries with Movement Type "107" ' TYPE 'I'.
                   ELSE.
                     lv_flag2 = 'X'.
                     lv_lines = lv_lines + 1.
    **  BDC for MIGO
                     perform bdc_dynpro      using 'SAPLMIGO' '0001'.
                     perform bdc_field       using 'BDC_OKCODE'
                                                   '=OK_GO'.
                     perform bdc_field       using 'GODYNPRO-ACTION'
                                                   'A01'.
                     perform bdc_field       using 'GODYNPRO-REFDOC'
                                                   'R05'.
                     perform bdc_field       using 'GODEFAULT_TV-BWART'
                                                   '109'.
                     perform bdc_field       using 'BDC_CURSOR'
                                                   'GODYNPRO-OUTBOUND_DELIVERY'.
                     perform bdc_field       using 'GODYNPRO-OUTBOUND_DELIVERY'
                                                   wa_likp-vbeln. "'80019574'.
                     perform bdc_field       using 'GOHEAD-BLDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-BUDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-WEVER'
                                                   '1'.
                     perform bdc_dynpro      using 'SAPLMIGO' '0001'.
                     perform bdc_field       using 'BDC_OKCODE'
                                                   '=OK_POST1'.
                     perform bdc_field       using 'GODEFAULT_TV-BWART'
                                                   '109'.
                     perform bdc_field       using 'GOHEAD-BLDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-LFSNR'
                                                   wa_likp-vbeln. "'0080019574'.
                     perform bdc_field       using 'GOHEAD-BUDAT'
                                                   lv_date_external. "'04/29/2015'.
                     perform bdc_field       using 'GOHEAD-WEVER'
                                                   '1'.
                     perform bdc_field       using 'GODYNPRO-DETAIL_ZEILE'
                                                   '   1'.
                     perform bdc_field       using 'GOITEM-ERFME'
                                                   'EA'.
                     perform bdc_field       using 'GOITEM-ERFMG'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-LSMNG'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-LSMEH'
                                                   'EA'.
                     perform bdc_field       using 'GOITEM-MIGO_ELIKZ'
                                                   '1'.
                     perform bdc_field       using 'GOITEM-BWART'
                                                   '109'.
                     perform bdc_field       using 'GOITEM-LGOBE'
                                                   'RX Cross-docking'.
                     perform bdc_field       using 'BDC_CURSOR'
                                                   'GODYNPRO-DETAIL_TAKE'.
                     perform bdc_field       using 'GODYNPRO-DETAIL_TAKE'
                                                   'X'.
                     PERFORM bdc_dynpro      USING 'SAPLMIGO' '1300'.
                     PERFORM bdc_field       USING 'BDC_CURSOR'
                                                   'G_TIP_DONT_SHOW_AGAIN'.
                     PERFORM bdc_field       USING 'BDC_OKCODE'
                                                   '=OK_TIP_GO'.
                     PERFORM bdc_field       USING 'G_TIP_DONT_SHOW_AGAIN'
                                                   'X'.
    *& Avoid unncessary screens to populate while processing background.
                     LV_OPTIONS-DISMODE = 'N'.
                     LV_OPTIONS-UPDMODE = 'S'.
                     LV_OPTIONS-NOBINPT = 'X'.
                     CALL TRANSACTION 'MIGO' USING BDCDATA  OPTIONS FROM LV_OPTIONS MESSAGES INTO IT_MESSTAB1 .
                     WAIT UP TO 1 SECONDS.
                     DELETE IT_MESSTAB1 WHERE MSGTYP NE 'E'.
                     IF IT_MESSTAB1[] IS NOT INITIAL.
                       APPEND LINES OF IT_MESSTAB1 TO IT_MESSTAB.
                     ENDIF.
                   ENDIF.
                 ENDIF.
               ENDLOOP.
             ENDIF.
           ELSE.
             MESSAGE 'Shipment Number does not exists Or not Planned' TYPE 'E'.
           ENDIF.
         ELSE.
           MESSAGE 'Please insert Shipment Number' TYPE 'E'.
         ENDIF.
         IF lv_flag1 = 'X' AND lv_flag2 = 'X'.
           MESSAGE 'This shipment is processed with an inconsistent goods receipt' TYPE 'I'.
         ELSEIF lv_flag1 = 'X'.
           MESSAGE 'Shipment already been processed for these deliveries' TYPE 'I'.
         ELSEIF lv_flag2 = 'X'.
           lv_lines1 = lv_lines.
           CONDENSE lv_lines1 NO-GAPS .
           CONCATENATE lv_lines1 'Goods Receipt are posted for the shipment '
                  INTO lv_message SEPARATED BY space.
           MESSAGE  lv_message TYPE 'I'.
         ENDIF.
    * Display Messages from Message TAB.
         DELETE ADJACENT DUPLICATES FROM IT_MESSTAB.
         DATA:lv_msg TYPE string.
         LOOP AT IT_MESSTAB INTO WA_MESSTAB.
           CALL FUNCTION 'FORMAT_MESSAGE'
             EXPORTING
               ID        = WA_MESSTAB-MSGID
               NO        = WA_MESSTAB-MSGNR
               V1        = WA_MESSTAB-MSGV1
               V2        = WA_MESSTAB-MSGV2
               V3        = WA_MESSTAB-MSGV3
               V4        = WA_MESSTAB-MSGV4
             IMPORTING
               MSG       = lv_msg
             EXCEPTIONS
               NOT_FOUND = 1
               OTHERS    = 2.
           IF sy-subrc <> 0.
    * Implement suitable error handling here
           ENDIF.
           WRITE:/ lv_msg.
         ENDLOOP.
    *        Start new screen                                              *
       FORM BDC_DYNPRO USING PROGRAM DYNPRO.                 "#EC PF_NO_TYPE
         CLEAR BDCDATA.
         BDCDATA-PROGRAM  = PROGRAM.
         BDCDATA-DYNPRO   = DYNPRO.
         BDCDATA-DYNBEGIN = 'X'.
         APPEND BDCDATA.
       ENDFORM.
    *        Insert field                                                  *
       FORM BDC_FIELD USING FNAM FVAL.                       "#EC PF_NO_TYPE
         CLEAR BDCDATA.
         BDCDATA-FNAM = FNAM.
         BDCDATA-FVAL = FVAL.
         APPEND BDCDATA.
       ENDFORM.
    Thanks,
    Srini

    Hi Rob,
    Thanks for quick reply.
    I have checked the NOTE : 304122
    But there in the NOTE it says ( " BAPI, BAPI_GOODSMVT_CANCEL, BAPI_GOODSMVT_CREATE, CNTL_ERROR" )
    These BAPI's work perfectly for (purchase order as input type), but here out type is ( A01 & R05 ) we are giving DELIVERY NUMBER as input to MIGO.
    So for this scenario we cannot use those BAPI's mentioned in the NOTE.
    Also as stated earlier in the message interesting part is
    "The code works absolutely perfect only from my ID. But when I test from other ID it is not executing. Code is working exactly as expected ONLY to my ID. When i try to execute the same code from another's ID it is not working"
    So what do you think might be the issue?

  • BAPI_GOODSMVT_CREATE for Outbound delivery

    Hi Gurus,
    I am using BAPI_GOODSMVT_CREATE for creation of GRN against a Outbound delivery
    I am able to create the same using MIGO,but not with the help of this bapi
    i have passed GM_CODE as 01 and MVT_IND as L
    and all relevant datas but it throws an error
    E M7  226 Update control of movement type is incorrect (entry 101 X X _ L)
    What shall i do??
    Can any one help me?

    Hi,
    Leave MVT_IND as blank.
    And be sure to provide delivery number and item and other shipping details.
    Leave rest part as it is.
    Regards,
    Sunny

  • BAPI_GOODS_MVMT_CREATE - for MIGO 101 movmt type with serial no on Delivery

    Dear Gurus,
    Scenario
    We have to transfer serialized Material from one plant to another via STO
    ST order --> Delivery --> PGI (with Serial Number) --> MIGO at recieving plant.
    For MIGO (101) movement we want to use BAPI_GOODSMVT_CREATE.
    Now we have tried many combinations for it.
    if we se GM_CODE = '01'. and Movement Indicator 'B' (for purchase orders) then it gives error "Maintain Serial number."
    So if we maintaine serial number in thetable it says that you "cannot assign this serial number to the material "(AS the serial no is attached to the material at the time of PGI).
    Now if we try to change the the movement Indicator to 'L' (for deliveries) we are getting the error "Update control of movement type is incorrect (entry 101 X X _ L) "
    We have maintianed all necessary fields otherwise it would not give he Maintain srial no error (we think). I know this is very technical. but if anyone has prior knowledge please Help
    Dany

    Thanks for the reply.  The Price Control Indicator is 'S'.
    The solution was set up at my company before I joined, but the different movement type is to enable the free goods stock to make a Finance posting to a Bonus Stock GL Account.  Bonus stock sale update the same account.
    As I mention the '970' movement type worked fine with Goods Receipt against a Purchase Order (it was coded into to the user exit). 
    The MM procedures were changed to use the Inbound Delivery matched to the PO, this had a result that when the Goods receipt was posted in MIGO it posted as 101 movement, as the PO number was not being recognised.
    By making a further change to the user exit we able to suggest the '970' movement type, but now get the BORGR622 error I refer to.
    '511' is not possible against an inbound delivery either.

  • BDC for MIGO issue

    Hi All,
    I am trying to create BDC for MIGO T-code.But in recording part i am facing some problem
    recording steps : 1 .I am putting putting Purchasing Document Number.
                             2. Press enter.
                             3  Delivery Note
                             4. Bill of lading
                             5. GR/GI Slip No
                            6.  then in second part of screen i select batch tab and click on classification here i am
                                 geeting problem in normal way when we click this classification button new screen open in which we put values and then new batch is create but in recording after click on classification
    that screen is not coming so please can any body tell  how can i populate this classification screen.
    and put my values so migo process end.
    Regards
    Ankit

    Use this code
        l_meins = 'EA'.
      l_wa_goodsmvt_header-pstng_date = sy-datum.
      l_wa_goodsmvt_header-doc_date   = sy-datum.
      l_wa_goodsmvt_item-move_type      = '555'.
      l_wa_goodsmvt_item-move_plant     = '2000'   " Receiving plant
      l_wa_goodsmvt_item-move_stloc     = '0700'.  " Receiving SLoc
      l_wa_goodsmvt_item-material       = wa_ret_order-zzmat_no.
      l_wa_goodsmvt_item-entry_qnt      = wa_ret_order-zzqty_entered.
      l_wa_goodsmvt_item-plant          = wa_ret_order-zzissu_plant. " Plant
      l_wa_goodsmvt_item-stge_loc       = wa_ret_order-zzissu_strg_loc.
      l_wa_goodsmvt_item-entry_uom      = l_meins.
      l_wa_goodsmvt_item-entry_uom_iso  = l_meins.
      l_wa_goodsmvt_item-costcenter     = wa_ret_order-kostl.
      APPEND  l_wa_goodsmvt_item TO l_i_goodsmvt_item.
      l_goodsmvt_code-gm_code      = '03'.
    * Migo posting
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header  = l_wa_goodsmvt_header
          goodsmvt_code    = l_goodsmvt_code
        IMPORTING
          goodsmvt_headret = l_wa_goodsmvt_headret
          materialdocument = l_materialdocument
        TABLES
          goodsmvt_item    = l_i_goodsmvt_item
          return           = l_i_return.
    * Commit the changes
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = c_check.
    This code is mainly for creating STO
    Thanks
    Amitava

  • LSMW/BDC FOR MIGO

    Hello Friends,
    I have created LSMW (recording) for Migo Transaction .
    After running the LSMW it is not storing data for fields BED,SED,ECS in Excise ItemTab in Migo.
    I have also created a BDC and done recording through SHDB.
    But still the problem remains the same.After running BDC also it is not storing data for fields BED,SED,ECS in Excise ItemTab in Migo.
    I have run the BDC/LSMW in foreground mode where it places the values to the corresponding  fields
    but does not save it.
    But Manually doing Migo Transaction it stores the values for above field.

    Hi,
    WA_GOODSMVT_ITEM-MATERIAL =      P_MATNR.                    "'000000000000001556'.
        WA_GOODSMVT_ITEM-PLANT  =        P_WERK.                     " '1000'.
        WA_GOODSMVT_ITEM-STGE_LOC =      P_LGORT.                    " '0001'.
        WA_GOODSMVT_ITEM-MOVE_TYPE =     'Z42'.
        WA_GOODSMVT_ITEM-VENDOR =         P_ZZORG.                   "'0000100224'.
        WA_GOODSMVT_ITEM-ENTRY_QNT =      P_BAG.                   " '1'.
        WA_GOODSMVT_ITEM-ENTRY_UOM =     S_MARA-MEINS.
        WA_GOODSMVT_ITEM-ENTRY_UOM_ISO = S_MARA-MEINS.
        WA_GOODSMVT_ITEM-MOVE_PLANT = P_WERKS.
        APPEND WA_GOODSMVT_ITEM TO T_GOODSMVT_ITEM.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    EXPORTING
          GOODSMVT_HEADER          = T_GOODSMVT_HEADER
          GOODSMVT_CODE            = T_GOODSMVT_CODE
    IMPORTING
        MATERIALDOCUMENT           = V_MATERIAL
    TABLES
          GOODSMVT_ITEM            = T_GOODSMVT_ITEM
    RETURN                        = T_RETURN.
               EXPORT t_return  to MEMORY ID '123'.
               EXPORT V_MATERIAL TO MEMORY ID 'MAT'.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
         EXPORTING
           WAIT          = ' '.
    Thanks,
    Shailaja Ainala.

  • For writing a BDC for MIGO

    Hi,
    Can i write a BDC for Automatic good recipt in MIGO on the save of inbound delivery.
    Regards.

    Hello,
      It is hard to do BDC on Enjoy transactions based on Control Framework. For MIGO, you can use BAPI_GOODSMVT_CREATE.
    Thanks,
    Venu

  • FM for migo against outbound delivery

    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
    I am using this FM for migo against outbound delivery can i get waht parameters i have to pass
    for this FM for outbound delivery

    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
    itab-move_type  = '101'.
      itab-mvt_ind    = 'B'.
      itab-plant      = 'FD11'.
      itab-material   = '0000900152'.
      itab-entry_qnt  = '1.000'.
      itab-move_stloc = 'FG'.
      itab-stge_loc   = 'FG' .
      itab-po_number  = '5500004086'.
    itab-DELIV_NUMB = '0171000465'.
    itab-DELIV_ITEM    = '10'.
      itab-PO_ITEM    = '10'.
    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
    Error in function
    Material document data and PO data do not match (Material)
    i am getting this error
    help me

  • Update qty in delivery note through bapi for migo

    hi im using bapi for migo upload
    my requiremnt is to update QTY IN DELIVERY NOTE in migo.
    i got the folowing error if i dont pass the quantity.
    qty and/0r delivery indicator or final issue indicator missing
    if i pass the quantity field then it is changing quantity in unity of entity and qty in SKU i dnt want to change this field
    here is my code,
    gmcode-gm_code = '01'.
        ls_GOODSMVT_HEADER-pstng_date = tdate . "sy-datum.
        ls_GOODSMVT_HEADER-doc_date   = sy-datum.
        ls_GOODSMVT_HEADER-pr_uname   = sy-uname.
    loop at itab.
      ls_GOODSMVT_HEADER-REF_DOC_NO = itab-LFSNR.
      it_goodsmvt-move_type  = itab-BWART.
      it_goodsmvt-po_number  = itab-EBELN.
      it_goodsmvt-PO_ITEM  = '10'.
      it_goodsmvt-STGE_LOC  = itab-LGORT.
    it_goodsmvt-QUANTITY  = itab-LSMNG.
    it_goodsmvt-BASE_UOM = 'KG'.
    it_goodsmvt-material = 'RC1092'.
    it_goodsmvt-entry_qnt = itab-LSMNG.
    it_goodsmvt-ENTRY_UOM  = 'KG'.
      it_goodsmvt-mvt_ind = 'B'.
      it_goodsmvt-plant = 'G001'.
    it_goodsmvt-NO_MORE_GR = 'X'.
    append it_goodsmvt.
    clear it_goodsmvt.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header               = ls_GOODSMVT_HEADER
        goodsmvt_code                 = gmcode-gm_code
      TESTRUN                       = ' '
      GOODSMVT_REF_EWM              =
    IMPORTING
      GOODSMVT_HEADRET              =
       MATERIALDOCUMENT              =  lf_MATERIALDOCUMENT
       MATDOCUMENTYEAR               = lf_MATERIALDOCYEAR
      tables
        goodsmvt_item                 = it_goodsmvt
      GOODSMVT_SERIALNUMBER         =
        return                        = return
      GOODSMVT_SERV_PART_DATA       =
      EXTENSIONIN                   =
    if return-type ca 'EA'.
          rollback work.
          message id '26' type 'I' number '000'
          with return-message.
        else.
          call function 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      WAIT          =
    IMPORTING
      RETURN        =
          wait up to 5 seconds.
        endif.
    select * fROM mseg
          INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
                             where mblnr = lf_MATERIALDOCUMENT and
                                       MJAHR = lf_MATERIALDOCYEAR.
      LOOP AT IT_MSEG INTO WA_MSEG.
        IF WA_MSEG-LSMNG IS INITIAL.
          wa_mseg-lsmng = ITab-LSMNG.
          UPDATE MSEG from wa_mseg.
          commit work.
          wait up to 5 seconds.
        ENDIF.
      ENDLOOP.
    ENDLOOP.

    It is been done by implementing one implicit enhancement in FM: MAP2I_B2017_GM_ITEM_TO_IMSEG
    I have added the below functionality at the end of the function module.
    Just i have maped the ERFMG i.e ent_qnt(Received quanity) with LSMNG i.e qty.in del note
    All best for others.
    $$-Start: (1)----
    $$
    ENHANCEMENT 1  Z_EV_IMP_GOODSMOVEMENT.    "active version
    Populate the delivery note quantity and UoM
    IF IMSEG-ERFMG IS NOT INITIAL.
      MOVE IMSEG-ERFMG TO IMSEG-LSMNG.
      MOVE IMSEG-ERFME TO IMSEG-LSMEH.
    ENDIF.
    ENDENHANCEMENT.
    Thanks,
    Mahesh.Gattu
    Edited by: Maheshkumar gattu on Dec 3, 2010 4:35 PM

  • BAPI for MIGO - Movement Type 122 - Return deliveries to vendor

    Hi,
    I've been reading about bapi's for migo and the most commom was: BAPI_GOODSMVT_CREATE
    But I want to do a Movement Type 122, and that is not supported by the BAPI.
    Any idea beside Batch Input ?

    Ildar,
    Try this:
    GOODSMVT_HEADER:
    PSTNG_DATE
    DOC_DATE
    REF_DOC_NO (mandatory)
    GOODSMVT_CODE = 01
    GOODSMVT_ITEM
    MATERIAL
    PLANT
    STGE_LOC
    MOVE_TYPE = 122
    ENTRY_QNT
    PO_NUMBER
    PO_ITEM
    MVT_IND = B (reference to the document that has the request )
                    MOVE_REAS (mandatory as well)
    Let me know if you need any further help.
    Francisco Coutinho,
    ToInovate

  • How to create an RFC for MIGO transaction?

    How to create an RFC for MIGO transaction?
    I want my RFC to accept all details as accepted in MIGO transaction.
    For the entered PO no, display the materials against it and allow user to enter the quantity for the same.
    Then the user should be able to post the PO by executing the RFC.
    Kindly revert asap.
    Thanx in advance,
    Bhakti

    Put good movement header data in structure header
      l_header-pstng_date = sy-datum.
      l_header-doc_date = sy-datum.
      l_header-ver_gr_gi_slip = space.
    Assign goods movement code
      l_wa_goodsmvt_code-gm_code = c_gm_code.
    Add material, plant, and other line item details in
    goods movement item table
      l_wa_goodsmvt_item-material = l_wa_selected-matnr.
      l_wa_goodsmvt_item-plant = l_wa_selected-werks.
      l_wa_goodsmvt_item-stge_loc = l_wa_selected-lgort.
      l_wa_goodsmvt_item-batch = l_wa_selected-charg.
      l_wa_goodsmvt_item-move_type = l_wa_selected-mov_type.
      l_wa_goodsmvt_item-entry_qnt = l_wa_selected-deviceid.
      l_wa_goodsmvt_item-entry_uom = l_wa_selected-meins.
      l_wa_goodsmvt_item-move_plant = l_wa_selected-zwerks.
      l_wa_goodsmvt_item-move_stloc = l_wa_selected-zsloc.
      l_wa_goodsmvt_item-move_batch = l_wa_selected-rec_batch.
      l_wa_goodsmvt_item-serialno_auto_numberassignment = space.
      APPEND l_wa_goodsmvt_item TO l_i_goodsmvt_item.
      CLEAR l_wa_goodsmvt_item.
      l_wa_serial_num-matdoc_itm = l_c_mat_doc_item.
      l_wa_serial_num-serialno = l_wa_selected-sernr.
      APPEND l_wa_serial_num TO l_i_serial_num.
      CLEAR l_wa_serial_num.
    To call BAPI BAPI_GOODSMVT_CREATE to transfer material of transfer
    type one step
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header       = l_header
          goodsmvt_code         = l_wa_goodsmvt_code
        IMPORTING
          goodsmvt_headret      = l_goodsmvt_headret
        TABLES
          goodsmvt_item         = l_i_goodsmvt_item
          goodsmvt_serialnumber = l_i_serial_num
          return                = l_i_return.
    cheers
    Aveek

Maybe you are looking for

  • Pics can't post to web Ovi share

    My E71 has stopped allowing me to post any pictures to the web using Ovi Share. Every time I try to upload a pic I get a message saying - One or more media items discarded because service provider does not support them. Thanks for any help in advance

  • Installation of BOBI.

    Hi, Our Company has decided to implement BOBI. Currently we are on ERP6 EHP4 with Abab stack only. Since BOBI will require the java stack  but in EHP4 add-in installation is not possible. So should we install a new system with abap + java stack upgra

  • How do I share Safari bookmarks with another Apple ID  in iOS 8?

    My husband and I share the same Safari bookmarks, calendar, contacts, reminders, notes.  We've always been able to share tall of them across his devices by adding my Apple ID account to my spouse's devices in the Mail, Contacts, Calendars under setti

  • HT3939 My iphone is 1387 unlocked international HOW TO USE IT ON CDMA MODE ??

    Hello there I have Iphone 4s type A1387 originally unlocked (I PAID FULL PRICE ) When i was on 5.1.1 software version i was able to call CDMA service numbers Then when i upgrades it to 6.0.2 Im not able to do so again . My quistion is sinse iphone 4s

  • HT4059 What is the largest iBook size I can author?

    I am makeing my first iBook using Pages for my text. The book is just for my family and not for publication. What is the maximum size that I can convert to an iBook?