Need BAPI for MIGO to create a Goods Receipt against PO &Outbound Delivery

Hi Friends,
GRN’s (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
          If PO Number = EKKO-EBELN    GR against Purchase Order
                        = LIKP-VBELN      GR against Outbound Delivery
Based on the above condition I need to create a Goods Receipt. 
Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
The fields available are with us are...
Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number… SLED
Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
Please provide sample code if possible.
Waiting for replies,
Thanks and Regards,
Sudha

Hi Friends,
GRN’s (Good receipt notifications) created in DHL (Non SAP system) will need to be communicated to SAP.
I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.The requirement is like below:
PO number field in output file is checked against entries in EKKO-EBELN, if a match is found the GR is posted against a Purchase Order otherwise LIKP-VBELN is checked and if a match is found GR is posted against an Outbound Delivery.
          If PO Number = EKKO-EBELN    GR against Purchase Order
                        = LIKP-VBELN      GR against Outbound Delivery
Based on the above condition I need to create a Goods Receipt. 
Could you please tell me the GM code, movement types and the required fields to be passed for the BAPI?
The fields available are with us are...
Header text. - Bill of Lading- Posting Date-Quantity- UOM--- Vendor Batch / Batch / Serial No --- PO Number or Delivery Number… SLED
Are these fields sufficient for doing MIGO with the BAPI or do we require more fields???
Please provide sample code if possible.
Waiting for replies,
Thanks and Regards,
Sudha

Similar Messages

  • Post a good issue against an outbound delivery with movement type 601 K

    Hello,
    according to my business scenario I need to manage the stock of different vendors into the client's location (plant) at storage location level and I need to post the good issue against an outbound delivery to decrease the stock level.
    Since the owner of the goods isn't my client the item is managed only at quantity level (not value) so I'm not interesed in the accounting document.
    To do it I'm using the functionality related to the vendor consignment stock but I'm not able to post the good issue against an outbound delivery using the movemement type 601 and the special stock indicator equal to K.
    In particular I've tried in two different ways:
    - setup the consignment stock indicator (= K) into the sales item category, but when I post the goods issue the system is not able to find out the right vendor
    - to create a stock determination rule instead of the setting previous described, but the system display an error message (Fld selectn for mvmt type 601 / acct L534200770 differs for Cost center (010) ) even if the accouting is not relevant in my scenario
    Can you suggest me how the system has to be setup in order to cover my requirements?
    Thanks in advance,
    Alessandro

    Hi,
    Please clarrify which material type you are using in this scenario? I suggest you to use material type UNBW (no value updation will be there) and create a material master.  Use special stock indicator K. Proceed with 601K to do GI. Hope it works. Thanking you.

  • Bapi for transaction 'MB1C' -'Enter other goods receipt...'

    Hi,
    Please suggest the BAPI for the transaction 'MB1C'.
    thanks

    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
               call function 'BAPI_GOODSMVT_CREATE'
               exporting
                   goodsmvt_header             =
                   goodsmvt_code               =
                 *   TESTRUN                     = ' '
              IMPORTING
                  goodsmvt_headret            =
             *   MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
               tables
                 goodsmvt_item               =
      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.
                move errmsg-message to i_msg2.
                append i_msg2.
              endloop.
              if errflag is initial.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT          =
              IMPORTING
                RETURN        =
         endif.

  • Post goods receipt against a Inbound Delivery(VL32N) FM or BAPI Method

    Hi Expert,
       I am looking for a Function Module or BAPI Method to Confirm the Inbound Delivery i.e. that can post Goods Movement Against a Delivery Document.
    My scenario is Create PO-> create Inbound delivery-> post Goods Receipt.
    Regards,
    Kapil.
    Edited by: Kapil Kumar Gupta on May 5, 2011 2:46 PM

    In OSS note 520813 it is said:
    16. Question:
    Which goods movements should I not post using the BAPI_GOODSMVT_CREATE BAPI?
    Answer:
    You should not post the goods receipt for the inbound delivery using BAPI_GOODSMVT_CREATE BAPI because the document base and the status of the inbound delivery are not updated. See Note 199703.
    If you check OSS note 199703 you can see that it is valid from release 45 to release 500.
    Assigned to this note you can find another: 1050944 (it's worth of reading!!!).
    I feel there are contradictions here - it might possible that the first note (520813) is not updated properly. (As far as I remember in my case this BAPI was working properly too).
    In my opinion you should send a message to OSS and ask them whether the statement in note 520813 is still valid or not - you should also tell them that the referred note (199703) is not applicable to ECC6.0.
    (there's a setting in ECC6.0 which enables that document flow is updated if GR is posted via MIGO with reference to IBD - V_TVSHP-SPE_INB_VL_MM)
    I would like to ask you if you have a reply from them, please update this thread - it may be helpful for us.
    Edited by: Csaba Szommer on May 9, 2011 2:34 PM
    One more remark: (based on OSS note 1050944) it seems that you cannot use it only in case of packing (IBD with HU).
    Edited by: Csaba Szommer on May 9, 2011 3:05 PM

  • Idoc to post goods issue against an outbound delivery

    We happened to simulate both the idocs 'WPUWBW01' and 'MBGMCR02' for posting goods issue for an outbound delivery but failed.
    Request you people to help us on this. Is there another idoc that we have to use to post GI... if so please let us know... and if we are using the right one, guess we are not executing it in the right way... in such a case please guide us with the steps...
    Thanks
    Arun
    We got hold of the Idoc type 'DELVRY03 PGI SHPCON' we are able to post the Idoc but we are able to do the packing only or we are able to change the deliveries but the PGI is not happening..
    please help us on this.. is there some condig that updates the delivery with the PGi or is there something else do be done in the Idoc....
    will provide additional details if required.
    Thanks

    Hi Arun,
    There are no configuration settings in this. It is development that your abaper need to carry out.
    Explain to him that this is the func module. And intrun it has to either trigger a BDC or BAPI for creating packing and PGI.
    He should then do the recording of that and will assign the program pertaining to BDC with in the function module.
    One more suggestion is to put the same query in ABAP section too. U will definitely get a positive response.
    Hope this helps.
    Kind Regards
    Chakradhar

  • Goods receipt against outbound delivery

    Hello,
    Can we create a goods receipt against an outbound delivery document?
    The transaction MIGO provides an option but for some reason I am not able to create.
    The scenario is the following  :
    Lets say there are two DCs DC1 and DC2  : both belong to different company codes.
    - Outbound delivery created by DC1,then post goods issue
    - Goods receipt to be done against the above outbound delivery.
    Is it possible?
    (I do not want to create a PO for this.)
    Regards,
    Lisa

    Hi Prabhu,
    I have been trying to post goods receipt against outbound delivery but here is the error I have been getting :
    "Goods receipt not possible for delivery 80000059: error code 4".
    Is there any specific reason for this?
    Here is the process I have follwed :
    -Created outbound deliveries via allocation
    -Picking
    -Post Goods Issue
    - Migo - Goods Receipt.
    Regards,
    Lisa

  • 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

  • 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

  • Automated statistical goods receipt against inbound delivery

    Hi,
    We have set up a process that we get a DELVRY03/DESADV Idoc from our vendor to confirm the delivery to our customer. This DESADV Idc will create an inbound delivery and a statistical goods receipt will be posted.
    Now we have a new requirement, the vendor material has a serial number assigned. We get the serial number in segment E1EDL11 and it will be copied into the inbound delivery, unfortunately the statistical goods receipt will use transaction MB01 and it will post the statistical goods receipt against the purchase order details which did not contain the any serial number information.
    Is there any way to set up the automated goods receipt against the inbound delivery and not against the PO?
    Thank you,
    Frank

    Hi,
    Anybody out there who knows how to enable an automated goods receipt against an inbound delivery?
    Thank you,
    Frank

  • Find a bapi for Creates a Goods Receipt with correspond to Inbound Delivery

    hi expert!
    exist a bapi for tcode:MIGO_GR ( Goods Receipt with correspond to Inbound Delivery)
    i know one bapI  BAPI_GOODSMVT_CREATE can Creates a Goods Receipt,
      but i can't know to use it to Creates a Goods Receipt with correspond to Inbound Delivery.
    or other bapi exist for MIGO_GR?
    Best Regard!

    Hi Vatcan,
    Chek the Inbound Delivery 1st weather you refer the right PO in it
    You can also chek in  PO i
    1 Me23n Go to confirmation tab here you can see the  Inbound delivery  quantity
    2 Chek  which reference document you recived the goods,  (i.e You recived the goods with reference to PO or  Inbound delivery)
    2 Coz if you refer the inbound delivery then syestem will deafult show the inbound quanity
    And yes the actual quanity will update in inbound delivery if you refer the inbound deivery while reciveing the goods

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • Call BAPI_GOODSMVT_CREATE to create a goods receipt for purchase order

    Hi,
    I'm calling the bapi BAPI_GOODSMVT_CREATE to create a goods receipt for purchase order, but the following code doesn't work. It doesn't give me any kind of error message but it does nothing as well...
    Can anyone help me please?
    Thank You
    Hugo
    Code
    DATA: wa_goodsmvt_header  LIKE bapi2017_gm_head_01,
                            wa_goodsmvt_code    LIKE bapi2017_gm_code,
                            wa_bapi2017_gm_head TYPE bapi2017_gm_head_ret-mat_doc.
                      DATA: it_goodsmvt_item LIKE bapi2017_gm_item_create OCCURS  0 WITH HEADER LINE,
                            it_return        LIKE bapiret2 OCCURS  0 WITH HEADER LINE.
                      wa_goodsmvt_header-pstng_date = SY-DATUM.
                      wa_goodsmvt_header-doc_date   = SY-DATUM.
                      wa_goodsmvt_header-ref_doc_no = '4500000020'.
                      wa_goodsmvt_code-gm_code = '01'.          "Goods receipt for purchase Order
                      it_goodsmvt_item-stge_loc  = 'BPF2'.
                      it_goodsmvt_item-move_type = '101' .
                      it_goodsmvt_item-entry_qnt = 17.
                      it_goodsmvt_item-entry_uom = 'KG'.
                      it_goodsmvt_item-mvt_ind   = 'B'.
                      it_goodsmvt_item-po_number = '4500000020'.
                      it_goodsmvt_item-po_item   = '00010'.
                      it_goodsmvt_item-material  = '50'.
                      APPEND it_goodsmvt_item.
                      CALL FUNCTION  'BAPI_GOODSMVT_CREATE'
                        EXPORTING
                          goodsmvt_header  = wa_goodsmvt_header
                          goodsmvt_code    = wa_goodsmvt_code
                        IMPORTING
                          materialdocument = wa_bapi2017_gm_head
                        TABLES
                          goodsmvt_item    = it_goodsmvt_item
                          return            = it_return.
                        data: begin of errmsg occurs 10.
                                include structure bapiret2.
                        data: end of errmsg.
                        data: wmenge like iseg-menge,
                              errflag.
                        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:/ 'Ok'.
                          endif.
                        endif.
                        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                        EXPORTING
                        wait = ' '.

    Hi,
    Thank you for the asnwer! I'm a rookie at ABAP so please forgive my stupid questions
    I've changed the code to:
    DATA: wa_goodsmvt_header  LIKE bapi2017_gm_head_01,
                            wa_goodsmvt_code    LIKE bapi2017_gm_code,
                            wa_bapi2017_gm_head TYPE bapi2017_gm_head_ret-mat_doc.
                      DATA: it_goodsmvt_item LIKE bapi2017_gm_item_create OCCURS  0 WITH HEADER LINE,
                            it_return        LIKE bapiret2 OCCURS  0 WITH HEADER LINE.
                      wa_goodsmvt_header-pstng_date = SY-DATUM.
                      wa_goodsmvt_header-doc_date   = SY-DATUM.
                      wa_goodsmvt_header-ref_doc_no = '4500000020'.
                      wa_goodsmvt_code-gm_code = '01'.          "Goods receipt for purchase Order
                      it_goodsmvt_item-plant     = 'BP01'.
                      it_goodsmvt_item-stge_loc  = 'BPF2'.
                      it_goodsmvt_item-move_type = '101' .
                      it_goodsmvt_item-entry_qnt = 10.
                      it_goodsmvt_item-entry_uom = 'KG'.
                      it_goodsmvt_item-mvt_ind   = 'B'.
                      it_goodsmvt_item-po_number = '4500000020'.
                      it_goodsmvt_item-po_item   = '10'.
                      it_goodsmvt_item-material  = '50'.
                      APPEND it_goodsmvt_item.
                      CALL FUNCTION  'BAPI_GOODSMVT_CREATE'
                        EXPORTING
                          goodsmvt_header  = wa_goodsmvt_header
                          goodsmvt_code    = wa_goodsmvt_code
                        IMPORTING
                          materialdocument = wa_bapi2017_gm_head
                        TABLES
                          goodsmvt_item    = it_goodsmvt_item
                          return            = it_return.
                          write:/ it_return-message.
    And the return message is : Material document data and PO data do not match (Material)
    Any idea of what might be the problem?
    Thanks

  • Need BAPI for Parking G/L Account

    Hi All,
    I need BAPI for Parking G/L account document.
    Please let me know.
    Regards
    R.Ragu
    Useful Answers will be rewarded.

    Hi Ragu.
    Try these:
    BAPI_GL_ACC_EXISTENCECHECK
    BAPI_GL_ACC_GETDETAIL
    BAPI_GL_ACC_GETLIST
    For further details GoTo->Transaction BAPI->Alphabetical->General Ledger Account.
    Good Luck & Regards
    Harsh
    Edited by: Harsh Dave on Jul 11, 2008 10:14 AM

  • Bapi for MIGO that can update freight supplier

    dear all
    we are presently using ALE_GOODSMVT_CREATE to create a migo document.
    the requirement now is to update the frieght supplier too.
    this present bapi is not able to update the supplier.
    does any one faced this problem before and if yes how did it got overcome ??
    regards

    check this link: It may not be exactly what you are looking for but will guide you:
    BAPI for MIGO
    cheers
    Aveek

  • 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

Maybe you are looking for

  • Is there a way of making Search be for exact string match?

    When I generate a help system (RoboHelp 7), and search on, say, "contact type", the system returns a list of topic links of topics that contain the word "contact" or the word "type". What I'd like is for it to do as PDF search does and return only to

  • Disk Utility Verify/Repair options

    When I Verify my HD in Disk Utility I get this error. Why does it say this? Should I Repair the disk? Will I lose data? Any help thanks!

  • Imaging a dual boot system - Windows and Linux

    Using Zenworks 7, I have tried several experiments and all of them seem to fail. If I do any kind of Windows install, then make a image, then restore the image, it works just fine. However, if I also install Linux, and use the Linux multiboot menu, a

  • Create DMS document from direct object transaction instead of CV01N

    Dear Experts, I have raised an issue for the same thing in past and got helpful reply also. However it is not working here. I have searched enough but did not get satisfactorily answer. My requirement here is to create and store DMS document directly

  • How to modify standard or custom Interactive Reports

    Hello everyone! Is there a possibility to modify SAP standard Interactive Reports? Where can this be done? Also if I create a new custom Interactive Report using Wizard in WebUI I don't find any transaction where I can modify it. Should I use some SA