09-11-2007 11:21 AM
Hi,
How to find difference between 2 numbers in percentage.
Is there any standard function module.
For example. I m having two numbers.
25 & 31. I want to find how many percentage 25 is different from 31.
Thanks in advance.
09-11-2007 11:24 AM
oh well thats 5th class in math. but still we will help you.
according to your example it would be 31-25 / 31 * 100 <=> 6/31 * 100 = 19,35%
09-11-2007 11:35 AM
Thanks for ur help i know the formula
we can calculate this using this fromula also
100 - (25/31*100) = 19.355
My question is there any standard Function module or i have to built a new one.
Thanks.
09-11-2007 11:27 AM
hi,
subtract 31 from 25 and divide 31 and multiply by 100. you will get the percentage
Regards
Shiva
09-11-2007 11:27 AM
Hi,
Look at the below function modules
RHPA_CALC_VALUE_PERCENTAGE
CALCULATE_PERCENTAGE
WB2_CALC_AMOUNT_FROM_PERCENT
Regards
Sudheer
09-11-2007 11:28 AM
hi,
manual coding would be like this,
data: no1 type i,
no2 type i,
no1per type d,
no2per type d,
diff type d.
no1per = no1 / 100.
no2per = no2 / 100.
if no1per >= no2per
diff = no1per - no2per.
write:/10 '% diff of',no1,'and',no2,' is',diff.
else.
diff = no2per - no1per.
write:/10 '% diff of',no2,'and',no1,' is',diff.
if helpful reward some points.
with regards,
Suresh Aluri.