Hi Murali,
As mentioned by Baskar, please revisit and check your UDF.
Also check if you are using substring anywhere.
Try checking the string's length before calling substring.
If it is long enough, call the substring, otherwise leave it as it is.
Regards,
Pranil.