‎2006 Jul 26 4:29 PM
HI All,
Pls write a simple code for me.
0=0
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
A=10
B=12
C=13
D=14
E=15
F=16
G=17
H=18
I=19
J=20
K=21
L=23
M=24
N=25
O=26
P=27
Q=28
R=29
S=30
T=31
U=32
V=34
W=35
X=36
Y=37
Z=38
Use modulus 11 and remindr is check digit
Example
EIMU466000
15*1+
19*2+
24*4+
32*8+
4*16+
6*32+
6*64+
0*128+
0*256+
0*512
=1045/11=95 and reminder is 0 check digit is 0
When 11th digit enter by customer .It has to veryfy the above logic & check the riminder.
For incorrect entry Pass the error message.
Thanks in advance,
Singha
‎2006 Jul 26 5:31 PM
HI,
Please try following logic
var1 = 'EIMU466000'.
var = strlen(var1).
do var times.
var2 = var1+var(1).
case var2.
when '0'
sum = sum + 0 * var.
when '1'
sum = sum + 1 * var
when.....(use all digits)
endcase.
enddo.
sum1 = sum /11.
if sum1 > 0.
message .....
endif.
Regards,
Amole
‎2006 Jul 26 5:32 PM
Please see if the following SAP Function Modules are of any help.
VALIDATE_CHECK_DIGIT
FVVN_CHECK_DIGIT