‎2012 Oct 17 5:56 AM
Hi,
I am using the Function Module BAPI_MATPHYSINV_CREATE and then BAPI_TRANSACTION_COMMIT for creating Physical Inventory document in a Z program.
My requirement is, this BAPI should create one document for 300 articles, and consider those batches with non zero stock only.
I am passing the article, and batch number in the ITEMS tab, but it is still not working. The BAPI creates many physical inventory documents by taking all the zero stock batches as well.
Please help.
‎2012 Oct 17 9:32 AM
Thanks, now its working.
I used the old FM only, which was BAPI_MATPHYSINV_CREATE and populated batches with positive quantity in the ITEMS tab. It worked.
‎2012 Oct 17 6:33 AM
Hi anita,
before you are passing the BATCH to the BAPI, please do check for zero stock batch .
so pass only the BTACHEs which are not ZEro stock..
rewardpoint if helpful.
regards
mueksh
‎2012 Oct 17 6:37 AM
Hi Anita,
can you please elaborate what is the error that you're facing.
In the items you need to pass Material and Batch.
Batch you need to mention in the ITAB.
Also try using the BAPI - 'BAPI_MATPHYSINV_CREATE_MULT'
i_maxitems = 300.
loop at it_tab.
i_items-material = it_tab-matnr.
i_items-batch = it_tab-batch.
append i_items.
clear i_items.
endloop.
call function 'BAPI_MATPHYSINV_CREATE_MULT'
exporting
head = i_head
maxitems = i_maxitems
tables
items = i_items
return = i_return.
read table i_return with key type = 'S' .
if sy-subrc = 0.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
Hope this is helpful.
Regards...
Sultana
‎2012 Oct 17 7:28 AM
Hi,
Accorind to the documentation of function modue 'BAPI_MATPHYSINV_CREATE' The method 'CREATE' is obsolete from 4.60 release onwards, so it is advicable to use the bapi 'BAPI_MATPHYSINV_CREATE_MULT' as suggested by Sultana Seher.
Regards,
Kartik
‎2012 Oct 17 7:32 AM
Hi,
Mukesh Chandu - I am selecting batches with positive stock only. I am yet to confirm results.
Sultana Seher: I will try this BAPI also. Thanks very much.
Kartik - It is working already - it is some problem with passing values or the coding. However if it still doesnt work I will try the BAPI mentioned by Sultana. Thanks !
‎2012 Oct 17 9:32 AM
Thanks, now its working.
I used the old FM only, which was BAPI_MATPHYSINV_CREATE and populated batches with positive quantity in the ITEMS tab. It worked.