Hello
When posting a confirmation using a BAPI, the goods movements are always posted in the update process (background). In this case, system always use a different material document for goods receipts and goods issues. Please take a look on question 4 of the FAQ note 1586230:
Question: Is it possible to have the goods movements 101 and 261 in a material document when posting using a BAPI?
Answer: No, this is not possible in the BAPI. For technical reasons, goods receipts and goods issues must be transferred in separate packages of inventory management during the posting in a BAPI. This leads to the different material documents.
See also question 11 of the FAQ note 540392.
BR
Caetano