BAPI needed  for  Goods Receipt Purchase Order(Transaction : MIGO)

Hi all,
We have a requirement where in we need to post the documents throuh BAPI for Goods receipt Purchase order(Transaction: MIGO).
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.

Hi,
use 'BAPI_GOODSMVT_CREATE'
Check this sample.
code
REPORT ZRICH_0001 .
Structures for BAPI
DATA: GM_HEADER TYPE BAPI2017_GM_HEAD_01.
DATA: GM_CODE TYPE BAPI2017_GM_CODE.
DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
DATA: GM_ITEM TYPE TABLE OF
BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
DATA: GM_RETURN TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: GM_RETMTD TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
Setup BAPI header data.
GM_HEADER-PSTNG_DATE = SY-DATUM.
GM_HEADER-DOC_DATE = SY-DATUM.
GM_CODE-GM_CODE = '04'. " MB1A
Write 971 movement to table
CLEAR GM_ITEM.
MOVE '412' TO GM_ITEM-MOVE_TYPE .
MOVE 'Q' TO GM_ITEM-SPEC_STOCK.
MOVE '3800533484' TO GM_ITEM-MATERIAL.
MOVE '1' TO GM_ITEM-ENTRY_QNT.
*MOVE 'PC' TO GM_ITEM-ENTRY_UOM.
MOVE '1060' TO GM_ITEM-PLANT.
MOVE '0007' TO GM_ITEM-STGE_LOC.
*MOVE '0901' TO GM_ITEM-MOVE_REAS.
MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
APPEND GM_ITEM.
Call goods movement BAPI
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GM_HEADER
GOODSMVT_CODE = GM_CODE
IMPORTING
GOODSMVT_HEADRET = GM_HEADRET
MATERIALDOCUMENT = GM_RETMTD
TABLES
GOODSMVT_ITEM = GM_ITEM
RETURN = GM_RETURN.
IF NOT GM_RETMTD IS INITIAL.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ELSE.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
WRITE:/ GM_RETMTD.
LOOP AT GM_RETURN.
WRITE:/ GM_RETURN.
ENDLOOP.
[/code]
Also check the Bapis
BAPI_PO_CREATE --> To create Purchase Order
BAPI_PO_CHANGE --> To change Purchase Order
BAPI_PO_GETDETAIL --> Todisplay Purchase Order
Regards,
Raj.

Similar Messages

  • BAPI for  Reversal of Goods Receipt Purchase Order(Transaction : MIGO)

    Hi all,
    Is there any BAPI for the Reversal of posting the documents Goods receipt Purchase order
    (Transaction: MIGO).
    Any inputs on this..is highly appreciable...
    thanks in advance...
    regards..
    prathima.

    Hi,
    Try this passing material doc and year.
    * Cancel the goods movement (creates a reversal document)
      CALL FUNCTION 'BAPI_GOODSMVT_CANCEL'
        EXPORTING
          materialdocument = g_material_doc
          matdocumentyear  = g_matdoc_year
        TABLES
          return           = i_return.
    Edited by: Raj on May 14, 2008 7:46 PM

  • BAPI needed for goods receipt for delivery created from sales order

    Hi experts,
    I need help.
    I want to post goods receipt for the delivery created from sales order. I have tried out BAPI BAPI_GOODSMVT_CREATE but I am not able to post it.
    Is there any way to post this? I need BAPI and not FM MB_*....
    Thanks & REgards,
    Bhavin A. Shah

    Hi,
    Please refer to link,
    https://wiki.sdn.sap.com/wiki/display/Snippets/BAPI_GOODSMVT_CREATE-ABAP
    Regards
    Shree

  • Automatic Goods Issue for Goods Receipt (Purchase Order).

    Hi,
    Experts - I have some newbee problem.
    I have to create ZMIGO to behave like follows:
    1. User enters all necessary data (like in MIGO) and posts document.
    2. System creates automatic Goods Issue document based on data entered in 1. (above).
    I doubt full automatic posting of GI will be possible (user has to fill in WBS for GI and possibly change "GI for project"). So my idea is to redirect user from ZMIGO (after posting) GR document to MIGO_GI and pass all necessary parameters. And thats my question: How to do it? Is it possible? Any other ideas? Maybe examples???
    Will reward points to all helpful answers.
    Regs,
    FS

    Hi,
    I've created implementation for MB_DOCUMENT_BADI in se19 (named it: ZMB_DOCUMENT_BADI_1). Filled methods with code and put some break-points. Activiated methods and implementation.
    When I post documents via MIGO this BADI is not executed! Why? When I've searched program SAPLMIGO for cl_exithandler only two were found: MB_MIGO_BADI and MB_MIGO_ITEM_BADI. What I have to do to activate this MB_DOCUMENT_BADI???
    Points waiting for helpful answers.
    REgs,
    FS

  • Goods Receipt Purchase order

    Hi All,
    In Goods Receipt Purchase order(MIGO) Transcation, we r having delivery note (LFSNR) field, i want to retrive this field from data base , so can any body tell me the exact table for this delivery note field.
    BALU.

    Hi,
    LFSNR field is nothing but xblnr which u can find in table mkpf.
    For this, u need to know material document no, ie,mblnr.
    If u pass mblnr,mjahr to table Mkpf, u will get field xblnr which is nothin but lfsnr which u req.
    Hope ur query is solved.
    **REWARD ALL HELPFUL ANSWERS

  • Getting error in goods receipt purchase order

    I am getting the error when running the goods receipt purchase order..
    "Account determination for entry 1000 (COA) BSX 1200 ( Co Code) -- CAR1 ( raw material )not possible"
    Can some one suggest me for above error..
    Praveen

    Hi
    Check valuation grouping code is active in OMWD for the valuation area and then check OBYC settings for chart of accounts - for BSX transaction key - GL account has been assigned.
    Thanks

  • No valuation type at Goods Receipt Purchase Order

    Hi,
    No valuation type at Goods Receipt Purchase Order and have to manually input the valuation type. How to default it so that the valuation type is populated automatically and gray out without any changes to the valuation type ?
    Thanks.

    hi Pankaj,
    The valuation tyoe is appearing for the hearder material only & not for the child material.
    is there any way possible to get the valuation type of child material.
    & moreover I have tried with Purchase  info record ,But not helpful
    Please aadvice
    Regards,
    Vivek
    Edited by: vivek sharma on Aug 1, 2008 3:35 AM

  • Trying to link Goods Receipt Purchase Order (OPDN) to Landed Cost (OIPF)?

    Hi Everyone,
    I am wondering what the link is between a Goods Receipt Purchase Order and a Landed Cost. Here is a diagram of the link that I am trying to determine.
    According to the Database Tables Reference there is a link between OPDN (Goods Receipt Purchase Order) and OIPF (Landed Costs) called 'ImportEnt', as shown below -
    However I can't work out what 'ImportEnt' links to on the OPDN (Goods Receipt Purchase Order) side.
    Any advice concerning how to link OPDN to OIPF will be greatly appreciated.
    Kind Regards,
    David

    Hi Nagarajan,
    Thank you for the helpful response. The key to fixing my query was in the code below (which you kindly shared) -
    LEFT JOIN PDN1 T2 ON T1.[BaseEntry] = T2.[DocEntry] AND T1.[LineNum] = T2.[BaseLine]
    Kind Regards,
    David

  • Pay in advance before Goods Receipt Purchase Order

    Hi Experts,
    I would to know if it possible set a process of Paying in advance before to receive  Goods from Purchase Order
    Steps, like
    1-Create P.O (ME21N).
    2-Enter Incoming invoice (MIRO) (full or partial).
    3-Goods Receipt Purchase Order (MIGO).
    Could you suggest me?
    Thanks in advance,
    Ignacio

    If you want post the invoice prior to GR than you should not check the Gr-based invoice in the PO invoice tab then system will allow you to post the invoice.
    and later you can post the GR.
    until you post the GR you will see the open GR in MB5S tcode.

  • Bapi bapi_goodsmvt_create for goods receipt of process order

    Hello All ,
    I am trying to a GR with MIGO for a process order .Its giving me error like
    Content of order 2000002339: 100001374 transferred to interface (IMSEG): 100001374
    I am not able to trace the error out .I am passing the below parameters .pls check
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '02'.   "01 - MB01 - Goods Receipts for Purchase Order
    itab-move_type  = '101'.
    itab-mvt_ind    = 'F'.
    itab-plant      = '1AAE'.
    itab-material   = '100001374'.
    itab-entry_qnt  = '1'.
    itab-move_stloc = 'B100'.
    itab-stge_loc   = 'B100'.
    itab-orderid  = '002000002339'.
    append itab .
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
      TESTRUN                     = ' '
    IMPORTING
        goodsmvt_headret            = wa_head
       materialdocument            = lv_mblnr
      MATDOCUMENTYEAR             =
      TABLES
        goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    Pls reply ..
    Thanks .

    HI ...
    Since this is a production order ,i used the GM code as '02'.bcoz the documentation says the same .
    There are the following types of transactions/events:
    1. GM_Code 01: Goods receipt for purchase order
    2. GM_Code 02: Goods receipt for production order
    3. GM_Code 03: Goods issue
    4. GM_Code 04: Transfer posting
    i also tried changing it to '01' ,its not working still...
    Pls reply
    Thanks .

  • New batch number for Draft Good Receipt Purchase Order

    Hello,
    I'm using SBO 8.81
    I'm looking for the table that contains the information about the batch number of a draft good receipt.
    DRF16 contains quantity of batch, but when itu2019s new batch, they are not in OBTN yet (in the table, SBO define object type as 10000068 while itu2019s 10000044 for existing batch)
    The query defined here  is not working as the batches are not in OBTN yet (not in stock)
    I used the profiler trying to understand in which table these data are recorder, without success.
    Any idea ?
    Thank you for your help
    Sébastien
    Edited by: Sébastien Danober on Aug 24, 2011 6:31 PM
    Sorry, wrong forum, I recreate it under SDK

    Hi Sébastien,
    The link is from DRF16 to ODBN:
    select * from DRF16 T0 inner join ODBN T1 on T0.ObjAbs = T1.AbsEntry
    DRF16 has a zero-to-many relationship with DRF1 (ie draft lines)
    Kind Regards,
    Owen

  • SAP console goods receipt purchase order

    Hi all,
    I'm new at SAP console, and I need it to make goods reception from a purchase order with a mobile device (PDA).
    Is there any way to make it without performing a Warehouse Management customizing in SAP ERP system??? I've seen a goods receipt menu with several reception options which seems to be WM options (transport orders, etc), but I didn't see the option to make a goods reception with reference to a purchase order (like in MIGO transaction)
    Thanks in advance
    Regards

    OK, thanks a lot, that was very helpful. Now I know how to focus the problem I've some doubts.
    I'm going to customize a basic WM to work with the SAP console.
    My idea is to do a process similar to the next one:
    1) The purchase order is created inn SAP R3 with confirmation type 0004 (for inbound deliveries).
    2) Create in SAP R3 the inbound deliveries corresponding to the previous purchase orders.
    3) Create in SAP R3 the Transport Orders corresponding to the previous inbound deliveries.
    4) Confirm de Transport Orders/Inbound deliveries from the SAP console mobile device.
    5) Post the goods receipt for the confirmed inbound deliveries in SAP R3.
    Is there any way to avoid steps 2 and 3? I mean:
    - Can the inbound deliveries be automatically generated when the purchase order is saved?
    - Can the TO's be automatically generated when the inbound delivery is created?
    Right now, I'm doing these 2 steps with collective transactions, but if it is possible I'd like to do it automatically.
    Thanks a lot.
    Best regards

  • BAPI/FM for goods receipt for a Sub Contracting PO

    Hi All,
    Is there a BAPI/FM to perform goods receipt for a sub contracting PO? BAPI_GOODSMVT_CREATE can not perform goods receipt for sub contracting PO.
    My purpose would be served if I can know how to find the component material of a subcontrcting PO.
    Please help.
    Thanks,
    Rana

    Thanks for your input
    Well, I wanted to ask if the BAPI is capable of performing GR for SC PO. Instead of a question, that went as a statement :-). Your recommendation helped me to find answer to my question.
    Thanks again.

  • Errors while trying for goods receipt of orders saved

    Dear members,
                While clicking the goods receipt of the material I got the following two errors while trying it  for  different materials in two different situations:
    1. No SLED processing for material . Data entered is can cancelled. What does this mean?
    2. I am getting Mat. is a miss. Part MRP controller INTERTHAL will be notified. how do I handle this error.
    Regards,
    Sandhya

    1) you have to enter Self life expiraiton date or produciton date.
    2) Go to CO24 and check the missing part for this material and resolved that than do GR.

  • BAPI FM for goods receipt

    guyz!
    can any one say me, is there bapi function module to create goods receipt and reverse the existing goods receipt?
    thnx
    manas

    hi,
    BAPI_GOODSMVT_CANCEL  you can use this to cancel.
    You can search these function modules in SE37 BY giving
    "BAPIGOODS" etc..words..
    regards
    srikanth
    Message was edited by: Srikanth Kidambi

Maybe you are looking for