Application Development 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: 

Difference between two numbers in percentage.

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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%

0 Kudos

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.

Former Member
0 Kudos

hi,

subtract 31 from 25 and divide 31 and multiply by 100. you will get the percentage

Regards

Shiva

Former Member
0 Kudos

Hi,

Look at the below function modules

RHPA_CALC_VALUE_PERCENTAGE

CALCULATE_PERCENTAGE

WB2_CALC_AMOUNT_FROM_PERCENT

Regards

Sudheer

Former Member
0 Kudos

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.