12-05-2007 12:54 PM
Hi !
i have a numeric type variable i.e. 'w_xyz type n length 7'
now i want to delete the leading zero's for this variable simultaneously want to retain the length of the field unaltered i.e.
if w_xyz = '0000987' then i want
w_xyz = ' 987'.
any help pls,
Thanks in advance.
Regards,
Parwez.
12-05-2007 12:57 PM
Hi,
Move that into character variable and unpack it and then use STRLEN funtion on the char variable .
data:v_char(7).
v_char = w_xyz.
unpack v_char to v_char.
n = strlen(v_char).
Regards,
Vigneswaran S
12-05-2007 12:58 PM
12-05-2007 1:00 PM
use the FM CONVERSION_EXIT_ALPHA_OUTPUT
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT =w_xyz
IMPORTING
OUTPUT =w_xyz
12-05-2007 1:02 PM
Hi,
There is a simple way to achieve that : just use shift statement.
SHIFT w_xyz LEFT DELETING LEADING '0'.
Regards,
Nicolas.
12-05-2007 1:16 PM