cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_GOODSMVT_CREATE for GR Revesal with Inspection Lot

pawadee_k
Participant
0 Kudos

I used BAPI_GOODSMVT_CREATE to cancel good receipt (GMCODE 01 for purchase order and 02 for production order) with MVT=101 AND XSTOB='X'. I didn't use BAPI_GOODSMVT_CANCEL because since I need to set movement reason and also pass serial numbers in some case.

After executing the BAPI, the stock is successfully reversed however the inspection lot created during goods receipt were still exist. How do I removed the inspection lot?

Another thing I noticed is that in MSEG table, Goods Recipt that are cancelled through MIGO has the field SMBLN (material document) populated but via BAPI this field is not populated.

Accepted Solutions (0)

Answers (2)

Answers (2)

pawadee_k
Participant
0 Kudos

I solved it by using function module 'MB_CANCEL_GOODS_MOVEMENT' and passing the table IMSEG table and MBLNR_TAB.

MBLNR_TAB: material doc, item, doc year
IMSEG: material doc, item, doc year, reason for movement

0 Kudos

movement type must be 102 for reversal of GR

MVT = 102

please check once

pawadee_k
Participant
0 Kudos

I was marking XSTOB='X', that is why I use MVT=101 since it reverse MVT automatically.

I did tried with XSTOB='' AND MVT=102, it gives the same results.