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

display minus data

Former Member
0 Likes
1,333

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

how could i do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,095

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
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,092

Hi,

U can use this statement::

DATA TEST TYPE I VALUE '123456-'.

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

Cheers,

Simha.

Read only

Former Member
0 Likes
1,092

Hello Gang,

data w_amount(15).

if amount LT 0.

amount = amount * -1.

concatenate '-' amount into w_amount.

ENDIF.

display w_amount field.

Read only

Former Member
0 Likes
1,096

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

Read only

0 Likes
1,092

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.

Read only

Former Member
0 Likes
1,092

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.

Read only

Former Member
0 Likes
1,092

hi,

use function module 'CLOI_PUT_SIGN_IN_FRONT'.

Regards

Naveen