‎2007 Jun 21 7:33 AM
Can anyone explain me the use of ABS statement.
Eg. f = abs(g).
‎2007 Jun 21 7:35 AM
Hi
ABS statement gives the absolute value of any field
means if it is Negative it gives the positive value
Reward points for useful Answers
Regards
Anji
‎2007 Jun 21 7:35 AM
use to convert -ve to +ve or viseversa
Use ABS function or multiple it with minus 1 are same
f1 = ABS ( f1 ).
f1 = f1 * -1.
‎2023 Feb 17 3:21 PM
Feel like I'm being super picky on a 16 year old post...
but it's not technically correct to say "ABS function or multiple(sic) it with minus 1 are same"
If the original operand is negative, this is true.
If the original operand is positive... ABS will return a positive result; * -1 will return a negative result...
So basically, like a cheerful developer... it removes any negativity...
‎2007 Jun 21 7:38 AM
Hi Camila,
This statement returns the absolute value of the number g, ie f will contain the absolute value of g. Absolute value means the value without taking into consideration the sign.
For example, if g has the value -10, f will get the value 10.
Reward points if helpful.
Regards
Renuka
‎2007 Jun 21 7:45 AM
camila,
ABS()--Means it will convert - sign to + sign
Ex : F1 = -100.
F2 = ABS ( f1 ).
Write : F2.
Ans: 100
Don't forget to reward if useful...
‎2007 Jun 21 8:01 AM
HI,
use to convert -ve to +ve or viseversa
Use ABS function or multiple it with minus 1 are same , which gives same result.
for ex:
data a type i value -10.
a = ABS(a)
write a. o/p is 10
if helpful reward some points.
with regards,
suresh.
‎2007 Jun 21 8:21 AM
Hi all,
ABS like i.e. sign, ceil or trunc are so-called overloaded functions. That means that the type of the result is determined by the type of the argument.
When creating such functional methods using the class builder I learned that the RETURN parameter must be explicily typed. So my question is: Can you create overloaded functions with ABAP class builder?
TIA,
Regards,
Clemens