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: 

Negative amounts in excel imported data from sap

Former Member
0 Kudos

Hi all,

i'm transportin data from an internal table to an excel sheet. Amounts are like '1954.52-' in internal table when amount is négative ( minus sign at right ). when exporting in excel sheet the format is an shown.

I hope to have amount with minus sign in beginin (at left) of cell as folowing :'-1954.52'.

How can i do it?

Thank you for you responses

5 REPLIES 5

Former Member
0 Kudos

FM CLOI_PUT_SIGN_IN_FRONT Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are

Former Member
0 Kudos

Hi Mohammed,

Use CLOI_PUT_SIGN_IN_FRONT function module to get the minus sign to be front for negative numbers.

Thanks,

Vinay

0 Kudos

Thank you Vinaykumar,

would you like to take me abap code to do that. I tried to do that with folowing code but it dosen't work

call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

exporting value = lv_mntsld.

0 Kudos

I've found it

call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

changing value = lv_mntval.

Thanks all,

The problem is solved

0 Kudos

Hi Mohammed,

As 'value' is changing parameter, value is considered as both import and export parameter. The 'value' parameter will itself holds the resutls after execution of function modue.

Try with this code.


data lv_mntsld type i value '100-'.

write lv_mntsld.   "Output as 100-

call FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
exporting value = lv_mntsld.

write lv_mntsld.    "Output as -100

Thanks,

Vinay