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_GOODSMVT_CREATE -- MB31

Former Member
0 Likes
1,343

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!

3 REPLIES 3
Read only

Former Member
0 Likes
817

Hi,

Welcome to SDN.

Please take a look at this links for sample coding of BAPI_GOODSMVT_CREATE.

http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm

http://www.4ap.de/abap/bapi_goodsmvt_create.php

Regards

Read only

0 Likes
817

Dear Kiran Sure,

I was auctually follow the reference code to develop, but i've still got the problem and that's why i'm trying to raise my problem here. Thanks for your help anyway.

Regards.

Read only

Former Member
0 Likes
817

Dear All,

I've tried another test for the BAPI_GOODSMVT_CREATE function itself. I passed the same parameters into the function, and I got it pass and returned a material doc. It really made me more confuse on that. Pls help!!