Application Development and Automation 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: 
Read only

remove negative sign

Former Member
0 Likes
12,249

i want to remove negative sign from amount

e.g 18000.00- should display as 18000.00

how to do it ?

2 REPLIES 2
Read only

Former Member
0 Likes
3,750

Hi,

Use 'NO-SIGN' when moving to the output...

or

use this FM CLOI_PUT_SIGN_IN_FRONT

Or

better way is

output = input * - 1.

Regards

Kiran

Read only

Former Member
0 Likes
3,750

negative amount x -1 = positive amount

do the following:


DATA:
  gv_neg_amount  TYPE i,
  gv_pos_amount  TYPE i.

...

* i assume that your original amount is stored in GV_NEG_AMOUNT

MOVE gv_neg_amount TO gv_pos_amount.
IF gv_neg_amount LT 0.
* switch negative amount to positive amount
  gv_pos_amount = gv_pos_amount * -1.
ELSE.
* amount is already positive
ENDIF.

WRITE: / gv_pos_amount