‎2014 Feb 10 10:48 AM
Hi Folks,
I want to know if there is any function module for generating Alpha Numeric serial Number for the specified range in SAP.
Thanks & Regards ,
Vikram
‎2014 Feb 10 11:02 AM
‎2014 Feb 10 11:19 AM
Hi adrian,
i need to generate for 5 digits..any other way of generating nos.
‎2014 Feb 10 11:35 AM
Hi vikram,
You can use that example code an modify it to your purpose.
‎2014 Feb 10 12:19 PM
‎2014 Feb 14 5:27 AM
Thanks all ....used the below code.
REPORT YALPHASERIAL.
data: v_str(7) type c,
v_hx(1) type x,
v_len type i,
v_off type i.
field-symbols <fs>.
v_str = '12B345Z'.
*v_str = 'Z9Z99Z9'.
Do 10 TIMES.
write:/ 'Initial:', v_str.
v_len = strlen( v_str ).
v_off = v_len - 1.
do v_len times.
if v_str+v_off(1) between 'A' and 'Z'.
if v_str+v_off(1) lt 'Z'.
assign v_str+v_off(1) to <fs> casting type x.
add 1 to <fs>.
exit.
else.
v_str+v_off(1) = 'A'.
endif.
elseif v_str+v_off(1) between '0' and '9'.
if v_str+v_off(1) lt '9'.
v_str+v_off(1) = v_str+v_off(1) + 1.
exit.
else.
v_str+v_off(1) = '0'.
endif.
endif.
v_off = v_off - 1.
enddo.
write:/ 'Final:', v_str.
ENDDO.