Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI for posting the GR through Transaction code MIGO_GR

Former Member
0 Likes
2,296

Hi Experts,

I have a requirement to post inbound delivery with reference of PO GR through transaction code MIGO_GR, Actually in requirement while we press shipment planning button has been checked in the shipment document idoc will trigger to destination system and the inbound delivery will post the GR with reference of PO using BDC to update through transaction code - MBOA as per our current logic.

Now we are going for a new EDI setup with defferent partner there we need to post the inbound delivery with referance of PO through transaction code - MIGO_GR, So for i need to create a new inbound function module for post the GR with referance of PO but in new function module for posting instead of BDC i want go through BAPI to update in transaction code - MIGO_GR. Anyone can help me for updating GR in transaction code which BAPI is suitable.

Thanks.

6 REPLIES 6
Read only

rajucd81
Participant
0 Likes
1,508

Hi Ramesh,

Pls check this link, which may helpful for your requirement.

Thanks

Raju C D

Read only

Former Member
0 Likes
1,508

Hi Raju,

I saw your logic but that is not fully explained can u give me Full logic if it is possible.

Read only

0 Likes
1,508

This logic I did for to create GR against to few line items of an inbound delivery, but your case is through IDOC you are going to post GR, But it works for your requirement also I think in your inbound function module you can use this logic after splitting data from IDOC structures into BAPI structures .

Thanks

Raju C D

Read only

Former Member
0 Likes
1,508

Hi Raju,

You are correct after receiving only inbound delivery i need to fetch PO based on delivery and i have to use BAPI or BDC for posting. But i want to know what are the parameters  need to pass in bapi_goodsmvt_create because in current function module some body posting in transaction code MBOA using BDC. But in new function module we need to posting in transaction code - MIGO_GR using BAPI.So i want help for passing the parameters value in BAPI.

Thanks.

Read only

0 Likes
1,508

for parameters for you check my code, i have clealy mentioned it.

       gt_goodsmvt_header-pstng_date = sy-datum.
        gt_goodsmvt_header-doc_date   = sy-datum.
        gt_goodsmvt_header-ref_doc_no = w_likp-vbeln.

        LOOP AT gi_lips INTO gwa_lips.
          gt_goodsmvt_item-material           =  gwa_lips-matnr .
          gt_goodsmvt_item-plant                =  gwa_lips-werks.
          gt_goodsmvt_item-stge_loc             =  gwa_lips-lgort.
          gt_goodsmvt_item-deliv_numb_to_search = gwa_lips-vbeln.
          gt_goodsmvt_item-deliv_item_to_search = gwa_lips-posnr.
          gt_goodsmvt_item-move_type            = gwa_lips-bwart .    "'101'.
          gt_goodsmvt_item-entry_qnt            = gwa_lips-lfimg .    "'50'.
          gt_goodsmvt_item-entry_uom            = gwa_lips-vrkme.
          gt_goodsmvt_item-mvt_ind              = gwa_lips-kzbew.
          gt_goodsmvt_item-po_number            = gwa_lips-vgbel.
          gt_goodsmvt_item-po_item              = gwa_lips-vgpos.
          gt_goodsmvt_item-no_more_gr           = 'X'.
          APPEND  gt_goodsmvt_item.

        ENDLOOP.


        goodsmvt_code_tmp =          '01'. "Assign code to transaction for BAPI goods movement

        CLEAR gt_goodsmvt_headret.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header          = gt_goodsmvt_header
            goodsmvt_code            = goodsmvt_code_tmp
*      testrun                  = testrun
         IMPORTING
           goodsmvt_headret          =  gt_goodsmvt_headret
          TABLES
            goodsmvt_item            = gt_goodsmvt_item
*   GOODSMVT_SERIALNUMBER       =
            return                   = gt_return.
        REFRESH gt_goodsmvt_item.

Thanks

Raju C D

Read only

Former Member
0 Likes
1,508

Hi Raju,

So you did not posted via PO and may i know from lips table what value you fetched and posted.