If you are using only standard BAPI and absolutely zero direct table inserts, open an support message in http://service.sap.com/support.
Create an example in SE37 for the BAPI that is throwing the error, and include that test data in the support message.
SAP will not support Z programs, so don't even try to talk about your program. Just talk about the BAPI that is throwing the error. This is very important.