‎2007 Nov 30 6:13 AM
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!
‎2007 Nov 30 6:18 AM
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
‎2007 Nov 30 6:24 AM
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.
‎2007 Dec 06 10:00 AM
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!!