cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mathematical Function ABS() not working

Former Member
0 Likes
3,592

Hi

The ABS Function is not working for the formulae created in the report. The values is getting subtracted, but '-' value is not getting removed from the final output.

Can anyone suggest how to proceed further.

Regards

Nitin

View Entire Topic
henrique_costa
Discoverer
0 Likes

Hi.

We can solve this way:

DATA: valor TYPE i,
zval TYPE i.


zval = '-111.1'.
PERFORM abs USING zval CHANGING valor.

WRITE valor.
FORM abs USING p_zval
CHANGING p_valor.

IF p_zval LE 0.
p_valor = p_zval * -1.
ELSE.
p_valor = p_zval.
ENDIF.