I am using function module BAPI_ALM_ORDER_MAINTAIN to create an order which all works fine but if i execute the function module twice in the same program it fails to create an order the second time. Something to do with generating the number. I have inserted a 'commit work and wait' after the bapi call as well as:
call function 'BAPI_TRANSACTION_COMMIT'
wait = 'X'.
But still the second call fails.
If after executing it the first time i leave the program and SE80 then return and submit it again it allows me to create another order but then stops for the second etc etc..
Anyone got any ideas how i can fix this?