Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Check number?

Former Member
0 Likes
553

Hi,

i have five digit reference is and weighting numbers(1,2,5,3,6,4,8,7,10,9) is there.

Reference number :

3 2 5 4 6

Weighting 6 3 5 2 1

products (multiple the 18+ 6+ 25+ 8 + 6 = 63

63 divided by 11 yeilds a remainder 8, (11-8=3).there fore check digit is 3.

if the remainder is 0, this is the check digit.If the reamainder is 1, the check digit is 10 and is represendted by X.If the remainder falls between 2 and 10 it is substracted from 11, the difference is the check digit.

so i will display the check digit in the layout check number.

see below example

4478888 765555555 88893

what is logic?

above numbers)

Hi,

i have five digit reference is and weighting numbers(1,2,5,3,6,4,8,7,10,9) is there.

Reference number :

3 2 5 4 6

Weighting 6 3 5 2 1

products (multiple the 18+ 6+ 25+ 8 + 6 = 63

63 divided by 11 yeilds a remainder 8, (11-8=3).there fore check digit is 3.

if the remainder is 0, this is the check digit.If the reamainder is 1, the check digit is 10 and is represendted by X.If the remainder falls between 2 and 10 it is substracted from 11, the difference is the check digit.

so i will display the check digit in the layout check number.

see below example

4478888 765555555 88893

what is logic?

above numbers)

2 REPLIES 2
Read only

vinod_vemuru2
Active Contributor
0 Likes
496

Hi Srihitha,

Check below logic,

l_len = strlen(ref num).

eg: ref num = 3 2 5 4 6

now l_len will be 5.

weight = 6 3 5 2 1

CLEAR l_sum.

DO l_len times.

l_tabix = sy-tabix.

l_sum = l_sum + (refnuml_tabix(1) * weightl_tabix(1)).

ENDDO.

Now l_sum has 63.

l_checkdigit = l_sum MOD 11.

If l_checkdigit EQ 0.

do some thing.

ELSEIF Check ur conditions here and populate data accordingly.

Hope this will be helpfull.

Thanks,

Vinod.

Read only

0 Likes
496

Vinod,

Thanks for replying.

Regards,

Srihitha