Startbeitrag von Christoph Erdmann am 03.09.2013 08:26
Hallo,
i want to check the IBAN number. I found, how to do it, but i must calculate :
modulo(700901001234567890131400, 97)
= -45 ????
Maybe the number has too much digits or i make a mistake. Has someone a solution to check then IBAN ?
Christoph
i want to check the IBAN number. I found, how to do it, but i must calculate :
modulo(700901001234567890131400, 97)
= -45 ????
Maybe the number has too much digits or i make a mistake. Has someone a solution to check then IBAN ?
Christoph
Antworten:
FWIW, the number of digits varies markedly from country to country and also the position of the elements in it.
So much for an ehhhh ... "standard"...
Not to state the obvious, you perhaps have even better docs, but this wiki page did help me to grasp some of the finer points:
http://en.wikipedia.org/wiki/International_Bank_Account_Number#Algorithms
HTH
von Charles U. Schneiter - am 03.09.2013 08:49
here is the procedure we use
user puth the IBAN in ED_IBAN and press the checkit button
PROCEDURE lp_CheckIBAN()
// complete with landcode in front
// list used for numbering asc
A=10,B=11,C=12,D=13,E=14,F=15,G=16,H=17,I=18,J=19,K=20,L=21,M=22,N=23,O=24,P=25,Q=26,R=27,S=28,T=29,U=30,V=31,W=32,X=33,Y=34,Z=35
// example BE76 7895 2276 0195
// BE76 SET TO END and B and e set to numbers B =11 E= 14 dus 111476
//
// 789522760195 111476
//
LOCAL
lv_IBAN est chaîne
VMatch1 est chaîne //landcode
VMatch2 est chaîne //check digit
VMatch3 est chaîne // rest inbannr
viban est chaîne
vLength est entier
vResult est chaîne
pIBAN est chaîne
pMODULO est entier = 97
vSTRNUM est chaîne
vCHECKDIGIT est chaîne
vCOUNT est entier
vMOD est entier
lv_IBAN = NoSpace(ED_IBAN)
lv_IBAN = Replace( lv_IBAN, "-", "")
lv_IBAN = Replace( lv_IBAN, " ", "")
lv_IBAN = Replace( lv_IBAN, "/ ", "")
VMatch1 = Left(lv_IBAN,2)
VMatch2 = Middle(lv_IBAN,3,2)
VMatch3 = Middle(lv_IBAN,5)
lv_IBAN = vmatch3 + vmatch1 + vmatch2
lv_IBAN = Replace(lv_IBAN, "A", "10")
lv_IBAN = Replace(lv_IBAN, "B", "11")
lv_IBAN = Replace(lv_IBAN, "C", "12")
lv_IBAN = Replace(lv_IBAN, "D", "13")
lv_IBAN = Replace(lv_IBAN, "E", "14")
lv_IBAN = Replace(lv_IBAN, "F", "15")
lv_IBAN = Replace(lv_IBAN, "G", "16")
lv_IBAN = Replace(lv_IBAN, "H", "17")
lv_IBAN = Replace(lv_IBAN, "I", "18")
lv_IBAN = Replace(lv_IBAN, "J", "19")
lv_IBAN = Replace(lv_IBAN, "K", "20")
lv_IBAN = Replace(lv_IBAN, "L", "21")
lv_IBAN = Replace(lv_IBAN, "M", "22")
lv_IBAN = Replace(lv_IBAN, "N", "23")
lv_IBAN = Replace(lv_IBAN, "O", "24")
lv_IBAN = Replace(lv_IBAN, "P", "25")
lv_IBAN = Replace(lv_IBAN, "Q", "26")
lv_IBAN = Replace(lv_IBAN, "R", "27")
lv_IBAN = Replace(lv_IBAN, "S", "28")
lv_IBAN = Replace(lv_IBAN, "T", "29")
lv_IBAN = Replace(lv_IBAN, "U", "30")
lv_IBAN = Replace(lv_IBAN, "V", "31")
lv_IBAN = Replace(lv_IBAN, "W", "32")
lv_IBAN = Replace(lv_IBAN, "X", "33")
lv_IBAN = Replace(lv_IBAN, "Y", "34")
lv_IBAN = Replace(lv_IBAN, "Z", "35")
vSTRNUM = Left(lv_IBAN,10)
lv_IBAN = Middle(lv_IBAN,11)
WHILE (lv_IBAN "")
vMOD = modulo (Val(vSTRNUM), pMODULO)
vSTRNUM = vMOD + Left(lv_IBAN,8)
lv_IBAN = Middle(lv_IBAN,9)
END
IF (modulo (Val(vSTRNUM), pMODULO)) = True // Modulo 97 controle = goed doorstaan
lv_IBAN = ED_IBAN
vLength = Length (lv_IBAN)
vCOUNT = vlength - 1
vCHECKDIGIT = Left(lv_IBAN,vCOUNT)
vCOUNT = vCOUNT - 1
lv_IBAN = Left(lv_IBAN,vCOUNT)
vSTRNUM = Left(lv_IBAN,10)
lv_IBAN = Left(lv_IBAN,11)
WHILE (lv_IBAN "")
vMOD = modulo (Val(vSTRNUM), pMODULO)
vSTRNUM = vMOD + Left(lv_IBAN,8)
lv_IBAN = Middle(lv_IBAN,9)
END
// Check digit is ook juist
IF ((pMODULO + 1) - modulo (Val(vSTRNUM), pMODULO) = vCHECKDIGIT ) THEN
vresult = "NOK"
ELSE
vresult = "OK"
END
ELSE
vresult = "NOK"
END
Info("Check for " + ED_IBAN + " result: " + vresult + " ")
greetings Marc :rolleyes:
von Marc De Swert - am 03.09.2013 08:55
Getal is 8-byte int=0
Rest is int = 0
Geldig is boolean = False
I is int
IF NoSpace(aIBAN) "" THEN
aIBAN = StringFormat(aiban,ccIgnoreAccent+ccIgnorePonctuationAndSpace+ccIgnoreSpace+ccUpCase)
IF Middle(aIBAN, 1, 4) ~= "IBAN" THEN aIBAN = Middle(aIBAN, 5, Length(aIBAN))
aIBAN = Middle(aIBAN, 5, Length(aIBAN)) + Middle(aIBAN, 1, 4)
I = 1;
WHILE I
von Bart VDE - am 03.09.2013 09:22
Chrsitoph
von Christoph Erdmann - am 03.09.2013 11:48