Issue
When trying to generate a document this SAP error is thrown:
41027: SBO Error when adding BO with key '0'; '-5002' value in discount field is greater than permitted
Solution
It's an error raised by SAP. Check the discount field on the sales order, and make sure the authorizations of the user is correct so he can give percentage discounts.