cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_GOODSMVT_CREATE - MB31

Former Member
0 Kudos

Dear Expert,

I've tried to use BAPI_GOODSMVT_CREATE function to handle the mass GR for production order. Pls help the following problem regarding about "BAPI_GOODSMVT_CREATE".

That's what I've used for some parameters, and pls navigate me if I had done a mistake.

gmcode-gm_code = '02'. "02 - MB31 - Goods Receipts for Prod Order

loop at pcitab.

itab-move_type = pcitab-mvt_type.

itab-mvt_ind = 'F'.

itab-plant = pcitab-plant.

itab-orderid = pcitab-prod_doc.

itab-entry_qnt = pcitab-qty.

itab-move_batch = pcitab-batch.

itab-move_stloc = pcitab-stge_loc.

append itab.

endloop.

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.

With the above parameters, I've got the following message:

Error in function

Order 100000841 not found or not permitted for goods movement

One the other hand, I'd used the same data to simulate MB31 transaction and it was OK and return a material doc. number. Pls tell me what wrong with my code. With many thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Dsk
Active Contributor
0 Kudos

1. Hi first check if the manual GR for the order is possible through mb31 or co15 or co11n.

2. Because the GR posting can be errored if the status of the order is not correct .

Ex: if the order is not yet released then you cannot make the GR for the order.

Let me know the feedback

DsK

Former Member
0 Kudos

Hi DsK,

The order was confirmed and went through MB31 manually and it was OK. Even I did try to put the parameters in BAPI_GOODSMVT_CREATE function by using SE37, it also returned a material doc. to me. Pls anyone can help me on this. Thanks anyway!