12-11-2007 3:45 AM
Hi,
May i know how to take only the last 10 digit from the serial number? but the serial may have only 1 digit.
thank you!
12-11-2007 4:07 AM
Hi,
data:char(30) value 'hgiu78t'.
DATA:NUM(30) TYPE N,out(10) type n.
data:len(3) TYPE N.
num = char.
len = strlen( num ).
len = len - 10.
out = num+len.
SHIFT out LEFT DELETING LEADING '0'.
write:/ out.
rgds,
bharat.
12-11-2007 3:53 AM
Hi,
You can use the following code.
data : c type i.
c = strlen( serialnumber ).
c = c - 10.
move serialnumber+c(10) to digit.
digit has the last 10 numbers of the serial number.
Reward points if this helps........
Regards,
Ravi G
12-11-2007 4:07 AM
Hi,
data:char(30) value 'hgiu78t'.
DATA:NUM(30) TYPE N,out(10) type n.
data:len(3) TYPE N.
num = char.
len = strlen( num ).
len = len - 10.
out = num+len.
SHIFT out LEFT DELETING LEADING '0'.
write:/ out.
rgds,
bharat.
12-11-2007 4:17 AM
Hi ,
Here is program which acheives your requirement
parameter : string1(20) type c.
data : len type i ,
len1 type i ,
string2(10) type c.
start-of-selection.
len = strlen( string1 ).
len1 = len - 10.
if len1 >= 0.
string2 = string1+len1.
else.
string2 = string1.
endif.
write string2.
Regards,
Arun