As you are calling a standard bapi, first of all you have to debug it and clear the text fields before its execution finishes, so MII will not receive the invalid character and it will work.
After that, you will have to debug a lot of times until find exactly the field that have the invalid character.
So, you will have the create a new RFC function that will call the standard function and remove the invalid characters that the standard function will return.
And finally, you have to call your new RFC function in your MII transaction, instead of call the standard bapi.