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

convert negative amount

Former Member
0 Likes
686

Hi,

I want to convert numeric data(variable declared as numeric) to negative amount. so that after adding with positive amount it will be automatically deduct with that amount.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
646

Multiply by (-1) ??

Rob

4 REPLIES 4
Read only

Former Member
0 Likes
646

Declare the variable as TYPE i.

Read only

faisalatsap
Active Contributor
0 Likes
646

Hi,

Please test the following code may be you need like this.

DATA amount TYPE i.

amount = '-23'.
amount = amount + 40.

WRITE: amount.

Please Reply if else requirement

Kind Regards,

Faisal

Read only

Former Member
0 Likes
647

Multiply by (-1) ??

Rob

Read only

former_member156446
Active Contributor
0 Likes
646

Hi there..

just multiply by - 1.

lv_negatvie = -1.

lv_numc = lv_numc * lv_negative.