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: 

display minus data

Former Member
0 Kudos

i want to display minus data with type 'CURR' '765.12-' like '-765.12' using write clause.

how could i do?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Gang USE this FM

CLOI_PUT_SIGN_IN_FRONT.Pass your value to this FM.

Check this code also

REPORT ZTEST.

data : a(10) type c value '765.12-'.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

VALUE = a.

write : a.

Output -765.12.

Message was edited by: mukesh kumar

6 REPLIES 6

Simha_
Employee
Employee
0 Kudos

Hi,

U can use this statement::

DATA TEST TYPE I VALUE '123456-'.

WRITE TEST USING edit mask 'V__________' LEFT-JUSTIFIED.

Cheers,

Simha.

Former Member
0 Kudos

Hello Gang,

data w_amount(15).

if amount LT 0.

amount = amount * -1.

concatenate '-' amount into w_amount.

ENDIF.

display w_amount field.

Former Member
0 Kudos

Hi Gang USE this FM

CLOI_PUT_SIGN_IN_FRONT.Pass your value to this FM.

Check this code also

REPORT ZTEST.

data : a(10) type c value '765.12-'.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

VALUE = a.

write : a.

Output -765.12.

Message was edited by: mukesh kumar

0 Kudos

CLOI_PUT_SIGN_IN_FRONT will take any values, Character and numeric. It basically make the sign as pre-fix. Eg 53.6- to -53.6.

Former Member
0 Kudos

Hi Gang,

You can do that using the FM CLOI_PUT_SIGN_IN_FRONT. But before doing that, you have to convert the currency to Char format.

SO assign the currency value to some character variable and pass that variable to this FM.

But if you want to use write statement, you can simply concatenate the minus sign with the absolute value of currency and do it.

It will work.

<b>Close the thread once the problem is resolved.</b>

Regards,

SP.

Former Member
0 Kudos

hi,

use function module 'CLOI_PUT_SIGN_IN_FRONT'.

Regards

Naveen