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
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
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,
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Mar 25, 2008 5:10 PM
In general "MOD" is called as modulo division which gives the reminder value. If we user '/' we get only the quotient.
Consider a value 9999.
If we want the quotient of 9999 when divided by 100 then we use '/'. i.e. 9999 / 100 = 99.99
If we want the reminder then we go for modulo division using 'mod'. i.e. 9999 mod 100 = 99.
Reward points if helpful.