It is very useful in case of you are going to upgrade from iScala 2.2 SR2 to v.3.0 as well as installing a newer HotFix.
It seems Epicor made the latest HotFix 3.00.2380 very sensitive on that, especially when printing out an invoice.
In a most recent case iScala invoked an error while complaining about DDF Field <420> Customer VAT Number.
So the field needed to be trimmed in order to fix this issue by executing the funtion below
UPDATE SL01cc00 SET SL01021 = dbo.Trim(SL01021)
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE FUNCTION [dbo].[Trim] (
RETURNS nvarchar(max) AS
DECLARE @Result nvarchar(max)
SET @Result = LTRIM(RTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
LTRIM(RTRIM(@Str)), CHAR(9), ''), CHAR(10), ''), CHAR(11), ''), CHAR(12), ''), CHAR(13), '')))