Declare a variable length type i in Global Defination ... Length field will calculate the string length.
scn.sap.com