Hi,
Have you checked directly with the transaction? is the same behavior to generate the one document for one production order.
If it is only happening in BAPI, check the filling of items in BAPI internal table.
- this should be the internal table and fill the all item details and do it once for
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = ls_goodsmvt_header
goodsmvt_code = ls_goodsmvt_code
importing
materialdocument = lv_materialdocument
matdocumentyear = lv_matdocumentyear
tables
goodsmvt_item = lt_goodsmvt_item
return = lt_return.