# Wht is function of MOD?

Hi Experts,

Pls. let me know that, Wht is the function of MOD, I got the info from SAP Help, as below, but, I did not understand. pls. let me clarify,

*I hv statemnt like, SUM = SUM MOD 43

*thanq

*DATA: SECONDS TYPE I,*

*TIME_FROM TYPE T VALUE '200000',*

*TIME_TO TYPE T VALUE '020000'.*

*SECONDS = ( TIME_TO - TIME_FROM ) MOD 86400.*

*SECONDS has the value 21600 (6 hours). The "MOD 86400" operation in this example ensures that the result is not negative, even if the time period spans midnight.*

Edited by: Srinivas on Mar 25, 2008 3:45 PM

##### Tags:

##### Ahmed Khan replied

Hi Srinivas,

MOD is nothing but ,it gives the value of the reminder. That's it.

Check the code below for better understanding.

When 101 MOD 10 is the stmt it gives the result as 1, because when 101 is divided by 10 it gives reminder as 1.

data: a type i value 101,

b type i.

b = a mod 10.

write : b.

Thanks & Regards,

AMK.

**<REMOVED BY MODERATOR>**

Edited by: Alvaro Tejada Galindo on Mar 25, 2008 5:10 PM