Hi All,
In case that somebody face this too my dirty way is using FM AIPP_ALLOCATE_POSITION_DARK before BAPI_PS_PRECOMMIT in case the fields are mandatory and call it after BAPI_TRANSACTION_COMMIT if there are no error but using the new Object Number and do a commit after it.
You can save any error of FM AIPP_ALLOCATE_POSITION_DARK using for example BALW_BAPIRETURN_GET2 if sy-subrc is not 0.
I hope this helps, and if anybody has a better idea please share it.
Cheers,
RR