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

How to convert Negative

Former Member
0 Likes
2,010

Hi

I have a field KONV-KWERT , i am doing some calculation using this field, during the calculation i need negative value also for this field, how to make that?

for example Konv-kwert contains 78.3. Now i need 78.3-. How to make this, If i concatenate minus with this value after i cannt calculate anything, so by programatically how to do this?

Any one please help.

Mohana.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,382

abs( KONV-KWERT ) * -1

Hi

I have a field KONV-KWERT , i am doing some calculation using this field, during the calculation i need negative value also for this field, how to make that?

for example Konv-kwert contains 78.3. Now i need 78.3-. How to make this, If i concatenate minus with this value after i cannt calculate anything, so by programatically how to do this?

Any one please help.

Mohana.

7 REPLIES 7
Read only

Former Member
0 Likes
1,382

Hi,

Try to multiply your value by -1.

Regards,

Nicolas.

Read only

former_member187255
Active Contributor
0 Likes
1,382

Mohana,

Try this..

<b>KNOV-KWERT = -1 * KNOV-KWERT.</b>

Chandra.

Read only

Former Member
0 Likes
1,382

Mohana,

Just declare another variable , say i.

then i = konv-kwert * -1.

Regards

Aneesh.

Read only

Former Member
0 Likes
1,382

Just do the following:

KONV-KWERT = KONV-KWERT * -1.

This will invert the positive value into a negative one and vice versa.

Regards,

Michael

Read only

former_member188829
Active Contributor
0 Likes
1,382

Also Do Like this..

Just By Subtracting 0..

<b>KONV-KWERT = 0 - KONV-KWERT.</b>

Message was edited by:

Vishnu Reddy

Read only

Former Member
0 Likes
1,382

great <b>ABAP</b> question!!!

Read only

Former Member
0 Likes
1,383

abs( KONV-KWERT ) * -1