Application Development 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: 

regarding subtraction of 2 nos ?

Former Member
0 Kudos

hai...

my code :

data : a type konv-kwert value '3',

b type konv-kwert value '4'.

c type konv-kwert.

c = a - b.

write : c.

output : 1.00-.

but i want the output to be -1.00.

how to do it...

help me out...

3 REPLIES 3

Former Member
0 Kudos

hai,

use offset concept or shift statement.

SHIFT text UP TO 'you' LEFT CIRCULAR.

shan.

former_member189059
Active Contributor
0 Kudos

data : a type konv-kwert value '3',
b type konv-kwert value '4',
c type konv-kwert.
c = a - b.
write : c.

data c2 type string.

if c < 0.
  compute c2 = abs( c ).
  concatenate '-' c2 into c2.
else.
  c2 = c.
endif.

write:/ c2.

0 Kudos

HI

You can use this code also ,

data : a type konv-kwert value '13',

b type konv-kwert value '112',

c type konv-kwert.

c = a - b.

IF C > 0 .

WRITE 😕 C NO-SIGN .

ELSE .

WRITE 😕 C USING EDIT MASK 'V___' .

ENDIF .

Regards

Digvijay rai